From 9ab416214c5a33465bf337109e8ed324b4e8f111 Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Wed, 28 Jan 2026 16:18:45 -0800 Subject: [PATCH] docs: add configuration instructions --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c31fa83..e355246 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,27 @@ gemini extensions install https://github.com/gemini-cli-extensions/postgres ### 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. + +* `POSTGRES_HOST`: (Optional) The Postgres host. Defaults to `localhost`. +* `POSTGRES_PORT`: (Optional) The Postgres port. Defaults to `5432`. +* `POSTGRES_DATABASE`: The name of the database to connect to. +* `POSTGRES_USER`: The database username. +* `POSTGRES_PASSWORD`: The password for the database user. + +To view or update your configuration: + +**List Settings:** +* Terminal: `gemini extensions list` +* Gemini CLI: `/extensions list` + +**Update Settings:** +* Terminal: `gemini extensions config postgres [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 POSTGRES_HOST="" # Optional: defaults to localhost @@ -51,6 +71,9 @@ export POSTGRES_USER="" export POSTGRES_PASSWORD="" ``` +> [!NOTE] +> See [Troubleshooting](#troubleshooting) for debugging your configuration. + ### Start Gemini CLI To start the Gemini CLI, use the following command: @@ -113,7 +136,6 @@ Use `gemini --debug` to enable debugging. Common issues: -* "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. * "✖ 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. * "✖ 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+. * "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.