Install
openclaw skills install alibabacloud-rds-copilotAlibaba Cloud RDS Copilot intelligent operations assistant skill. Used for RDS-related intelligent Q&A, SQL optimization, instance operations, and troubleshooting. Calls RdsAi OpenAPI through Alibaba Cloud CLI to get real-time RDS Copilot responses. Triggers: "RDS Copilot", "RDS Assistant", "SQL optimization", "RDS troubleshooting", "RDS operations", "database diagnosis"
openclaw skills install alibabacloud-rds-copilotThis skill serves as an intelligent agent for Alibaba Cloud RDS Copilot in conversations, helping users with RDS-related intelligent Q&A, SQL optimization, instance operations, and troubleshooting.
Architecture: Alibaba Cloud CLI + RdsAi OpenAPI
Main features:
aliyun rdsai chat-messages command for real-time RDS Copilot queriesPre-check: Alibaba Cloud CLI must be installed
This skill uses Alibaba Cloud CLI to call RdsAi OpenAPI. You need to install and configure Alibaba Cloud CLI first.
Pre-check: Aliyun CLI >= 3.3.3 required
Run
aliyun versionto verify >= 3.3.3. If not installed or version too low, runcurl -fsSL https://aliyuncli.alicdn.com/setup.sh | bashto update, or seereferences/cli-installation-guide.mdfor installation instructions.
Pre-check: Aliyun CLI plugin update required
[MUST] run
aliyun configure set --auto-plugin-install trueto enable automatic plugin installation. [MUST] runaliyun plugin updateto ensure that any existing plugins are always up-to-date.
[MUST] CLI User-Agent — Every aliyun CLI command invocation must include:
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-rds-copilot
# Option 1: Install via Homebrew (recommended)
brew install aliyun-cli
# Option 2: Install via PKG package
curl -O https://aliyuncli.alicdn.com/aliyun-cli-latest.pkg
sudo installer -pkg aliyun-cli-latest.pkg -target /
# Option 3: Install via one-click script
/bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)"
# Install via one-click script
/bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)"
# Or download TGZ package for manual installation
curl https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz -o aliyun-cli.tgz
tar xzvf aliyun-cli.tgz
sudo mv aliyun /usr/local/bin/
aliyun version
aliyun configure --profile rdsai
Follow the prompts to enter:
aliyun configure set \
--profile rdsai \
--mode AK \
--access-key-id <yourAccessKeyID> \
--access-key-secret <yourAccessKeySecret> \
--region cn-hangzhou
aliyun rdsai chat-messages \
--query '<query content>' \
--inputs RegionId=<region ID> Language=<language> Timezone=<timezone> [CustomAgentId=<custom agent ID>] \
--event-mode separate \
--endpoint rdsai.aliyuncs.com \
--user-agent 'AlibabaCloud-Agent-Skills/alibabacloud-rds-copilot' \
[--conversation-id '<conversation ID>']
IMPORTANT: Parameter Confirmation — Before executing any command, Determine user intent: SQL writing/optimization, SQL diagnosis, instance parameter tuning, troubleshooting, performance analysis, query instance list, etc. Collect necessary parameters (use default values if not specified).
| Parameter | Required/Optional | Description | Default |
|---|---|---|---|
--query | Required | User query content | - |
--inputs RegionId= | Optional | Alibaba Cloud region ID | cn-hangzhou |
--inputs Language= | Optional | Language | zh-CN |
--inputs Timezone= | Optional | Timezone | Asia/Shanghai |
--inputs CustomAgentId= | Optional | Custom Agent ID | None |
--event-mode | Optional | Event mode | separate |
--endpoint | Required | API endpoint | rdsai.aliyuncs.com |
--conversation-id | Optional | Conversation ID for multi-turn dialogue | None |
--region | Optional | Region for API call | Credential default region |
--profile | Optional | Specify credential profile name | Default profile |
--user-agent | Required | Custom User-Agent | AlibabaCloud-Agent-Skills/alibabacloud-rds-copilot |
This skill requires the following RAM permissions. See references/ram-policies.md for details.
| Permission | Description |
|---|---|
rdsai:ChatMessages | Call RDS AI Assistant API |
Before executing any aliyun CLI command, you must enable AI-Mode and set the User-Agent:
# [MUST] Enable AI-Mode before any CLI command execution
aliyun configure ai-mode enable
# [MUST] Set User-Agent for AI-Mode
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-rds-copilot"
Determine user intent: SQL writing/optimization, SQL diagnosis, instance parameter tuning, troubleshooting, performance analysis, query instance list, etc.
Collect necessary parameters (use default values if not specified):
RegionId: Region ID (default cn-hangzhou)Language: Language (default zh-CN)Timezone: Timezone (default Asia/Shanghai)CustomAgentId: Custom Agent ID (optional)--conversation-id: Conversation ID for multi-turn dialogue (optional)# Basic query
aliyun rdsai chat-messages \
--query 'List RDS MySQL instances in Hangzhou region' \
--inputs RegionId=cn-hangzhou Language=zh-CN Timezone=Asia/Shanghai \
--event-mode separate \
--endpoint rdsai.aliyuncs.com \
--user-agent 'AlibabaCloud-Agent-Skills/alibabacloud-rds-copilot'
# Troubleshooting example
aliyun rdsai chat-messages \
--query 'RDS instance rm-bp1xxx connection timeout, error Too many connections, please help troubleshoot. Instance is in Hangzhou region.' \
--inputs RegionId=cn-hangzhou Language=zh-CN Timezone=Asia/Shanghai \
--event-mode separate \
--endpoint rdsai.aliyuncs.com \
--user-agent 'AlibabaCloud-Agent-Skills/alibabacloud-rds-copilot'
# Query with Beijing region
aliyun rdsai chat-messages \
--query 'Optimize this SQL: SELECT * FROM users WHERE name LIKE "%test%"' \
--inputs RegionId=cn-beijing Language=zh-CN Timezone=Asia/Shanghai \
--event-mode separate \
--endpoint rdsai.aliyuncs.com \
--user-agent 'AlibabaCloud-Agent-Skills/alibabacloud-rds-copilot'
# Multi-turn dialogue (using ConversationId from previous response)
aliyun rdsai chat-messages \
--query 'Continue analyzing the above issue' \
--conversation-id '<ConversationId from previous response>' \
--inputs RegionId=cn-hangzhou Language=zh-CN Timezone=Asia/Shanghai \
--event-mode separate \
--endpoint rdsai.aliyuncs.com \
--user-agent 'AlibabaCloud-Agent-Skills/alibabacloud-rds-copilot'
# Using custom Agent
aliyun rdsai chat-messages \
--query 'Analyze database performance' \
--inputs RegionId=cn-hangzhou Language=zh-CN Timezone=Asia/Shanghai CustomAgentId=your-custom-agent-id \
--event-mode separate \
--endpoint rdsai.aliyuncs.com \
--user-agent 'AlibabaCloud-Agent-Skills/alibabacloud-rds-copilot'
DELETE / UPDATE / schema changes)ConversationId from the response for the next queryAfter the workflow is complete, you must disable AI-Mode:
# [MUST] Disable AI-Mode after workflow ends
aliyun configure ai-mode disable
Alibaba Cloud CLI returns JSON format responses (streaming multiple JSON events):
{"data":{"ConversationId":"8227be22-xxxx-xxxx-xxxx-xxxxxxxxxxxx","Event":"workflow_started","MessageId":"a79c881c-xxxx-xxxx-xxxx-xxxxxxxxxxxx",...}}
{"data":{"Answer":"<partial answer content>","Event":"message",...}}
{"data":{"Event":"workflow_finished",...}}
Key fields:
ConversationId: Conversation ID (for multi-turn dialogue)Answer: AI assistant's response contentEvent: Event type (workflow_started, message, workflow_finished)aliyun version shows version numberaliyun configure list shows configured credentialsConversationId and Answer in JSON formatSee references/verification-method.md for detailed verification steps.
This skill only performs read-only query operations, does not create any cloud resources, no cleanup required.
See references/related-apis.md for details.
| Product | API Action | CLI Command | Description |
|---|---|---|---|
| RdsAi | ChatMessages | aliyun rdsai chat-messages | RDS AI Assistant dialogue API |
--conversation-id for context-aware multi-turn conversationsRegionId parameter based on the RDS instance's regionConversationId if you need to follow up or continue analysisaliyun configure to configure credentials, avoid exposing sensitive information in command line--profile| Reference Document | Description |
|---|---|
| Alibaba Cloud CLI Documentation | Alibaba Cloud CLI User Guide |
| references/related-apis.md | API and Command List |
| references/ram-policies.md | RAM Policy Configuration |
| references/verification-method.md | Verification Methods |
| references/acceptance-criteria.md | Acceptance Criteria |