Skip to content

Commit d7aff85

Browse files
authored
docs: add configuration instructions (#80)
1 parent 2df656a commit d7aff85

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,27 @@ gemini extensions install https://github.com/gemini-cli-extensions/postgres
4141

4242
### Configuration
4343

44-
Set the following environment variables before starting the Gemini CLI. These variables can be loaded from a `.env` file.
44+
You will be prompted to configure the following settings during installation. These settings are saved in an `.env` file within the extension's directory.
45+
46+
* `POSTGRES_HOST`: (Optional) The Postgres host. Defaults to `localhost`.
47+
* `POSTGRES_PORT`: (Optional) The Postgres port. Defaults to `5432`.
48+
* `POSTGRES_DATABASE`: The name of the database to connect to.
49+
* `POSTGRES_USER`: The database username.
50+
* `POSTGRES_PASSWORD`: The password for the database user.
51+
52+
To view or update your configuration:
53+
54+
**List Settings:**
55+
* Terminal: `gemini extensions list`
56+
* Gemini CLI: `/extensions list`
57+
58+
**Update Settings:**
59+
* Terminal: `gemini extensions config postgres [setting name] [--scope <scope>]`
60+
* `setting name`: (Optional) The single setting to configure.
61+
* `scope`: (Optional) The scope of the setting in (`user` or `workspace`). Defaults to `user`.
62+
* Currently, you must restart the Gemini CLI for changes to take effect. We recommend using `gemini --resume` to resume your session.
63+
64+
Alternatively, you can manually set these environment variables before starting the Gemini CLI:
4565

4666
```bash
4767
export POSTGRES_HOST="<your-postgres-host>" # Optional: defaults to localhost
@@ -51,6 +71,9 @@ export POSTGRES_USER="<your-database-user>"
5171
export POSTGRES_PASSWORD="<your-database-password>"
5272
```
5373

74+
> [!NOTE]
75+
> See [Troubleshooting](#troubleshooting) for debugging your configuration.
76+
5477
### Start Gemini CLI
5578

5679
To start the Gemini CLI, use the following command:
@@ -113,7 +136,6 @@ Use `gemini --debug` to enable debugging.
113136

114137
Common issues:
115138

116-
* "failed to find default credentials: google: could not find default credentials.": Ensure [Application Default Credentials](https://cloud.google.com/docs/authentication/gcloud) are available in your environment. See [Set up Application Default Credentials](https://cloud.google.com/docs/authentication/external/set-up-adc) for more information.
117139
* "✖ 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.
118140
* "✖ MCP ERROR: Error: spawn /Users/USER/.gemini/extensions/postgres/toolbox ENOENT": The Toolbox binary did not download correctly. Ensure you are using Gemini CLI v0.6.0+.
119141
* "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.

0 commit comments

Comments
 (0)