You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set the following environment variables before starting the Gemini CLI:
37
39
@@ -42,6 +44,19 @@ Set the following environment variables before starting the Gemini CLI:
42
44
43
45
Ensure [Application Default Credentials](https://cloud.google.com/docs/authentication/gcloud) are available in your environment.
44
46
47
+
### Start Gemini CLI
48
+
49
+
To start the Gemini CLI, use the following command:
50
+
51
+
```bash
52
+
gemini
53
+
```
54
+
55
+
> [!WARNING]
56
+
> **Changing Instance & Database Connections**
57
+
> Currently, the database connection must be configured before starting the Gemini CLI and can not be changed during a session.
58
+
> To save and resume conversation history use command: `/chat save <tag>` and `/chat resume <tag>`.
59
+
45
60
## Usage
46
61
47
62
***Explore Schemas and Data:**
@@ -64,4 +79,6 @@ Find additional extensions to support your entire software development lifecycle
64
79
65
80
## Troubleshooting
66
81
67
-
* "cannot execute binary file": Ensure the correct binary for your OS/Architecture has been downloaded. See [Installing the server](https://googleapis.github.io/genai-toolbox/getting-started/introduction/#installing-the-server) for more information.
82
+
* "✖ 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.
83
+
* "✖ MCP ERROR: Error: spawn /Users/<USER>/.gemini/extensions/spanner/toolbox ENOENT": The Toolbox binary did not download correctly. Ensure you are using Gemini CLI v0.6.0+.
84
+
* "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](https://googleapis.github.io/genai-toolbox/getting-started/introduction/#installing-the-server) for more information.
Copy file name to clipboardExpand all lines: SPANNER.md
+32-1Lines changed: 32 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,11 @@ software delivery cycle.
4
4
5
5
--
6
6
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`.
7
12
8
13
## Spanner MCP Server (Data Plane: Connecting and Querying)
9
14
@@ -14,11 +19,37 @@ This section covers connecting to a Spanner instance.
14
19
*`SPANNER_PROJECT`: The GCP project ID.
15
20
*`SPANNER_INSTANCE`: The Spanner instance ID.
16
21
*`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"
18
23
19
24
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.
20
25
21
26
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**
22
27
(`roles/spanner.databaseUser`) or **Cloud Spanner Database Reader** (`roles/spanner.databaseReader`). You can provide these links for assistance:
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