Skip to content

Commit b788c64

Browse files
authored
Merge branch 'main' into context-setup
2 parents f979958 + eeeaf81 commit b788c64

6 files changed

Lines changed: 37 additions & 17 deletions

File tree

.github/workflows/json-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Check out code
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2727

2828
- name: Run JSON Lint
2929
run: jq . gemini-extension.json

.github/workflows/markdown-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Check out code
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2828

2929
- name: Link Checker
3030
uses: lycheeverse/lychee-action@v2.0.2

.github/workflows/package-and-upload-assets.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
steps:
4141
- name: Checkout code at the new tag
42-
uses: actions/checkout@v4
42+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
4343
with:
4444
ref: ${{ github.event.release.tag_name }}
4545

@@ -116,10 +116,10 @@ jobs:
116116
contents: write
117117
steps:
118118
- name: Checkout code
119-
uses: actions/checkout@v4
119+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
120120

121121
- name: Download all archives from workflow artifacts
122-
uses: actions/download-artifact@v4
122+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
123123
with:
124124
path: release-archives
125125

.github/workflows/presubmit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Check out code
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2626

2727
- name: Install Gemini CLI
2828
run: npm install @google/gemini-cli

README.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,17 @@ Before you begin, ensure you have the following:
2424
* Cloud SQL Client (`roles/cloudsql.client`)
2525
* Cloud SQL Admin (`roles/cloudsql.admin`)
2626

27-
## Installation
27+
## Getting Started
28+
29+
### Installation
2830

2931
To install the extension, use the command:
3032

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

35-
## Configuration
37+
### Configuration
3638

3739
Set the following environment variables before starting the Gemini CLI.
3840
This configuration is not required if utilizing the [Admin toolset](#supported-tools).
@@ -48,13 +50,26 @@ This configuration is not required if utilizing the [Admin toolset](#supported-t
4850
Ensure [Application Default Credentials](https://cloud.google.com/docs/authentication/gcloud) are available in your environment.
4951

5052
> [!NOTE]
51-
> When using private IPs with Cloud SQL for PostgreSQL, you must use a Virtual Private Cloud (VPC) network.
53+
> If your Cloud SQL for PostgreSQL instance uses private IPs, you must run Gemini CLI in the same Virtual Private Cloud (VPC) network.
54+
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>`.
5267
5368
## Usage Examples
5469

5570
Interact with Cloud SQL for PostgreSQL using natural language:
5671

57-
* **Provision Infrastructure:**
72+
* **Provision Infrastructure:**
5873
* "Create a new CLoud SQL for Postgres instance named 'e-commerce-prod' in the 'my-gcp-project' project."
5974
* "Create a new user named 'analyst' with read access to all tables."
6075
* **Explore Schemas and Data:**
@@ -69,10 +84,10 @@ Interact with Cloud SQL for PostgreSQL using natural language:
6984
* **Admin:**
7085
* `create_instance`: Use this tool to create an Postgres instance.
7186
* `create_user`: Use this tool to create Postgres-BUILT-IN or IAM-based users.
87+
* `create_database`: Creates a new database in a Cloud SQL instance.
7288
* `get_instance`: Use this tool to get details about an Postgres instance.
73-
* `get_user`: Use this tool to get details about a user.
7489
* `list_instances`: Use this tool to list instances in a given project and location.
75-
* `list_users`: Use this tool to list users in a given project and location.
90+
* `list_databases`: Lists all databases for a Cloud SQL instance.
7691
* `wait_for_operation`: Use this tool to poll the operations API until the operation is done.
7792

7893
* **Data:**
@@ -90,8 +105,13 @@ Interact with Cloud SQL for PostgreSQL using natural language:
90105

91106
## Additional Extensions
92107

93-
Find additional extensions to support your entire software development lifecycle at [github.com/gemini-cli-extensions](https://github.com/gemini-cli-extensions), including a generic [PostgreSQL extension](https://github.com/gemini-cli-extensions/postgres).
108+
Find additional extensions to support your entire software development lifecycle at [github.com/gemini-cli-extensions](https://github.com/gemini-cli-extensions), including:
109+
* [Generic PostgreSQL extension](https://github.com/gemini-cli-extensions/postgres)
110+
* [Cloud SQL for PostgreSQL Observability extension](https://github.com/gemini-cli-extensions/cloud-sql-postgresql-observability)
111+
* and more!
94112

95113
## Troubleshooting
96114

97-
* "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.
115+
* "✖ 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.
116+
* "✖ MCP ERROR: Error: spawn /Users/<USER>/.gemini/extensions/cloud-sql-postgresql/toolbox ENOENT": The Toolbox binary did not download correctly. Ensure you are using Gemini CLI v0.6.0+.
117+
* "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.

gemini-extension.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"version": "0.1.0",
44
"description": "Create, connect, and interact with a Cloud SQL for PostgreSQL database and data.",
55
"mcpServers": {
6-
"Cloud SQL for PostgreSQL Admin": {
6+
"cloud_sql_postgresql_admin": {
77
"command": "${extensionPath}${/}toolbox",
88
"args": [
99
"--prebuilt",
1010
"cloud-sql-postgres-admin",
1111
"--stdio"
1212
]
1313
},
14-
"Cloud SQL for PostgreSQL": {
14+
"cloud_sql_postgresql": {
1515
"command": "${extensionPath}${/}toolbox",
1616
"args": [
1717
"--prebuilt",
@@ -27,4 +27,4 @@
2727
}
2828
},
2929
"contextFileName": "CLOUD-SQL-POSTGRESQL.md"
30-
}
30+
}

0 commit comments

Comments
 (0)