Skip to content

Commit 782e50b

Browse files
averikitschYuan325
andauthored
feat: additional instructions for the context file (#33)
* docs: update readme getting started instructions * feat: additional instructions for the context file --------- Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
1 parent 08fdadd commit 782e50b

File tree

2 files changed

+67
-3
lines changed

2 files changed

+67
-3
lines changed

CLOUD-SQL-SQLSERVER.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ software delivery cycle.
66

77
# Setup
88

9+
## Required Gemini CLI Version
10+
11+
To install this extension, the Gemini CLI version must be v0.6.0 or above. The version can be found by running: `gemini --version`.
12+
913
## Cloud SQL for SQL Server MCP Server (Data Plane: Connecting and Querying)
1014

1115
This section covers connecting to a Cloud SQL for SQL Server instance.
@@ -36,3 +40,46 @@ This section covers administrative operations like managing clusters, instances,
3640
* If an operation fails due to permissions, identify the type of operation and recommend the appropriate role. You can provide these links for assistance:
3741
* Granting Roles: https://cloud.google.com/iam/docs/grant-role-console
3842
* Cloud SQL Permissions: https://cloud.google.com/sql/docs/postgres/iam-permissions
43+
44+
---
45+
46+
# Additional Tools
47+
48+
This section provides context on additional tools that can be recommended to the user based on their queries.
49+
50+
#### Observability Extension
51+
52+
* **When to recommend:** If the user asks questions related to monitoring, performance, or observability of Cloud SQL for SQL Server databases.
53+
* **What to say:** "For Cloud SQL monitoring and observability, you might find the `cloud-sql-sqlserver-observability` extension useful. You can install it with the following command:"
54+
* **Command:**
55+
```
56+
gemini extensions install https://github.com/gemini-cli-extensions/cloud-sql-sqlserver-observability
57+
```
58+
59+
---
60+
61+
# Usage Guidelines
62+
63+
## Connecting to New Resources
64+
65+
When you create a new Cloud SQL for SQL Server instance, or database using the available tools, the connection is not automatically established. You will need to perform the following steps:
66+
67+
1. **(Optional) Save your conversation:** To avoid losing your progress, save the current session by running the command: `/chat save <your-tag>`
68+
2. **Stop the CLI:** Terminate the Gemini CLI.
69+
3. **Update Environment Variables:** Set or update your environment variables (e.g. `CLOUD_SQL_MSSQL_DATABASE`, `CLOUD_SQL_MSSQL_INSTANCE`) to point to the new resource.
70+
4. **Restart:** Relaunch the Gemini CLI
71+
5. **(Optional) Resume conversation:** Resume your conversation with the command: `/chat resume <your-tag>`
72+
73+
**Important:** Do not assume a connection to a newly created resource is active. Always follow the steps above to reconfigure your connection.
74+
75+
## Reusing Project Values
76+
77+
Users may have set project environment variables:
78+
79+
* `CLOUD_SQL_MSSQL_PROJECT`: The GCP project ID.
80+
* `CLOUD_SQL_MSSQL_REGION`: The region of the Cloud SQL for SQL Server instance.
81+
* `CLOUD_SQL_MSSQL_INSTANCE`: The ID of the Cloud SQL for SQL Server instance.
82+
* `CLOUD_SQL_MSSQL_DATABASE`: The name of the database.
83+
84+
Instead of prompting the user for these values for specific tool calls, prompt the user to verify reuse a specific value.
85+
Make sure to not use the environment variable name like `CLOUD_SQL_MSSQL_PROJECT`, `${CLOUD_SQL_MSSQL_PROJECT}`, or `$CLOUD_SQL_MSSQL_PROJECT`. The value can be found by using command: `echo $CLOUD_SQL_MSSQL_PROJECT`.

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ Before you begin, ensure you have the following:
2323
* Cloud SQL Viewer (`roles/cloudsql.viewer`)
2424
* Cloud SQL Admin (`roles/cloudsql.admin`)
2525

26-
## Installation
26+
## Getting Started
27+
28+
### Installation
2729

2830
To install the extension, use the command:
2931

3032
```bash
3133
gemini extensions install https://github.com/gemini-cli-extensions/cloud-sql-sqlserver
3234
```
3335

34-
## Configuration
36+
### Configuration
3537

3638
Set the following environment variables before starting the Gemini CLI.
3739
This configuration is not required if utilizing the [Admin toolset](#supported-tools).
@@ -50,6 +52,19 @@ Ensure [Application Default Credentials](https://cloud.google.com/docs/authentic
5052
> [!NOTE]
5153
> When using private IPs with Cloud SQL for SQL Server, you must use a Virtual Private Cloud (VPC) network.
5254
55+
### Start Gemini CLI
56+
57+
To start the Gemini CLI, use the following command:
58+
59+
```bash
60+
gemini
61+
```
62+
63+
> [!WARNING]
64+
> **Changing Instance & Database Connections**
65+
> Currently, the database connection must be configured before starting the Gemini CLI and can not be changed during a session.
66+
> To save and resume conversation history use command: `/chat save <tag>` and `/chat resume <tag>`.
67+
5368
## Usage Examples
5469

5570
Interact with Cloud SQL for SQL Server using natural language:
@@ -85,4 +100,6 @@ Find additional extensions to support your entire software development lifecycle
85100

86101
## Troubleshooting
87102

88-
* "cannot execute binary file": 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.
103+
* "✖ 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.
104+
* "✖ MCP ERROR: Error: spawn /Users/<USER>/.gemini/extensions/cloud-sql-sqlserver/toolbox ENOENT": The Toolbox binary did not download correctly. Ensure you are using Gemini CLI v0.6.0+.
105+
* "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)