From b8fff4f2d47fac87ebbc9bc34f47fefb0261058b Mon Sep 17 00:00:00 2001 From: Juexin Wang Date: Thu, 27 Aug 2026 14:13:58 -0700 Subject: [PATCH] feat(plugin): migrate from generated skills to the prebuilt MCP server --- .claude-plugin/plugin.json | 68 +++++++++- .codex-plugin/.mcp.json | 23 ++++ .codex-plugin/plugin.json | 6 +- .github/renovate.json5 | 22 ++- .github/workflows/presubmit-tests.yml | 9 +- .../workflows/skills-validate-fallback.yml | 37 ------ .github/workflows/skills-validate.yml | 56 -------- README.md | 95 ++++++------- gemini-extension.json | 12 ++ mcp.json | 16 +++ mcp_config.json | 14 ++ plugin.json | 62 ++++++++- skills/cloud-sql-sqlserver-admin/SKILL.md | 125 ------------------ .../scripts/create_database.js | 103 --------------- .../scripts/create_instance.js | 103 --------------- .../scripts/create_user.js | 103 --------------- .../scripts/get_instance.js | 103 --------------- .../scripts/list_databases.js | 103 --------------- .../scripts/list_instances.js | 103 --------------- .../scripts/wait_for_operation.js | 103 --------------- skills/cloud-sql-sqlserver-data/SKILL.md | 48 ------- .../scripts/execute_sql.js | 103 --------------- .../scripts/list_tables.js | 103 --------------- skills/cloud-sql-sqlserver-lifecycle/SKILL.md | 113 ---------------- .../scripts/clone_instance.js | 103 --------------- .../scripts/create_backup.js | 103 --------------- .../scripts/get_instance.js | 103 --------------- .../scripts/list_instances.js | 103 --------------- .../scripts/restore_backup.js | 103 --------------- .../scripts/wait_for_operation.js | 103 --------------- skills/cloud-sql-sqlserver-monitor/SKILL.md | 86 ------------ .../scripts/get_system_metrics.js | 103 --------------- toolbox_version.txt | 1 - 33 files changed, 262 insertions(+), 2179 deletions(-) create mode 100644 .codex-plugin/.mcp.json delete mode 100644 .github/workflows/skills-validate-fallback.yml delete mode 100644 .github/workflows/skills-validate.yml create mode 100644 mcp.json create mode 100644 mcp_config.json delete mode 100644 skills/cloud-sql-sqlserver-admin/SKILL.md delete mode 100755 skills/cloud-sql-sqlserver-admin/scripts/create_database.js delete mode 100755 skills/cloud-sql-sqlserver-admin/scripts/create_instance.js delete mode 100755 skills/cloud-sql-sqlserver-admin/scripts/create_user.js delete mode 100755 skills/cloud-sql-sqlserver-admin/scripts/get_instance.js delete mode 100755 skills/cloud-sql-sqlserver-admin/scripts/list_databases.js delete mode 100755 skills/cloud-sql-sqlserver-admin/scripts/list_instances.js delete mode 100755 skills/cloud-sql-sqlserver-admin/scripts/wait_for_operation.js delete mode 100644 skills/cloud-sql-sqlserver-data/SKILL.md delete mode 100755 skills/cloud-sql-sqlserver-data/scripts/execute_sql.js delete mode 100755 skills/cloud-sql-sqlserver-data/scripts/list_tables.js delete mode 100644 skills/cloud-sql-sqlserver-lifecycle/SKILL.md delete mode 100755 skills/cloud-sql-sqlserver-lifecycle/scripts/clone_instance.js delete mode 100755 skills/cloud-sql-sqlserver-lifecycle/scripts/create_backup.js delete mode 100755 skills/cloud-sql-sqlserver-lifecycle/scripts/get_instance.js delete mode 100755 skills/cloud-sql-sqlserver-lifecycle/scripts/list_instances.js delete mode 100755 skills/cloud-sql-sqlserver-lifecycle/scripts/restore_backup.js delete mode 100755 skills/cloud-sql-sqlserver-lifecycle/scripts/wait_for_operation.js delete mode 100644 skills/cloud-sql-sqlserver-monitor/SKILL.md delete mode 100755 skills/cloud-sql-sqlserver-monitor/scripts/get_system_metrics.js delete mode 100644 toolbox_version.txt diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 79c4c3e..6f67289 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -7,7 +7,71 @@ "email": "data-cloud-ai-integrations@google.com" }, "homepage": "https://cloud.google.com/sql/docs/sqlserver", - "license": "Apache-2.0", "repository": "https://github.com/gemini-cli-extensions/cloud-sql-sqlserver", - "skills": "./skills/" + "license": "Apache-2.0", + "userConfig": { + "cloud_sql_mssql_project": { + "title": "Project Name", + "description": "Name of the Google Cloud project", + "type": "string", + "sensitive": false + }, + "cloud_sql_mssql_region": { + "title": "Region", + "description": "Region of the Cloud SQL instance", + "type": "string", + "sensitive": false + }, + "cloud_sql_mssql_instance": { + "title": "Instance ID", + "description": "ID of the Cloud SQL instance", + "type": "string", + "sensitive": false + }, + "cloud_sql_mssql_database": { + "title": "Database", + "description": "Name of the database", + "type": "string", + "sensitive": false + }, + "cloud_sql_mssql_user": { + "title": "User", + "description": "Username of the database user", + "type": "string", + "sensitive": false + }, + "cloud_sql_mssql_password": { + "title": "Password", + "description": "Password of the database user", + "type": "string", + "sensitive": false + }, + "cloud_sql_mssql_ip_type": { + "title": "Instance IP assignment", + "description": "(Optional) Type of the IP address: PUBLIC, PRIVATE, or PSC (Default: Public)", + "type": "string", + "sensitive": false + } + }, + "mcpServers": { + "cloud-sql-mssql": { + "command": "npx", + "args": [ + "-y", + "@toolbox-sdk/server@1.9.0", + "--prebuilt", + "cloud-sql-mssql", + "--stdio" + ], + "env": { + "CLOUD_SQL_MSSQL_PROJECT": "${user_config.cloud_sql_mssql_project}", + "CLOUD_SQL_MSSQL_REGION": "${user_config.cloud_sql_mssql_region}", + "CLOUD_SQL_MSSQL_INSTANCE": "${user_config.cloud_sql_mssql_instance}", + "CLOUD_SQL_MSSQL_DATABASE": "${user_config.cloud_sql_mssql_database}", + "CLOUD_SQL_MSSQL_USER": "${user_config.cloud_sql_mssql_user}", + "CLOUD_SQL_MSSQL_PASSWORD": "${user_config.cloud_sql_mssql_password}", + "CLOUD_SQL_MSSQL_IP_TYPE": "${user_config.cloud_sql_mssql_ip_type}" + } + } + } } diff --git a/.codex-plugin/.mcp.json b/.codex-plugin/.mcp.json new file mode 100644 index 0000000..28c7080 --- /dev/null +++ b/.codex-plugin/.mcp.json @@ -0,0 +1,23 @@ +{ + "mcpServers": { + "cloud-sql-mssql": { + "command": "npx", + "args": [ + "-y", + "@toolbox-sdk/server@1.9.0", + "--prebuilt", + "cloud-sql-mssql", + "--stdio" + ], + "env_vars": [ + "CLOUD_SQL_MSSQL_PROJECT", + "CLOUD_SQL_MSSQL_REGION", + "CLOUD_SQL_MSSQL_INSTANCE", + "CLOUD_SQL_MSSQL_DATABASE", + "CLOUD_SQL_MSSQL_USER", + "CLOUD_SQL_MSSQL_PASSWORD", + "CLOUD_SQL_MSSQL_IP_TYPE" + ] + } + } +} diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 8f937d4..867ee17 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -14,7 +14,6 @@ "sql-server", "database" ], - "skills": "./skills/", "interface": { "displayName": "Cloud SQL for SQL Server", "shortDescription": "Interact with CloudSQL for SQL Server instances.", @@ -27,5 +26,6 @@ "defaultPrompt": [ "You are a highly skilled database engineer and database administrator. Your purpose is to help the developer build and interact with databases and utilize data context throughout the entire software delivery cycle." ] - } -} \ No newline at end of file + }, + "mcpServers": "./.codex-plugin/.mcp.json" +} diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 0533093..d758c32 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -21,18 +21,28 @@ pinDigests: true, }, { - matchPackageNames: ['googleapis/mcp-toolbox'], + matchPackageNames: ['@toolbox-sdk/server'], + // Group the toolbox update under a stable branch name (renovate/toolbox). + groupName: 'toolbox', 'semanticCommitType': 'feat' } ], customManagers: [ { + // Track the npm toolbox server pinned in the MCP command. The version is + // listed in the source (mcp.json) and repeated in every generated + // manifest, so all of them are bumped in one PR. customType: "regex", - managerFilePatterns: ["/toolbox_version\\.txt$/"], - matchStrings: ["(?[\\d\\.]+)"], - datasourceTemplate: "github-releases", - packageNameTemplate: "googleapis/mcp-toolbox", - extractVersionTemplate: "^v(?.*)$", + managerFilePatterns: [ + "/mcp\.json$/", + "/mcp_config\.json$/", + "/gemini-extension\.json$/", + "/\.claude-plugin/plugin\.json$/", + "/\.codex-plugin/\.mcp\.json$/", + ], + matchStrings: ["@toolbox-sdk/server@(?[\d\.]+)"], + datasourceTemplate: "npm", + depNameTemplate: "@toolbox-sdk/server", } ] } diff --git a/.github/workflows/presubmit-tests.yml b/.github/workflows/presubmit-tests.yml index 2990407..5d397ae 100644 --- a/.github/workflows/presubmit-tests.yml +++ b/.github/workflows/presubmit-tests.yml @@ -17,6 +17,9 @@ on: pull_request: branches: [ main ] +permissions: + contents: read + jobs: run-presubmit-tests: runs-on: ubuntu-latest @@ -27,12 +30,6 @@ jobs: - name: Install Gemini CLI run: npm install @google/gemini-cli - - name: Install toolbox binary - run: | - VERSION=$(cat toolbox_version.txt) - curl -L -o toolbox "https://storage.googleapis.com/mcp-toolbox-for-databases/v${VERSION}/linux/amd64/toolbox" - chmod +x toolbox - - name: Install Extension run: npx gemini extensions validate . env: diff --git a/.github/workflows/skills-validate-fallback.yml b/.github/workflows/skills-validate-fallback.yml deleted file mode 100644 index 4a72464..0000000 --- a/.github/workflows/skills-validate-fallback.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: lint - -on: - push: - paths-ignore: - - "skills/**" - pull_request: - paths-ignore: - - "skills/**" - pull_request_target: - types: [labeled] - paths-ignore: - - "skills/**" - workflow_dispatch: - -jobs: - skills-validate: - runs-on: ubuntu-latest - steps: - - name: Skip Skill Validation - run: | - echo "No changes detected in 'skills/' directory. Skipping validation." - echo "This job ensures the required 'skills-validate' status check passes." \ No newline at end of file diff --git a/.github/workflows/skills-validate.yml b/.github/workflows/skills-validate.yml deleted file mode 100644 index 5ca49ac..0000000 --- a/.github/workflows/skills-validate.yml +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: Validate Skills - -on: - push: - paths: - - "skills/**" - pull_request: - paths: - - "skills/**" - pull_request_target: - types: [labeled] - paths: - - "skills/**" - -jobs: - skills-validate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - - - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 - with: - python-version: "3.11" - - - name: Install skills-ref - run: | - pip install "git+https://github.com/agentskills/agentskills.git#subdirectory=skills-ref" - - - name: Validate Skills - run: | - failed=0 - for skill_dir in skills/*/; do - if [ -d "$skill_dir" ]; then - echo "Validating $skill_dir..." - if ! skills-ref validate "$skill_dir"; then - echo "Validation failed for $skill_dir" - failed=1 - fi - fi - done - exit $failed \ No newline at end of file diff --git a/README.md b/README.md index 33bcb66..8a1488f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# Cloud SQL for SQL Server Agent Skills +# Cloud SQL for SQL Server > [!NOTE] > This extension is currently in beta (pre-v1.0), and may see breaking changes until the first stable release (v1.0). -This repository provides a set of agent skills to interact with [Cloud SQL for SQL Server](https://cloud.google.com/sql/docs/sqlserver) instances. These skills can be used with various AI agents, including [Antigravity](https://antigravity.google/), [Claude Code](https://claude.com/product/claude-code) and [Codex](https://developers.openai.com/codex), to manage your databases, execute queries, explore schemas, and troubleshoot issues using natural language prompts. +This repository packages [MCP Toolbox](https://github.com/googleapis/mcp-toolbox)'s prebuilt `cloud-sql-mssql` server as a plugin/extension to interact with [Cloud SQL for SQL Server](https://cloud.google.com/sql/docs/sqlserver) instances. It can be used with various AI agents, including [Antigravity](https://antigravity.google/), [Claude Code](https://claude.com/product/claude-code) and [Codex](https://developers.openai.com/codex), to manage your databases, execute queries, explore schemas, and troubleshoot issues using natural language prompts. > [!IMPORTANT] > **We Want Your Feedback!** @@ -14,7 +14,7 @@ This repository provides a set of agent skills to interact with [Cloud SQL for S ## Table of Contents -- [Why Use Cloud SQL for SQL Server Agent Skills?](#why-use-cloud-sql-for-sql-server-agent-skills) +- [Why Use Cloud SQL for SQL Server?](#why-use-cloud-sql-for-sql-server) - [Prerequisites](#prerequisites) - [Getting Started](#getting-started) - [Configuration](#configuration) @@ -22,14 +22,14 @@ This repository provides a set of agent skills to interact with [Cloud SQL for S - [Antigravity](#antigravity) - [Claude Code](#claude-code) - [Codex](#codex) -- [Installing using open agent skills tool](#installing-using-open-agent-skills-tool) - [Installing via a compatible Agent Plugins client](#installing-via-a-compatible-agent-plugins-client) - [Usage Examples](#usage-examples) -- [Supported Skills](#supported-skills) +- [Available Tools](#available-tools) +- [Generating Skills Instead](#generating-skills-instead) - [Additional Agent Skills](#additional-agent-skills) - [Troubleshooting](#troubleshooting) -## Why Use Cloud SQL for SQL Server Agent Skills? +## Why Use Cloud SQL for SQL Server? - **Seamless Workflow:** Integrates seamlessly into your AI agent's environment. No need to constantly switch contexts for common database tasks. - **Natural Language Queries:** Stop wrestling with complex commands. Explore schemas and query data by describing what you want in plain English. @@ -46,6 +46,7 @@ Before you begin, ensure you have the following: - [Antigravity 2.0](https://antigravity.google/product/antigravity-2) version **v2.0.0** or higher. - [Claude Code](https://claude.com/product/claude-code) version **v2.1.94** or higher. - [Codex](https://developers.openai.com/codex) **v0.117.0** or higher. +- [Node.js](https://nodejs.org/) — the MCP server runs via `npx`. - A Google Cloud project with the **Cloud SQL Admin API** enabled. - Ensure [Application Default Credentials](https://cloud.google.com/docs/authentication/gcloud) are available in your environment. - IAM Permissions: @@ -75,7 +76,7 @@ Please keep these env vars handy during the installation process: ### Installation & Usage -To start interacting with your database, install the skills for your preferred AI agent, then launch the agent and use natural language to ask questions or perform tasks. +To start interacting with your database, install the extension for your preferred AI agent, then launch the agent and use natural language to ask questions or perform tasks. For the latest version, check the [releases page][releases]. @@ -104,28 +105,18 @@ See Migrating from Gemi #### Antigravity 2.0 (IDE) -**1. Clone the Repo:** - -```bash -git clone --branch 0.2.0 https://github.com/gemini-cli-extensions/cloud-sql-sqlserver.git -``` - -**2. Install the skills:** - -Choose a location for the skills: -- **Global (all workspaces):** `~/.gemini/antigravity/skills/` -- **Workspace-specific:** `/.agents/skills/` +**1. Install the plugin:** -Copy the skill folders from the cloned repository's `skills/` directory to your chosen location: +Install the plugin directly from the remote GitHub repository: ```bash -cp -R cloud-sql-sqlserver/skills/* ~/.gemini/antigravity/skills/ +agy plugin install https://github.com/gemini-cli-extensions/cloud-sql-sqlserver ``` -**3. Set env vars:** +**2. Set env vars:** Set your environment vars as described in the [configuration section](#configuration). -_(Tip: Antigravity 2.0 automatically discovers skills in these directories at the start of a session. You can verify they are active by running the `/skills` command in your active session.)_ +_(Tip: You can verify the MCP server is active by running the `/mcp` command in your active session.)_ #### Antigravity CLI @@ -160,8 +151,7 @@ claude /plugin install cloud-sql-sqlserver@claude-plugins-official ``` -_(Tip: Run `/plugin list` inside Claude Code to verify the plugin is active, or `/reload-plugins` if you just installed it.)_ - +_(Tip: Run `/plugin list` inside Claude Code to verify the plugin is active, or `/reload-plugins` if you just installed it.)
@@ -189,23 +179,7 @@ codex plugin marketplace upgrade data-agent-kit
-## Installing using [open agent skills tool](https://github.com/vercel-labs/skills) - -You can install skills using the `npx skills` command. - -**1. Install the skills:** - -Run the following command in your terminal to automatically download and register the skills: - -```bash -npx skills add https://github.com/gemini-cli-extensions/cloud-sql-sqlserver/tree/0.2.0 -``` - -For detailed info check out the [Skills npm package](https://www.npmjs.com/package/skills). - -**2. Set env vars:** -Set your environment vars as described in the [configuration section](#configuration). - +## Installing via a compatible Agent Plugins client ## Installing via a compatible Agent Plugins client This repository is a valid [Agent Plugins](https://github.com/agentplugins/agent-plugins-spec) (v1) plugin. Any [Agent Plugins–compatible client](https://agent-plugins.org/compatible-clients) can install it directly using its own built-in plugin command — no extra tooling required — by pointing at this repository: @@ -235,14 +209,41 @@ Interact with Cloud SQL for SQL Server using natural language: - **Generate Code:** - "Generate a Python dataclass to represent the 'customers' table." -## Supported Skills +## Available Tools + +The tools come from MCP Toolbox's prebuilt `cloud-sql-mssql` server, grouped into toolsets: + +- **admin** - Use these tools when you need to provision new Cloud SQL for SQL Server instances, create databases and users, and monitor the progress of long-running operations. +- **data** - Use these tools when you need to explore the database schema and execute SQL queries to interact with your data. +- **monitor** - Use these tools when you need to troubleshoot slow queries and analyze system-level PromQL metrics. +- **lifecycle** - Use these tools when you need to manage the lifecycle and durability of your data, including creating backups, restoring from existing backups, and cloning instances for testing or migration. + +For the full, up-to-date list, see the [`cloud-sql-mssql` prebuilt config](https://github.com/googleapis/mcp-toolbox/blob/main/internal/prebuiltconfigs/tools/cloud-sql-mssql.yaml) +in the MCP Toolbox repository. -The following skills are available in this repository: +## Generating Skills Instead + +The tool-backed skills this plugin used to ship were generated from the same prebuilt +toolsets. If your agent lacks deferred tool loading, or you prefer skills, regenerate +them with the script in this repository: + +```bash +VERSION= ./.github/scripts/generate_skills.sh +``` + +Use the toolbox version pinned in [`mcp.json`](./mcp.json). A single toolset, without +the script: + +```bash +npx @toolbox-sdk/server@ --prebuilt cloud-sql-mssql skills-generate \ + --name "" \ + --toolset "" \ + --description "" +``` -- [Cloud SQL for SQL Server Admin](./skills/cloud-sql-sqlserver-admin/SKILL.md) - Use these skills when you need to provision new Cloud SQL for SQL Server instances, create databases and users, clone existing environments, and monitor the progress of long-running operations. -- [Cloud SQL for SQL Server Data](./skills/cloud-sql-sqlserver-data/SKILL.md) - Use these skills when you need to explore the database schema, execute SQL queries to interact with your data, and monitor system-level performance metrics using PromQL queries. -- [Cloud SQL for SQL Server Lifecycle](./skills/cloud-sql-sqlserver-lifecycle/SKILL.md) - Use these skills when you need to manage the lifecycle and durability of your data, including creating backups, restoring from existing backups, and cloning instances for testing or migration. -- [Cloud SQL for SQL Server Monitor](./skills/cloud-sql-sqlserver-monitor/SKILL.md) - Use these skills when you need to troubleshoot slow queries and analyze system-level PromQL metrics. +The generated scripts call the toolbox through `npx`, so no binary download is needed. +See [Generate Agent Skills](https://github.com/googleapis/mcp-toolbox#generate-agent-skills) +in the MCP Toolbox repository. ## Additional Agent Skills diff --git a/gemini-extension.json b/gemini-extension.json index c9f64fb..99541d3 100644 --- a/gemini-extension.json +++ b/gemini-extension.json @@ -2,6 +2,18 @@ "name": "cloud-sql-sqlserver", "version": "0.2.0", "description": "Connect to Cloud SQL for SQL Server", + "mcpServers": { + "cloud-sql-mssql": { + "command": "npx", + "args": [ + "-y", + "@toolbox-sdk/server@1.9.0", + "--prebuilt", + "cloud-sql-mssql", + "--stdio" + ] + } + }, "contextFileName": "CLOUD-SQL-SQLSERVER.md", "settings": [ { diff --git a/mcp.json b/mcp.json new file mode 100644 index 0000000..ff5f8ec --- /dev/null +++ b/mcp.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json", + "mcpServers": { + "cloud-sql-mssql": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "@toolbox-sdk/server@1.9.0", + "--prebuilt", + "cloud-sql-mssql", + "--stdio" + ] + } + } +} diff --git a/mcp_config.json b/mcp_config.json new file mode 100644 index 0000000..13fc456 --- /dev/null +++ b/mcp_config.json @@ -0,0 +1,14 @@ +{ + "mcpServers": { + "cloud-sql-mssql": { + "command": "npx", + "args": [ + "-y", + "@toolbox-sdk/server@1.9.0", + "--prebuilt", + "cloud-sql-mssql", + "--stdio" + ] + } + } +} diff --git a/plugin.json b/plugin.json index 8ed147d..86fe577 100644 --- a/plugin.json +++ b/plugin.json @@ -14,5 +14,65 @@ "cloud-sql", "sql-server", "database" - ] + ], + "extensions": { + "com.google.cloud.data.agent-plugins": { + "config": [ + { + "key": "CLOUD_SQL_MSSQL_PROJECT", + "title": "Project Name", + "description": "Name of the Google Cloud project" + }, + { + "key": "CLOUD_SQL_MSSQL_REGION", + "title": "Region", + "description": "Region of the Cloud SQL instance" + }, + { + "key": "CLOUD_SQL_MSSQL_INSTANCE", + "title": "Instance ID", + "description": "ID of the Cloud SQL instance" + }, + { + "key": "CLOUD_SQL_MSSQL_DATABASE", + "title": "Database", + "description": "Name of the database" + }, + { + "key": "CLOUD_SQL_MSSQL_USER", + "title": "User", + "description": "Username of the database user" + }, + { + "key": "CLOUD_SQL_MSSQL_PASSWORD", + "title": "Password", + "description": "Password of the database user" + }, + { + "key": "CLOUD_SQL_MSSQL_IP_TYPE", + "title": "Instance IP assignment", + "description": "(Optional) Type of the IP address: PUBLIC, PRIVATE, or PSC (Default: Public)" + } + ], + "gemini": { + "mcpServerName": "cloud-sql-mssql", + "contextFileName": "CLOUD-SQL-SQLSERVER.md" + }, + "codex": { + "interface": { + "displayName": "Cloud SQL for SQL Server", + "shortDescription": "Interact with CloudSQL for SQL Server instances.", + "developerName": "Google LLC", + "category": "Database", + "capabilities": [ + "Read", + "Write" + ], + "defaultPrompt": [ + "You are a highly skilled database engineer and database administrator. Your purpose is to help the developer build and interact with databases and utilize data context throughout the entire software delivery cycle." + ] + } + } + } + } } diff --git a/skills/cloud-sql-sqlserver-admin/SKILL.md b/skills/cloud-sql-sqlserver-admin/SKILL.md deleted file mode 100644 index 5b967d1..0000000 --- a/skills/cloud-sql-sqlserver-admin/SKILL.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -name: cloud-sql-sqlserver-admin -description: Use these skills when you need to provision new Cloud SQL for SQL Server instances, create databases and users, clone existing environments, and monitor the progress of long-running operations. ---- - -## Usage - -All scripts can be executed using Node.js. Replace `` and `` with actual values. - -**Bash:** -`node /scripts/.js '{"": ""}'` - -**PowerShell:** -`node /scripts/.js '{\"\": \"\"}'` - -Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence. - - -## Scripts - - -### create_database - - - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | -| instance | string | The ID of the instance where the database will be created. | Yes | | -| name | string | The name for the new database. Must be unique within the instance. | Yes | | - - ---- - -### create_instance - - - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | -| name | string | The name of the instance | Yes | | -| databaseVersion | string | The database version for SQL Server. If not specified, defaults to SQLSERVER_2022_STANDARD. | No | `SQLSERVER_2022_STANDARD` | -| rootPassword | string | The root password for the instance | Yes | | -| editionPreset | string | The edition of the instance. Can be `Production` or `Development`. This determines the default machine type and availability. Defaults to `Development`. | No | `Development` | - - ---- - -### create_user - - - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | -| instance | string | The ID of the instance where the user will be created. | Yes | | -| name | string | The name for the new user. Must be unique within the instance. | Yes | | -| password | string | A secure password for the new user. Not required for IAM users. | No | | -| iamUser | boolean | Set to true to create a Cloud IAM user. | Yes | | - - ---- - -### get_instance - - - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| projectId | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | -| instanceId | string | The instance ID | Yes | | - - ---- - -### list_databases - -Lists all databases for a Cloud SQL instance. - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | -| instance | string | The instance ID | Yes | | - - ---- - -### list_instances - -Lists all type of Cloud SQL instances for a project. - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | - - ---- - -### wait_for_operation - - - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | -| operation | string | The operation ID | Yes | | - - ---- - diff --git a/skills/cloud-sql-sqlserver-admin/scripts/create_database.js b/skills/cloud-sql-sqlserver-admin/scripts/create_database.js deleted file mode 100755 index b3e6240..0000000 --- a/skills/cloud-sql-sqlserver-admin/scripts/create_database.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "create_database"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-admin/scripts/create_instance.js b/skills/cloud-sql-sqlserver-admin/scripts/create_instance.js deleted file mode 100755 index 87e0db3..0000000 --- a/skills/cloud-sql-sqlserver-admin/scripts/create_instance.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "create_instance"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-admin/scripts/create_user.js b/skills/cloud-sql-sqlserver-admin/scripts/create_user.js deleted file mode 100755 index d953c67..0000000 --- a/skills/cloud-sql-sqlserver-admin/scripts/create_user.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "create_user"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-admin/scripts/get_instance.js b/skills/cloud-sql-sqlserver-admin/scripts/get_instance.js deleted file mode 100755 index 1b0ae44..0000000 --- a/skills/cloud-sql-sqlserver-admin/scripts/get_instance.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "get_instance"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-admin/scripts/list_databases.js b/skills/cloud-sql-sqlserver-admin/scripts/list_databases.js deleted file mode 100755 index 6f1390f..0000000 --- a/skills/cloud-sql-sqlserver-admin/scripts/list_databases.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "list_databases"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-admin/scripts/list_instances.js b/skills/cloud-sql-sqlserver-admin/scripts/list_instances.js deleted file mode 100755 index 0d4e04c..0000000 --- a/skills/cloud-sql-sqlserver-admin/scripts/list_instances.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "list_instances"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-admin/scripts/wait_for_operation.js b/skills/cloud-sql-sqlserver-admin/scripts/wait_for_operation.js deleted file mode 100755 index 8d99bc1..0000000 --- a/skills/cloud-sql-sqlserver-admin/scripts/wait_for_operation.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "wait_for_operation"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-data/SKILL.md b/skills/cloud-sql-sqlserver-data/SKILL.md deleted file mode 100644 index efa4ce3..0000000 --- a/skills/cloud-sql-sqlserver-data/SKILL.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -name: cloud-sql-sqlserver-data -description: Use these skills when you need to explore the database schema, execute SQL queries to interact with your data, and monitor system-level performance metrics using PromQL queries. ---- - -## Usage - -All scripts can be executed using Node.js. Replace `` and `` with actual values. - -**Bash:** -`node /scripts/.js '{"": ""}'` - -**PowerShell:** -`node /scripts/.js '{\"\": \"\"}'` - -Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence. - - -## Scripts - - -### execute_sql - -Use this tool to execute SQL. - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| sql | string | The sql to execute. | Yes | | - - ---- - -### list_tables - -Lists detailed schema information (object type, columns, constraints, indexes, triggers, comment) as JSON for user-created tables (ordinary or partitioned). Filters by a comma-separated list of names. If names are omitted, lists all tables in user schemas. - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| table_names | string | Optional: A comma-separated list of table names. If empty, details for all tables will be listed. | No | `` | -| output_format | string | Optional: Use 'simple' for names only or 'detailed' for full info. | No | `detailed` | - - ---- - diff --git a/skills/cloud-sql-sqlserver-data/scripts/execute_sql.js b/skills/cloud-sql-sqlserver-data/scripts/execute_sql.js deleted file mode 100755 index fc7d7c0..0000000 --- a/skills/cloud-sql-sqlserver-data/scripts/execute_sql.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "execute_sql"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-data/scripts/list_tables.js b/skills/cloud-sql-sqlserver-data/scripts/list_tables.js deleted file mode 100755 index b4e6280..0000000 --- a/skills/cloud-sql-sqlserver-data/scripts/list_tables.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "list_tables"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-lifecycle/SKILL.md b/skills/cloud-sql-sqlserver-lifecycle/SKILL.md deleted file mode 100644 index 5742ed6..0000000 --- a/skills/cloud-sql-sqlserver-lifecycle/SKILL.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -name: cloud-sql-sqlserver-lifecycle -description: Use these skills when you need to manage the lifecycle and durability of your data, including creating backups, restoring from existing backups, and cloning instances for testing or migration. ---- - -## Usage - -All scripts can be executed using Node.js. Replace `` and `` with actual values. - -**Bash:** -`node /scripts/.js '{"": ""}'` - -**PowerShell:** -`node /scripts/.js '{\"\": \"\"}'` - -Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence. - - -## Scripts - - -### clone_instance - -Clone an existing Cloud SQL instance into a new instance. The clone can be a direct copy of the source instance, or a point-in-time-recovery (PITR) clone from a specific timestamp. The call returns a Cloud SQL Operation object. Call wait_for_operation tool after this, make sure to use multiplier as 4 to poll the opertation status till it is marked DONE. - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | -| sourceInstanceName | string | The name of the instance to be cloned. | Yes | | -| destinationInstanceName | string | The name of the new instance that will be created by cloning the source instance. | Yes | | -| pointInTime | string | The timestamp in RFC 3339 format to which the source instance should be cloned. | No | | -| preferredZone | string | The preferred zone for the new instance. | No | | -| preferredSecondaryZone | string | The preferred secondary zone for the new instance. | No | | - - ---- - -### create_backup - -Creates a backup on a Cloud SQL instance. - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | -| instance | string | Cloud SQL instance ID. This does not include the project ID. | Yes | | -| location | string | Location of the backup run. | No | | -| backup_description | string | The description of this backup run. | No | | - - ---- - -### get_instance - - - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| projectId | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | -| instanceId | string | The instance ID | Yes | | - - ---- - -### list_instances - -Lists all type of Cloud SQL instances for a project. - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | - - ---- - -### restore_backup - -Restores a backup on a Cloud SQL instance. - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| target_project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | -| target_instance | string | Cloud SQL instance ID of the target instance. This does not include the project ID. | Yes | | -| backup_id | string | Identifier of the backup being restored. Can be a BackupRun ID, backup name, or BackupDR backup name. Use the full backup ID as provided, do not try to parse it | Yes | | -| source_project | string | GCP project ID of the instance that the backup belongs to. Only required if the backup_id is a BackupRun ID. | No | | -| source_instance | string | Cloud SQL instance ID of the instance that the backup belongs to. Only required if the backup_id is a BackupRun ID. | No | | - - ---- - -### wait_for_operation - - - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | -| operation | string | The operation ID | Yes | | - - ---- - diff --git a/skills/cloud-sql-sqlserver-lifecycle/scripts/clone_instance.js b/skills/cloud-sql-sqlserver-lifecycle/scripts/clone_instance.js deleted file mode 100755 index 6bf53ab..0000000 --- a/skills/cloud-sql-sqlserver-lifecycle/scripts/clone_instance.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "clone_instance"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-lifecycle/scripts/create_backup.js b/skills/cloud-sql-sqlserver-lifecycle/scripts/create_backup.js deleted file mode 100755 index aa799e5..0000000 --- a/skills/cloud-sql-sqlserver-lifecycle/scripts/create_backup.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "create_backup"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-lifecycle/scripts/get_instance.js b/skills/cloud-sql-sqlserver-lifecycle/scripts/get_instance.js deleted file mode 100755 index 1b0ae44..0000000 --- a/skills/cloud-sql-sqlserver-lifecycle/scripts/get_instance.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "get_instance"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-lifecycle/scripts/list_instances.js b/skills/cloud-sql-sqlserver-lifecycle/scripts/list_instances.js deleted file mode 100755 index 0d4e04c..0000000 --- a/skills/cloud-sql-sqlserver-lifecycle/scripts/list_instances.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "list_instances"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-lifecycle/scripts/restore_backup.js b/skills/cloud-sql-sqlserver-lifecycle/scripts/restore_backup.js deleted file mode 100755 index f773c09..0000000 --- a/skills/cloud-sql-sqlserver-lifecycle/scripts/restore_backup.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "restore_backup"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-lifecycle/scripts/wait_for_operation.js b/skills/cloud-sql-sqlserver-lifecycle/scripts/wait_for_operation.js deleted file mode 100755 index 8d99bc1..0000000 --- a/skills/cloud-sql-sqlserver-lifecycle/scripts/wait_for_operation.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "wait_for_operation"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/cloud-sql-sqlserver-monitor/SKILL.md b/skills/cloud-sql-sqlserver-monitor/SKILL.md deleted file mode 100644 index e978b67..0000000 --- a/skills/cloud-sql-sqlserver-monitor/SKILL.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -name: cloud-sql-sqlserver-monitor -description: Use these skills when you need to troubleshoot slow queries and analyze system-level PromQL metrics. ---- - -## Usage - -All scripts can be executed using Node.js. Replace `` and `` with actual values. - -**Bash:** -`node /scripts/.js '{"": ""}'` - -**PowerShell:** -`node /scripts/.js '{\"\": \"\"}'` - -Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence. - - -## Scripts - - -### get_system_metrics - -Fetches system level cloudmonitoring data (timeseries metrics) for a SqlServer instance using a PromQL query. Take projectId and instanceId from the user for which the metrics timeseries data needs to be fetched. -To use this tool, you must provide the Google Cloud `projectId` and a PromQL `query`. - -Generate PromQL `query` for SqlServer system metrics. Use the provided metrics and rules to construct queries, Get the labels like `instance_id` from user intent. - -Defaults: -1. Interval: Use a default interval of `5m` for `_over_time` aggregation functions unless a different window is specified by the user. - -PromQL Query Examples: -1. Basic Time Series: `avg_over_time({"__name__"="cloudsql.googleapis.com/database/cpu/utilization","monitored_resource"="cloudsql_database","project_id"="my-projectId","database_id"="my-projectId:my-instanceId"}[5m])` -2. Top K: `topk(30, avg_over_time({"__name__"="cloudsql.googleapis.com/database/cpu/utilization","monitored_resource"="cloudsql_database","project_id"="my-projectId","database_id"="my-projectId:my-instanceId"}[5m]))` -3. Mean: `avg(avg_over_time({"__name__"="cloudsql.googleapis.com/database/cpu/utilization","monitored_resource"="cloudsql_database","project_id"="my-projectId","database_id"="my-projectId:my-instanceId"}[5m]))` -4. Minimum: `min(min_over_time({"__name__"="cloudsql.googleapis.com/database/cpu/utilization","monitored_resource"="cloudsql_database","project_id"="my-projectId","database_id"="my-projectId:my-instanceId"}[5m]))` -5. Maximum: `max(max_over_time({"__name__"="cloudsql.googleapis.com/database/cpu/utilization","monitored_resource"="cloudsql_database","project_id"="my-projectId","database_id"="my-projectId:my-instanceId"}[5m]))` -6. Sum: `sum(avg_over_time({"__name__"="cloudsql.googleapis.com/database/cpu/utilization","monitored_resource"="cloudsql_database","project_id"="my-projectId","database_id"="my-projectId:my-instanceId"}[5m]))` -7. Count streams: `count(avg_over_time({"__name__"="cloudsql.googleapis.com/database/cpu/utilization","monitored_resource"="cloudsql_database","project_id"="my-projectId","database_id"="my-projectId:my-instanceId"}[5m]))` -8. Percentile with groupby on database_id: `quantile by ("database_id")(0.99,avg_over_time({"__name__"="cloudsql.googleapis.com/database/cpu/utilization","monitored_resource"="cloudsql_database","project_id"="my-projectId","database_id"="my-projectId:my-instanceId"}[5m]))` - -Available Metrics List: metricname. description. monitored resource. labels. database_id is actually the instance id and the format is `project_id:instance_id`. -1. `cloudsql.googleapis.com/database/cpu/utilization`: Current CPU utilization as a percentage of the reserved CPU. `cloudsql_database`. `database`, `project_id`, `database_id`. -2. `cloudsql.googleapis.com/database/memory/usage`: RAM usage in bytes, excluding buffer/cache. `cloudsql_database`. `database`, `project_id`, `database_id`. -3. `cloudsql.googleapis.com/database/memory/total_usage`: Total RAM usage in bytes, including buffer/cache. `cloudsql_database`. `database`, `project_id`, `database_id`. -4. `cloudsql.googleapis.com/database/disk/bytes_used`: Data utilization in bytes. `cloudsql_database`. `database`, `project_id`, `database_id`. -5. `cloudsql.googleapis.com/database/disk/quota`: Maximum data disk size in bytes. `cloudsql_database`. `database`, `project_id`, `database_id`. -6. `cloudsql.googleapis.com/database/disk/read_ops_count`: Delta count of data disk read IO operations. `cloudsql_database`. `database`, `project_id`, `database_id`. -7. `cloudsql.googleapis.com/database/disk/write_ops_count`: Delta count of data disk write IO operations. `cloudsql_database`. `database`, `project_id`, `database_id`. -8. `cloudsql.googleapis.com/database/network/received_bytes_count`: Delta count of bytes received through the network. `cloudsql_database`. `database`, `project_id`, `database_id`. -9. `cloudsql.googleapis.com/database/network/sent_bytes_count`: Delta count of bytes sent through the network. `cloudsql_database`. `destination`, `database`, `project_id`, `database_id`. -10. `cloudsql.googleapis.com/database/sqlserver/memory/buffer_cache_hit_ratio`: Current percentage of pages found in the buffer cache without reading from disk. `cloudsql_database`. `database`, `project_id`, `database_id`. -11. `cloudsql.googleapis.com/database/sqlserver/memory/memory_grants_pending`: Current number of processes waiting for a workspace memory grant. `cloudsql_database`. `database`, `project_id`, `database_id`. -12. `cloudsql.googleapis.com/database/sqlserver/memory/free_list_stall_count`: Total number of requests that waited for a free page. `cloudsql_database`. `database`, `project_id`, `database_id`. -13. `cloudsql.googleapis.com/database/swap/pages_swapped_in_count`: Total count of pages swapped in from disk since the system was booted. `cloudsql_database`. `database`, `project_id`, `database_id`. -14. `cloudsql.googleapis.com/database/swap/pages_swapped_out_count`: Total count of pages swapped out to disk since the system was booted. `cloudsql_database`. `database`, `project_id`, `database_id`. -15. `cloudsql.googleapis.com/database/sqlserver/memory/checkpoint_page_count`: Total number of pages flushed to disk by a checkpoint. `cloudsql_database`. `database`, `project_id`, `database_id`. -16. `cloudsql.googleapis.com/database/sqlserver/memory/lazy_write_count`: Total number of buffers written by the buffer manager's lazy writer. `cloudsql_database`. `database`, `project_id`, `database_id`. -17. `cloudsql.googleapis.com/database/sqlserver/memory/page_life_expectancy`: Current number of seconds a page will stay in the buffer pool. `cloudsql_database`. `database`, `project_id`, `database_id`. -18. `cloudsql.googleapis.com/database/sqlserver/memory/page_operation_count`: Total number of physical database page reads or writes. `cloudsql_database`. `operation`, `database`, `project_id`, `database_id`. -19. `cloudsql.googleapis.com/database/sqlserver/transactions/page_split_count`: Total number of page splits from overflowing index pages. `cloudsql_database`. `database`, `project_id`, `database_id`. -20. `cloudsql.googleapis.com/database/sqlserver/transactions/deadlock_count`: Total number of lock requests that resulted in a deadlock. `cloudsql_database`. `locked_resource`, `database`, `project_id`, `database_id`. -21. `cloudsql.googleapis.com/database/sqlserver/transactions/transaction_count`: Total number of transactions started. `cloudsql_database`. `database`, `project_id`, `database_id`. -22. `cloudsql.googleapis.com/database/sqlserver/transactions/batch_request_count`: Total number of Transact-SQL command batches received. `cloudsql_database`. `database`, `project_id`, `database_id`. -23. `cloudsql.googleapis.com/database/sqlserver/transactions/sql_compilation_count`: Total number of SQL compilations. `cloudsql_database`. `database`, `project_id`, `database_id`. -24. `cloudsql.googleapis.com/database/sqlserver/transactions/sql_recompilation_count`: Total number of SQL recompilations. `cloudsql_database`. `database`, `project_id`, `database_id`. -25. `cloudsql.googleapis.com/database/sqlserver/connections/processes_blocked`: Current number of blocked processes. `cloudsql_database`. `database`, `project_id`, `database_id`. -26. `cloudsql.googleapis.com/database/sqlserver/transactions/lock_wait_time`: Total time lock requests were waiting for locks. `cloudsql_database`. `locked_resource`, `database`, `project_id`, `database_id`. -27. `cloudsql.googleapis.com/database/sqlserver/transactions/lock_wait_count`: Total number of lock requests that required the caller to wait. `cloudsql_database`. `locked_resource`, `database`, `project_id`, `database_id`. -28. `cloudsql.googleapis.com/database/network/connections`: Number of connections to databases on the instance. `cloudsql_database`. `database`, `project_id`, `database_id`. -29. `cloudsql.googleapis.com/database/sqlserver/connections/login_attempt_count`: Total number of login attempts since the last server restart. `cloudsql_database`. `database`, `project_id`, `database_id`. -30. `cloudsql.googleapis.com/database/sqlserver/connections/logout_count`: Total number of logout operations since the last server restart. `cloudsql_database`. `database`, `project_id`, `database_id`. -31. `cloudsql.googleapis.com/database/sqlserver/connections/connection_reset_count`: Total number of logins started from the connection pool since the last server restart. `cloudsql_database`. `database`, `project_id`, `database_id`. -32. `cloudsql.googleapis.com/database/sqlserver/transactions/full_scan_count`: Total number of unrestricted full scans (base-table or full-index). `cloudsql_database`. `database`, `project_id`, `database_id`. - - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| projectId | string | The Id of the Google Cloud project. | Yes | | -| query | string | The promql query to execute. | Yes | | - - ---- - diff --git a/skills/cloud-sql-sqlserver-monitor/scripts/get_system_metrics.js b/skills/cloud-sql-sqlserver-monitor/scripts/get_system_metrics.js deleted file mode 100755 index 68ac1d8..0000000 --- a/skills/cloud-sql-sqlserver-monitor/scripts/get_system_metrics.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "get_system_metrics"; -const configArgs = ["--prebuilt", "cloud-sql-mssql"]; - -const OPTIONAL_VARS_TO_OMIT_IF_EMPTY = [ - 'CLOUD_SQL_MSSQL_IP_TYPE', -]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - OPTIONAL_VARS_TO_OMIT_IF_EMPTY.forEach(varName => { - if (env[varName] === '') { - delete env[varName]; - } - }); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/toolbox_version.txt b/toolbox_version.txt deleted file mode 100644 index 1cc5f65..0000000 --- a/toolbox_version.txt +++ /dev/null @@ -1 +0,0 @@ -1.1.0 \ No newline at end of file