Note
This extension is currently in beta (pre-v1.0), and may see breaking changes until the first stable release (v1.0).
Developers can effortlessly connect, interact, and generate data insights with BigQuery datasets and data using natural language commands.
Learn more about Gemini CLI Extensions.
Important
We Want Your Feedback! Please share your thoughts with us by filling out our feedback form. Your input is invaluable and helps us improve the project for everyone.
- Natural Language to insights : Ask a variety of questions from your BigQuery data and generate intelligent insights.
- Seamless Workflow: Stay in your CLI. No need to constantly switch contexts to the GCP console for generating analytics insights. .
- Leverage prebuilt agent : Access to advanced insights offered by a built-in agent behind Conversational Analytics API
Before you begin, ensure you have the following:
- Gemini CLI installed with version +v0.6.0.
- Setup Gemini CLI Authentication.
- A Google Cloud project with the Data Analytics API with Gemini, Gemini for Google Cloud API and BigQuery API enabled.
- Ensure Application Default Credentials are available in your environment.
- IAM Roles:
- BigQuery User (
roles/bigquery.user) (for executing queries and view metadata) - Gemini for Google Cloud (
roles/cloudaicompanion.user) (to use the conversational analytics API)
- BigQuery User (
To install the extension, use the command:
gemini extensions install https://github.com/gemini-cli-extensions/bigquery-conversational-analyticsYou will be prompted to configure the following settings during installation. These settings are saved in an .env file within the extension's directory.
BIGQUERY_PROJECT: The GCP project ID.BIGQUERY_LOCATION: (Optional) The dataset location.
To view or update your configuration:
List Settings:
- Terminal:
gemini extensions list - Gemini CLI:
/extensions list
Update Settings:
- Terminal:
gemini extensions config bigquery-conversational-analytics [setting name] [--scope <scope>]setting name: (Optional) The single setting to configure.scope: (Optional) The scope of the setting in (userorworkspace). Defaults touser.
- Currently, you must restart the Gemini CLI for changes to take effect. We recommend using
gemini --resumeto resume your session.
Alternatively, you can manually set these environment variables before starting the Gemini CLI:
export BIGQUERY_PROJECT="<your-gcp-project-id>"
export BIGQUERY_LOCATION="<your-dataset-location>" # Optional
export BIGQUERY_SCOPES="https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/drive" # Optional
export BIGQUERY_MAX_QUERY_RESULT_ROWS=50 # OptionalNote
- Ensure Application Default Credentials are available in your environment.
- See Troubleshooting for debugging your configuration.
To start the Gemini CLI, use the following command:
geminiInteract with BigQuery using natural language right from your IDE:
-
Ask for insights
- Using the tables under bigquery-public-data.google_analytics_sample , tell me the channels I should focus on and why?
This extension provides a comprehensive set of tools:
ask_data_insights: Perform data analysis, get insights, or answer complex questions about the contents of specific BigQuery tables.search_catalog: Find BigQuery tables relevant to users, natural language query.
Find additional extensions to support your entire software development lifecycle at github.com/gemini-cli-extensions, including:
- BigQuery Data Analytics
- and more!
Use gemini --debug to enable debugging.
Common issues:
- "failed to find default credentials: google: could not find default credentials.": Ensure Application Default Credentials are available in your environment. See Set up Application Default Credentials for more information.
- "✖ Error during discovery for server: MCP error -32000: Connection closed": The database connection has not been established. Ensure your configuration is set via environment variables.
- "✖ MCP ERROR: Error: spawn /Users/USER/.gemini/extensions/bigquery-conversational-analytics/toolbox ENOENT": The Toolbox binary did not download correctly. Ensure you are using Gemini CLI v0.6.0+.
- "cannot execute binary file": The Toolbox binary did not download correctly. Ensure the correct binary for your OS/Architecture has been downloaded. See Installing the server for more information.