Skip to content

Commit cb73b4a

Browse files
authored
docs: add configuration instructions (#90)
1 parent 47dc33f commit cb73b4a

1 file changed

Lines changed: 29 additions & 5 deletions

File tree

README.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,32 @@ gemini extensions install https://github.com/gemini-cli-extensions/cloud-sql-pos
4747

4848
### Configuration
4949

50-
Set the following environment variables before starting the Gemini CLI. These variables can be loaded from a `.env` file.
51-
This configuration is not required if utilizing the [Admin toolset](#supported-tools).
50+
You will be prompted to configure the following settings during installation. These settings are saved in an `.env` file within the extension's directory.
51+
52+
* `CLOUD_SQL_POSTGRES_PROJECT`: The GCP project ID.
53+
* `CLOUD_SQL_POSTGRES_REGION`: The region of your Cloud SQL instance.
54+
* `CLOUD_SQL_POSTGRES_INSTANCE`: The ID of your Cloud SQL instance.
55+
* `CLOUD_SQL_POSTGRES_DATABASE`: The name of the database to connect to.
56+
* `CLOUD_SQL_POSTGRES_USER`: (Optional) The database username. Defaults to the active IAM user.
57+
* `CLOUD_SQL_POSTGRES_PASSWORD`: (Optional) The password for the database user.
58+
* `CLOUD_SQL_POSTGRES_IP_TYPE`: (Optional) Type of the IP address: `PUBLIC`, `PRIVATE`, or `PSC`. Defaults to `PUBLIC`.
59+
60+
> [!NOTE]
61+
> This configuration is primarily for the Data Plane tools (querying). The Admin toolset does not strictly require these to be pre-set if you provide them in your prompts, but it is recommended for a smoother experience.
62+
63+
To view or update your configuration:
64+
65+
**List Settings:**
66+
* Terminal: `gemini extensions list`
67+
* Gemini CLI: `/extensions list`
68+
69+
**Update Settings:**
70+
* Terminal: `gemini extensions config cloud-sql-postgresql [setting name] [--scope <scope>]`
71+
* `setting name`: (Optional) The single setting to configure.
72+
* `scope`: (Optional) The scope of the setting in (`user` or `workspace`). Defaults to `user`.
73+
* Currently, you must restart the Gemini CLI for changes to take effect. We recommend using `gemini --resume` to resume your session.
74+
75+
Alternatively, you can manually set these environment variables before starting the Gemini CLI:
5276

5377
```bash
5478
export CLOUD_SQL_POSTGRES_PROJECT="<your-gcp-project-id>"
@@ -60,10 +84,10 @@ export CLOUD_SQL_POSTGRES_PASSWORD="<your-database-password>" # Optional
6084
export CLOUD_SQL_POSTGRES_IP_TYPE="PUBLIC" # Optional: `PUBLIC`, `PRIVATE`, `PSC`. Defaults to `PUBLIC`.
6185
```
6286

63-
Ensure [Application Default Credentials](https://cloud.google.com/docs/authentication/gcloud) are available in your environment.
64-
6587
> [!NOTE]
66-
> If your Cloud SQL for PostgreSQL instance uses private IPs, you must run Gemini CLI in the same Virtual Private Cloud (VPC) network.
88+
> * Ensure [Application Default Credentials](https://cloud.google.com/docs/authentication/gcloud) are available in your environment.
89+
> * If your Cloud SQL for PostgreSQL instance uses private IPs, you must run Gemini CLI in the same Virtual Private Cloud (VPC) network.
90+
> * See [Troubleshooting](#troubleshooting) for debugging your configuration.
6791
6892
### Start Gemini CLI
6993

0 commit comments

Comments
 (0)