Skip to content

Commit 8a7e5a7

Browse files
averikitschYuan325
andauthored
feat: additional instructions for the context file (#32)
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
1 parent 34fd718 commit 8a7e5a7

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

SPANNER.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ software delivery cycle.
44

55
--
66

7+
# Setup
8+
9+
## Required Gemini CLI Version
10+
11+
To install this extension, the Gemini CLI version must be v0.6.0 or above. The version can be found by running: `gemini --version`.
712

813
## Spanner MCP Server (Data Plane: Connecting and Querying)
914

@@ -14,11 +19,37 @@ This section covers connecting to a Spanner instance.
1419
* `SPANNER_PROJECT`: The GCP project ID.
1520
* `SPANNER_INSTANCE`: The Spanner instance ID.
1621
* `SPANNER_DATABASE`: The Spanner database ID.
17-
* `SPANNER_DIALECT`: The Spanner database dialect e.g. "googlesql" or "postgresql"
22+
* `SPANNER_DIALECT`: The Spanner database dialect e.g. "googlesql" or "postgresql"
1823

1924
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.
2025

2126
3. **Handle Permission Errors**: If you encounter permission errors, ensure the user has the correct Spanner permissions (e.g., `spanner.databases.get`, `spanner.databases.select`). The user likely lacks the role **Cloud Spanner Database User**
2227
(`roles/spanner.databaseUser`) or **Cloud Spanner Database Reader** (`roles/spanner.databaseReader`). You can provide these links for assistance:
2328
* Granting Roles: https://cloud.google.com/iam/docs/grant-role-console
2429
* Spanner Permissions: https://cloud.google.com/iam/docs/roles-permissions/spanner
30+
31+
---
32+
33+
# Usage Guidelines
34+
35+
## Connecting to New Resources
36+
37+
You will need to perform the following steps to change the current database connection:
38+
39+
1. **(Optional) Save your conversation:** To avoid losing your progress, save the current session by running the command: `/chat save <your-tag>`
40+
2. **Stop the CLI:** Terminate the Gemini CLI.
41+
3. **Update Environment Variables:** Set or update your environment variables (e.g. `SPANNER_INSTANCE`, `SPANNER_DATABASE`) to point to the new resource.
42+
4. **Restart:** Relaunch the Gemini CLI
43+
5. **(Optional) Resume conversation:** Resume your conversation with the command: `/chat resume <your-tag>`
44+
45+
## Reusing Project Values
46+
47+
Users may have set project environment variables:
48+
49+
* `SPANNER_PROJECT`: The GCP project ID.
50+
* `SPANNER_INSTANCE`: The Spanner instance ID.
51+
* `SPANNER_DATABASE`: The Spanner database ID.
52+
* `SPANNER_DIALECT`: The Spanner database dialect e.g. "googlesql" or "postgresql"
53+
54+
Instead of prompting the user for these values for specific tool calls, prompt the user to verify reuse a specific value.
55+
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`.

0 commit comments

Comments
 (0)