Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,27 @@ gemini extensions install https://github.com/gemini-cli-extensions/sql-server

### 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.

* `MSSQL_HOST`: (Optional) The SQL Server host. Defaults to `localhost`.
* `MSSQL_PORT`: (Optional) The SQL Server port. Defaults to `1433`.
* `MSSQL_DATABASE`: The name of the database to connect to.
* `MSSQL_USER`: The database username.
* `MSSQL_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 sql-server [setting name] [--scope <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:

#### PowerShell
```powershell
Expand All @@ -61,6 +81,9 @@ export MSSQL_USER="<your-database-user>"
export MSSQL_PASSWORD="<your-database-password>"
```

> [!NOTE]
> See [Troubleshooting](#troubleshooting) for debugging your configuration.

### Start Gemini CLI

To start the Gemini CLI, use the following command:
Expand Down Expand Up @@ -102,7 +125,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/sql-server/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.
Loading