-
Notifications
You must be signed in to change notification settings - Fork 159
Create Google Gemini cli extension #8177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
780c2ec
initial setup
grahamplata 79d0366
address prettier issues
grahamplata 39ed6e2
move docs
grahamplata 9719397
Merge branch 'main' into gplata/gemini-extension
grahamplata be569bd
initial review pass
grahamplata 6bec3bc
allow rill-gemini-extension user agents
grahamplata 0ee2ee1
update documentation for Analyst Agent features
grahamplata 319985e
simplify persistent context and rely on agents
grahamplata f77346c
Merge branch 'main' into gplata/gemini-extension
grahamplata 6a023c2
go lint merge main
grahamplata 9822704
target cloud
grahamplata de2e5ef
update release instructions in Gemini README
grahamplata 4c4098a
add line chart and context
grahamplata 7f4a49f
move release
grahamplata 52a788d
add Node.js setup and build steps for Gemini Extension in release wor…
grahamplata ca354fa
review
grahamplata File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| name: Release Gemini Extension | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: 'Tag to release (e.g., gemini-v1.0.0)' | ||
| required: true | ||
| type: string | ||
|
|
||
| env: | ||
| EXTENSION_VERSION: ${{ github.event.inputs.tag || github.ref_name }} | ||
|
|
||
| jobs: | ||
| release-gemini-extension: | ||
| name: Release Gemini Extension | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
|
|
||
| - name: Build Gemini Extension | ||
| run: | | ||
| cd integrations/gemini | ||
| npm ci | ||
| npm run build | ||
| npm run package | ||
| env: | ||
| HUSKY: 0 | ||
|
|
||
| - name: Create Gemini Extension Release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| tag_name: ${{ env.EXTENSION_VERSION }} | ||
| name: "Gemini Extension ${{ env.EXTENSION_VERSION }}" | ||
| files: integrations/gemini/release/** | ||
| body: | | ||
| ## Rill Gemini Extension Release | ||
|
|
||
| This release contains the Rill integration for Google Gemini. | ||
|
|
||
| ### Installation | ||
| ```bash | ||
| gemini extensions install https://github.com/rilldata/rill --ref=${{ env.EXTENSION_VERSION }} | ||
| ``` | ||
|
|
||
| See the [README](https://github.com/rilldata/rill/blob/main/integrations/gemini/README.md) for setup instructions. | ||
| draft: false | ||
| prerelease: false | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Notify Slack | ||
| uses: ravsamhq/notify-slack-action@v2 | ||
| if: always() | ||
| with: | ||
| status: ${{ job.status }} | ||
| notification_title: "Gemini Extension Release - ${{ env.EXTENSION_VERSION }}" | ||
| message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>" | ||
| footer: "Linked Repo <{repo_url}|{repo}>" | ||
| notify_when: "failure" | ||
| env: | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ANNOUNCE_DD }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ web-common/tests/projects | |
| web-local/tests/data | ||
|
|
||
| .env | ||
| .example.env | ||
| *.sql | ||
| *.bin | ||
| *.csv | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Rill Integration | ||
|
|
||
| ## Google Gemini Integration | ||
|
|
||
| Enhance your Rill Data experience with the Gemini integration, enabling advanced data analysis. Explore the [Gemini README](gemini/README.md) for detailed information on installation, configuration, and usage. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| ## Rill Gemini Integration | ||
|
|
||
| You are an expert data analyst with access to Rill's metrics views through specialized tools. You can autonomously explore data, generate insights, and create text-based visualizations. When users ask about their data, you should use the available Rill tools to query metrics views and provide comprehensive analysis. | ||
|
|
||
| ## Chart Generation | ||
|
|
||
| When users request data visualization, do not build web pages or React apps. Instead, create text-based visualizations using Unicode characters and formatting. Use these techniques: | ||
|
|
||
| Bar Charts using block characters: | ||
|
|
||
| Q1 ████████░░ 411 | ||
|
|
||
| Q2 ██████████ 514 | ||
|
|
||
| Q3 ██████░░░░ 300 | ||
|
|
||
| Q4 ████████░░ 400 | ||
|
|
||
| Horizontal progress bars: Project Progress: | ||
|
|
||
| Frontend ▓▓▓▓▓▓▓▓░░ 80% | ||
|
|
||
| Backend ▓▓▓▓▓▓░░░░ 60% | ||
|
|
||
| Testing ▓▓░░░░░░░░ 20% | ||
|
|
||
| Using different block densities: Trends: | ||
|
|
||
| Jan ▁▂▃▄▅▆▇█ High | ||
|
|
||
| Feb ▁▂▃▄▅░░░ Medium | ||
|
|
||
| Mar ▁▂░░░░░░ Low | ||
|
|
||
| Sparklines with Unicode Basic sparklines: | ||
|
|
||
| Stock prices: ▁▂▃▅▂▇▆▃▅▇ | ||
|
|
||
| Website traffic: ▁▁▂▃▅▄▆▇▆▅▄▂▁ | ||
|
|
||
| CPU usage: ▂▄▆█▇▅▃▂▄▆█▇▄▂ | ||
|
|
||
| Trend indicators: | ||
|
|
||
| AAPL ▲ +2.3% | ||
|
|
||
| GOOG ▼ -1.2% | ||
|
|
||
| MSFT ► +0.5% | ||
|
|
||
| TSLA ▼ -3.1% | ||
|
|
||
| Simple trend arrows: Sales ↗️ (+15%) Costs ↘️ (-8%) Profit ⤴️ (+28%) | ||
|
|
||
| Pivot tables using text formatting: | ||
|
|
||
| | Region | Q1 Sales | Q2 Sales | Q3 Sales | Q4 Sales | | ||
| | ------ | -------- | -------- | -------- | -------- | | ||
| | North | $120,000 | $130,000 | $125,000 | $140,000 | | ||
| | South | $100,000 | $110,000 | $115,000 | $120,000 | | ||
| | East | $90,000 | $95,000 | $100,000 | $105,000 | | ||
| | West | $110,000 | $115,000 | $120,000 | $130,000 | | ||
|
|
||
| Line Charts characters: | ||
|
|
||
| ``` | ||
| Value | ||
| ^ | ||
| | /--------------- (Value) | ||
| | / | ||
| 3 | / | ||
| | / | ||
| 2 | / | ||
| | / | ||
| 1 | / | ||
| | / | ||
| 0 |______/ | ||
| +---+---+---+---+---+---+---+---+---+---+---> Timeseries | ||
| 0 1 2 3 4 5 6 7 8 9 10 | ||
| ``` | ||
|
|
||
| ## Analysis Guidelines | ||
|
|
||
| ### When Users Encounter Issues | ||
|
|
||
| - **Access denied errors**: Inform users to ensure their Rill access token has appropriate permissions | ||
| - **No data found**: Guide users to verify their project contains metrics views with available data | ||
| - **Incomplete analysis**: Ask users for more specific context about which metrics to focus on | ||
|
|
||
| ### Your Analysis Process | ||
|
|
||
| - **Be thorough**: Use available Rill tools to explore data comprehensively | ||
| - **Provide context**: Always explain what the data shows and why it matters | ||
| - **Cite your sources**: Reference specific metrics views and time ranges used | ||
| - **Offer insights**: Go beyond raw numbers to identify trends, patterns, and actionable findings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Gemini CLI Extension for Rill Data | ||
|
|
||
| Professional data analysis and report generation using Rill's metrics layer. | ||
|
|
||
| ## Overview | ||
|
|
||
| Check out [Rill's Docs](https://docs.rilldata.com) for more information about Rill. | ||
|
|
||
| ## Installation | ||
|
|
||
| Install the extension via GitHub using a specific release tag: | ||
|
|
||
| ```bash | ||
| gemini extensions install https://github.com/rilldata/rill --ref=gemini-v1.0.0 | ||
| ``` | ||
|
|
||
| > **Note**: Since this is a monorepo, you must specify a Gemini-specific release tag (prefixed with `gemini-v`) to ensure Gemini CLI picks up the correct extension files. See [Releases](https://github.com/rilldata/rill/releases) for available versions. | ||
|
|
||
| For the latest version, check the [releases page](https://github.com/rilldata/rill/releases) and use the most recent `gemini-v*` tag. | ||
|
|
||
| Install Rill CLI if you haven't already: | ||
|
|
||
| ```bash | ||
| curl https://rill.sh | sh | ||
| ``` | ||
|
|
||
| ## Configuration | ||
|
|
||
| After installation, configure the extension with your Rill credentials. The extension will prompt you for the following information during setup: | ||
|
|
||
| - **Organization**: Your Rill organization name | ||
| - **Project**: Your Rill project name | ||
| - **Access Token**: Your Rill access token | ||
|
|
||
| To generate a Rill authentication token, run: | ||
|
|
||
| ```bash | ||
| rill token issue --display-name "Gemini Extension" | ||
| ``` | ||
|
|
||
| > **Tip**: You can find your organization and project names in the Rill Cloud UI URL: `https://ui.rilldata.com/{organization}/{project}` | ||
|
|
||
| The extension configuration is handled automatically through Gemini's settings interface - no manual environment file setup is required. | ||
|
|
||
| ## Development | ||
|
|
||
| ### Local Development | ||
|
|
||
| To test changes locally: | ||
|
|
||
| 1. Make your changes to the extension files | ||
| 2. Install the extension from your local development branch: | ||
| ```bash | ||
| npm run -w integrations/gemini link | ||
| ``` | ||
| 3. Test the extension in Gemini: | ||
| ```bash | ||
| npm run -w integrations/gemini unlink | ||
| ``` | ||
|
|
||
| ### Releasing | ||
|
|
||
| This extension is distributed through [GitHub Releases](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| { | ||
| "name": "rill", | ||
| "description": "Professional data analysis using Rill's metrics layer", | ||
| "version": "0.1.0", | ||
| "displayName": "Rill Analytics", | ||
| "contextFileName": "GEMINI.md", | ||
| "mcpServers": { | ||
| "rill": { | ||
| "httpUrl": "https://api.rilldata.com/v1/orgs/${RILL_ORG}/projects/${RILL_PROJECT}/runtime/mcp", | ||
| "headers": { | ||
| "Authorization": "Bearer ${RILL_ACCESS_TOKEN}", | ||
| "Content-Type": "application/json" | ||
| }, | ||
| "env": { | ||
| "RILL_ORG": "${RILL_ORG}", | ||
| "RILL_PROJECT": "${RILL_PROJECT}", | ||
| "RILL_ACCESS_TOKEN": "${RILL_ACCESS_TOKEN}" | ||
| } | ||
| } | ||
| }, | ||
| "settings": [ | ||
| { | ||
| "name": "Organization", | ||
| "description": "Your Rill organization name", | ||
| "envVar": "RILL_ORG" | ||
| }, | ||
| { | ||
| "name": "Project", | ||
| "description": "Your Rill project name", | ||
| "envVar": "RILL_PROJECT" | ||
| }, | ||
| { | ||
| "name": "Access Token", | ||
| "description": "Your Rill access token", | ||
| "envVar": "RILL_ACCESS_TOKEN", | ||
| "sensitive": true | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "name": "rill", | ||
| "version": "0.1.0", | ||
| "description": "Data analysis using Rill's metrics layer", | ||
| "license": "Apache-2.0", | ||
| "type": "module", | ||
| "author": { | ||
| "name": "Rill Data", | ||
| "email": "[email protected]", | ||
| "url": "https://rilldata.com" | ||
| }, | ||
| "scripts": { | ||
| "build": "echo 'No build required'", | ||
| "link": "gemini extensions link .", | ||
| "unlink": "gemini extensions uninstall rill", | ||
| "format": "prettier --write \"**/*.{ts,js,json,md}\"" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/rilldata/rill", | ||
| "directory": "integrations/gemini" | ||
| } | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of this language seems to be addressed to the end user (e.g. "By connecting to your Rill projects, the Gemini agent can..."), not the Gemini agent. I'd expect that the document would be exclusively addressed to the Gemini agent.