Skip to content

Commit a1dbc8c

Browse files
authored
feat: add dialect and configuration instructions (#79)
1 parent 89572ca commit a1dbc8c

2 files changed

Lines changed: 30 additions & 4 deletions

File tree

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,26 @@ gemini extensions install https://github.com/gemini-cli-extensions/spanner
4444

4545
### Configuration
4646

47-
Set the following environment variables before starting the Gemini CLI. These variables can be loaded from a `.env` file.
47+
You will be prompted to configure the following settings during installation. These settings are saved in an `.env` file within the extension's directory.
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`: (Optional) The SQL dialect of the Spanner database: 'googlesql' or 'postgresql'. Defaults to "googlesql".
53+
54+
To view or update your configuration:
55+
56+
**List Settings:**
57+
* Terminal: `gemini extensions list`
58+
* Gemini CLI: `/extensions list`
59+
60+
**Update Settings:**
61+
* Terminal: `gemini extensions config spanner [setting name] [--scope <scope>]`
62+
* `setting name`: (Optional) The single setting to configure.
63+
* `scope`: (Optional) The scope of the setting in (`user` or `workspace`). Defaults to `user`.
64+
* Currently, you must restart the Gemini CLI for changes to take effect. We recommend using `gemini --resume` to resume your session.
65+
66+
Alternatively, you can manually set these environment variables before starting the Gemini CLI:
4867

4968
```bash
5069
export SPANNER_PROJECT="<your-gcp-project-id>"
@@ -53,7 +72,9 @@ export SPANNER_DATABASE="<your-spanner-database-id>"
5372
export SPANNER_DIALECT="googlesql" # Optional: "googlesql" or "postgresql". Defaults to "googlesql".
5473
```
5574

56-
Ensure [Application Default Credentials](https://cloud.google.com/docs/authentication/gcloud) are available in your environment.
75+
> [!NOTE]
76+
> * Ensure [Application Default Credentials](https://cloud.google.com/docs/authentication/gcloud) are available in your environment.
77+
> * See [Troubleshooting](#troubleshooting) for debugging your configuration.
5778
5879
### Start Gemini CLI
5980

gemini-extension.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,19 @@
2020
"envVar": "SPANNER_PROJECT"
2121
},
2222
{
23-
"name": "Instance ID",
23+
"name": "Instance",
2424
"description": "ID of the Spanner instance",
2525
"envVar": "SPANNER_INSTANCE"
2626
},
2727
{
28-
"name": "Database ID",
28+
"name": "Database",
2929
"description": "ID of the Spanner database",
3030
"envVar": "SPANNER_DATABASE"
31+
},
32+
{
33+
"name": "Database Dialect",
34+
"description": "(Optional) The SQL dialect of the Spanner Database: 'googlesql' or 'postgresql'. (Default: 'googlesql')",
35+
"envVar": "SPANNER_DIALECT"
3136
}
3237
]
3338
}

0 commit comments

Comments
 (0)