diff --git a/SPANNER.md b/SPANNER.md index cac4f16..ca5eac0 100644 --- a/SPANNER.md +++ b/SPANNER.md @@ -4,6 +4,11 @@ software delivery cycle. -- +# Setup + +## Required Gemini CLI Version + +To install this extension, the Gemini CLI version must be v0.6.0 or above. The version can be found by running: `gemini --version`. ## Spanner MCP Server (Data Plane: Connecting and Querying) @@ -14,7 +19,7 @@ This section covers connecting to a Spanner instance. * `SPANNER_PROJECT`: The GCP project ID. * `SPANNER_INSTANCE`: The Spanner instance ID. * `SPANNER_DATABASE`: The Spanner database ID. - * `SPANNER_DIALECT`: The Spanner database dialect e.g. "googlesql" or "postgresql" + * `SPANNER_DIALECT`: The Spanner database dialect e.g. "googlesql" or "postgresql" 2. **Handle Missing Variables**: If a command fails with an error message containing a placeholder like `${SPANNER_PROJECT}`, it signifies a missing environment variable. Inform the user which variable is missing and instruct them to set it. @@ -22,3 +27,29 @@ This section covers connecting to a Spanner instance. (`roles/spanner.databaseUser`) or **Cloud Spanner Database Reader** (`roles/spanner.databaseReader`). You can provide these links for assistance: * Granting Roles: https://cloud.google.com/iam/docs/grant-role-console * Spanner Permissions: https://cloud.google.com/iam/docs/roles-permissions/spanner + +--- + +# Usage Guidelines + +## Connecting to New Resources + +You will need to perform the following steps to change the current database connection: + +1. **(Optional) Save your conversation:** To avoid losing your progress, save the current session by running the command: `/chat save ` +2. **Stop the CLI:** Terminate the Gemini CLI. +3. **Update Environment Variables:** Set or update your environment variables (e.g. `SPANNER_INSTANCE`, `SPANNER_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 ` + +## Reusing Project Values + +Users may have set project environment variables: + +* `SPANNER_PROJECT`: The GCP project ID. +* `SPANNER_INSTANCE`: The Spanner instance ID. +* `SPANNER_DATABASE`: The Spanner database ID. +* `SPANNER_DIALECT`: The Spanner database dialect e.g. "googlesql" or "postgresql" + +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 `SPANNER_PROJECT`, `${SPANNER_PROJECT}`, or `$SPANNER_PROJECT`. The value can be found by using command: `echo $SPANNER_PROJECT`. \ No newline at end of file