diff --git a/README.md b/README.md index cf9f35d..d85c1d9 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,26 @@ gemini extensions install https://github.com/gemini-cli-extensions/spanner ### Configuration -Set the following environment variables before starting the Gemini CLI. These variables can be loaded from a `.env` file. +You will be prompted to configure the following settings during installation. These settings are saved in an `.env` file within the extension's directory. + +* `SPANNER_PROJECT`: The GCP project ID. +* `SPANNER_INSTANCE`: The Spanner instance ID. +* `SPANNER_DATABASE`: The Spanner database ID. +* `SPANNER_DIALECT`: (Optional) The SQL dialect of the Spanner database: 'googlesql' or 'postgresql'. Defaults to "googlesql". + +To view or update your configuration: + +**List Settings:** +* Terminal: `gemini extensions list` +* Gemini CLI: `/extensions list` + +**Update Settings:** +* Terminal: `gemini extensions config spanner [setting name] [--scope ]` + * `setting name`: (Optional) The single setting to configure. + * `scope`: (Optional) The scope of the setting in (`user` or `workspace`). Defaults to `user`. +* Currently, you must restart the Gemini CLI for changes to take effect. We recommend using `gemini --resume` to resume your session. + +Alternatively, you can manually set these environment variables before starting the Gemini CLI: ```bash export SPANNER_PROJECT="" @@ -53,7 +72,9 @@ export SPANNER_DATABASE="" export SPANNER_DIALECT="googlesql" # Optional: "googlesql" or "postgresql". Defaults to "googlesql". ``` -Ensure [Application Default Credentials](https://cloud.google.com/docs/authentication/gcloud) are available in your environment. +> [!NOTE] +> * Ensure [Application Default Credentials](https://cloud.google.com/docs/authentication/gcloud) are available in your environment. +> * See [Troubleshooting](#troubleshooting) for debugging your configuration. ### Start Gemini CLI diff --git a/gemini-extension.json b/gemini-extension.json index 7297140..6353a2b 100644 --- a/gemini-extension.json +++ b/gemini-extension.json @@ -20,14 +20,19 @@ "envVar": "SPANNER_PROJECT" }, { - "name": "Instance ID", + "name": "Instance", "description": "ID of the Spanner instance", "envVar": "SPANNER_INSTANCE" }, { - "name": "Database ID", + "name": "Database", "description": "ID of the Spanner database", "envVar": "SPANNER_DATABASE" + }, + { + "name": "Database Dialect", + "description": "(Optional) The SQL dialect of the Spanner Database: 'googlesql' or 'postgresql'. (Default: 'googlesql')", + "envVar": "SPANNER_DIALECT" } ] }