Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/package-and-upload-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
echo "ARCHIVE_PATH=${ARCHIVE_NAME}" >> $GITHUB_OUTPUT

- name: Upload archive as workflow artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ steps.vars.outputs.archive_name }}
path: ${{ steps.create_archive.outputs.ARCHIVE_PATH }}
Expand Down
75 changes: 18 additions & 57 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
@@ -1,107 +1,72 @@
# DEVELOPER.md

This document provides instructions for setting up your development environment
and contributing to the Dataplex Gemini CLI Extension project.
This document provides instructions for setting up your development environment and contributing to the Firestore Native Gemini CLI Extension project.

## Prerequisites

Before you begin, ensure you have the following:

1. **Gemini CLI:** Install the Gemini CLI version v0.6.0 or above. Installation
instructions can be found on the official Gemini CLI documentation. You can
verify your version by running `gemini --version`.
2. **Firestore database:** For testing data plane tools, you will need access to an active Firestore database.
1. **Gemini CLI:** Install the Gemini CLI version v0.6.0 or above. Installation instructions can be found on the [official Gemini CLI documentation](https://google-gemini.github.io/gemini-cli/). You can verify your version by running `gemini --version`.
2. **Firestore database:** For testing skills, you will need access to an active Firestore database.

## Developing the Extension

### Running from Local Source

The core logic for this extension is handled by a pre-built `toolbox` binary. The development process involves installing the extension locally into the Gemini CLI to test changes.
This extension uses **Agent Skills** to interact with Firestore. The development process involves generating these skills locally and linking the extension to the Gemini CLI.

1. **Clone the Repository:**

```bash
git clone https://github.com/gemini-cli-extensions/firestore-native.git
cd firestore-native
```

2. **Download the Toolbox Binary:** The required version of the `toolbox` binary
is specified in `toolbox_version.txt`. Download it for your platform.

```bash
# Read the required version
VERSION=$(cat toolbox_version.txt)

# Example for macOS/amd64
curl -L -o toolbox https://storage.googleapis.com/mcp-toolbox-for-databases/geminicli/v$VERSION/darwin/amd64/toolbox
chmod +x toolbox
```
Adjust the URL for your operating system (`linux/amd64`, `darwin/arm64`, `windows/amd64`).

3. **Link the Extension Locally:** Use the Gemini CLI to install the
2. **Install the Extension Locally:** Use the Gemini CLI to install the
extension from your local directory.

```bash
gemini extensions link .
gemini extensions install .
```
The CLI will prompt you to confirm the linking. Accept it to proceed.
The CLI will prompt you to confirm the installation. Accept it to proceed.

4. **Testing Changes:** After linking, start the Gemini CLI (`gemini`).
You can now interact with the `firestore-native` tools to manually test your changes
3. **Testing Changes:** After installation, start the Gemini CLI (`gemini`).
You can now interact with the `firestore-native` skills to manually test your changes
against your connected database.

## Testing

### Automated Presubmit Checks
### Automated Skills Validation

A GitHub Actions workflow (`.github/workflows/presubmit-tests.yml`) is triggered
for every pull request. This workflow primarily verifies that the extension can
be successfully installed by the Gemini CLI.

Currently, there are no automated unit or integration test suites
within this repository. All functional testing must be performed manually. All tools
are currently tested in the [MCP Toolbox GitHub](https://github.com/googleapis/genai-toolbox).

### Other GitHub Checks
All tools are currently tested in the [MCP Toolbox GitHub](https://github.com/googleapis/mcp-toolbox).

* **License Header Check:** A workflow ensures all necessary files contain the
proper license header.
* **Conventional Commits:** This repository uses
[Release Please](https://github.com/googleapis/release-please) to manage
releases. Your commit messages must adhere to the
[Conventional Commits](https://www.conventionalcommits.org/) specification.
* **Dependency Updates:** [Renovate](https://github.com/apps/forking-renovate)
is configured to automatically create pull requests for dependency updates.
The skills themselves are validated using the `skills-validate.yml` workflow.

## Building the Extension

The "build" process for this extension involves packaging the extension's
metadata files (`gemini-extension.json`, `firestore-native.md`, `LICENSE`) along with the
pre-built `toolbox` binary into platform-specific archives (`.tar.gz` or `.zip`).
### Other GitHub Checks

This process is handled automatically by the
[`package-and-upload-assets.yml`](.github/workflows/package-and-upload-assets.yml)
GitHub Actions workflow when a new release is created. Manual building is not
required.
* **License Header Check:** A workflow ensures all necessary files contain the proper license header.
* **Conventional Commits:** This repository uses [Release Please](https://github.com/googleapis/release-please) to manage releases. Your commit messages must adhere to the [Conventional Commits](https://www.conventionalcommits.org/) specification.

## Maintainer Information

### Team

The primary maintainers for this repository are defined in the
[`.github/CODEOWNERS`](.github/CODEOWNERS) file:
The primary maintainers for this repository are defined in the [`.github/CODEOWNERS`](.github/CODEOWNERS) file:

* `@gemini-cli-extensions/senseai-eco`
* `@gemini-cli-extensions/firestore-native-maintainers`

### Releasing

The release process is automated using `release-please`. It consists of an automated changelog preparation step followed by the manual merging of a Release PR.
The release process is automated using `release-please`. It consists of an automated changelog preparation step followed by the manual merging of a Release PR. When the Release PR is merged, `release-please` creates a new GitHub tag and a corresponding GitHub Release.

#### Automated Changelog Enrichment

Before a Release PR is even created, a special workflow automatically mirrors
relevant changelogs from the core `googleapis/genai-toolbox` dependency. This
relevant changelogs from the core `googleapis/mcp-toolbox` dependency. This
ensures that the release notes for this extension accurately reflect important
upstream changes.

Expand Down Expand Up @@ -138,7 +103,3 @@ The process is handled by the [`mirror-changelog.yml`](.github/workflows/mirror-
2. **Merge Release PR:** A maintainer approves and merges the Release PR. This
action triggers `release-please` to create a new GitHub tag and a
corresponding GitHub Release.
3. **Package and Upload:** The new release triggers the
`package-and-upload-assets.yml` workflow. This workflow builds the
platform-specific extension archives and uploads them as assets to the
GitHub Release.
34 changes: 18 additions & 16 deletions FIRESTORE-NATIVE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
You are a highly skilled database engineer and database administrator. Your purpose is to
help the developer build and interact with databases and utilize data context throughout the entire
software delivery cycle.
You are a highly skilled database engineer and database administrator. Your purpose is to help the developer build and interact with databases and utilize data context throughout the entire software delivery cycle.

---

Expand All @@ -14,38 +12,42 @@ To install this extension, the Gemini CLI version must be v0.6.0 or above. The v

This section covers connecting to a Firestore instance.

1. **Verify Environment Variables**: Before attempting to connect, confirm with the user that the following environment variables are set in the extension configuration or their shell environment.
1. **Extension Configuration**: This extension requires settings (e.g., Project ID and Database ID). These values are gathered via prompts when you first install or link the extension:

* `FIRESTORE_PROJECT`: The GCP project ID.
* `FIRESTORE_DATABASE`: The Firestore database ID.
* `FIRESTORE_PROJECT`: The GCP project ID.
* `FIRESTORE_DATABASE`: The Firestore database ID.

2. **Handle Missing Variables**: If a command fails with an error message containing a placeholder like `${FIRESTORE_PROJECT}`, it signifies a missing environment variable. Inform the user which variable is missing and instruct them to set it.
If you need to update any of these values later, use the `gemini extensions config firestore-native` command.

3. **Handle Permission Errors**: If you encounter permission errors, ensure the user has the correct Firestore permissions (e.g., `datastore.entities.list`, `datastore.entities.create`). The user likely lacks the roles Cloud Datastore User (`roles/datastore.user`) and Firebase Rules Viewer (`roles/firebaserules.viewer`). You can provide these links for assistance:
* Granting Roles: https://cloud.google.com/iam/docs/grant-role-console
* Firestore Permissions: https://cloud.google.com/iam/docs/roles-permissions/firestore
2. **Handle Missing Variables**: If a command fails with an error message containing a placeholder like `${FIRESTORE_PROJECT}`, it signifies a missing environment variable. Inform the user which variable is missing and instruct them to set it.

3. **Handle Permission Errors**: If you encounter permission errors, ensure the user has the correct Firestore permissions (e.g., `datastore.entities.list`, `datastore.entities.create`). The user likely lacks the roles Cloud Datastore User (`roles/datastore.user`) and Firebase Rules Viewer (`roles/firebaserules.viewer`). You can provide these links for assistance:
* Granting Roles: https://cloud.google.com/iam/docs/grant-role-console
* Firestore Permissions: https://cloud.google.com/iam/docs/roles-permissions/firestore

---

# Usage Guidelines

## Connecting to New Resources

You will need to perform the following steps to change the current database connection:
When you want to change the current database connection, you will need to perform the following steps:

1. **(Optional) Save your conversation:** To avoid losing your progress, save the current session by running the command: `/chat save <your-tag>`
2. **Stop the CLI:** Terminate the Gemini CLI.
3. **Update Environment Variables:** Set or update your environment variables (e.g. `FIRESTORE_DATABASE`) to point to the new resource.
4. **Restart:** Relaunch the Gemini CLI
2. **Stop the CLI**: Terminate the Gemini CLI.
3. **Update Extension Configuration**: Use the command `gemini extensions config firestore-native` to update your settings (e.g. `FIRESTORE_DATABASE`) to point to the new resource.
4. **Restart**: Relaunch the Gemini CLI
5. **(Optional) Resume conversation:** Resume your conversation with the command: `/chat resume <your-tag>`

**Important:** Do not assume a connection to a newly created resource is active. Always follow the steps above to reconfigure your connection.

## Reusing Project Values

Users may have set project environment variables:

* `FIRESTORE_PROJECT`: The GCP project ID.
* `FIRESTORE_DATABASE`: The Firestore database ID.

Instead of prompting the user for these values for specific tool calls, prompt the user to verify reuse a specific value.
Make sure to not use the environment variable name like `FIRESTORE_PROJECT`, `${FIRESTORE_PROJECT}`, or `$FIRESTORE_PROJECT`. The value can be found by using command: `echo $FIRESTORE_PROJECT`.
Instead of prompting the user for these values for specific skill calls, prompt the user to verify the reuse of a specific setting value.
Make sure to not use the environment variable name like `FIRESTORE_PROJECT`, `${FIRESTORE_PROJECT}`, or `$FIRESTORE_PROJECT`.
The value can be verified by the user using the `gemini extensions config firestore-native` command or by checking their local settings.
Loading
Loading