Alibabacloud Rds Copilot

v0.0.1

Alibaba Cloud RDS Copilot intelligent operations assistant skill. Used for RDS-related intelligent Q&A, SQL optimization, instance operations, and troublesho...

0· 3·0 current·0 all-time
byalibabacloud-skills-team@sdk-team
MIT-0
Download zip
LicenseMIT-0 · Free to use, modify, and redistribute. No attribution required.
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (Alibaba Cloud RDS Copilot assistant) matches the instructions: all runtime actions are CLI calls to rdsai.aliyuncs.com to perform RDS-related Q&A, SQL optimization and troubleshooting. Nothing in the files asks for unrelated cloud providers, host-level secrets, or other services.
Instruction Scope
All runtime instructions are concrete aliyun CLI commands calling the RDS AI ChatMessages API and examples focus on queries/troubleshooting. The skill instructs the user to install the Alibaba Cloud CLI and configure AccessKey/Secret via the CLI profile; it does not instruct reading arbitrary local files. Note: because it uses the CLI, the agent will rely on whatever credentials are configured in the CLI credential chain (profile/default), which is not declared in the registry metadata.
Install Mechanism
This is instruction-only (no code files). Installation guidance points to aliyuncli.alicdn.com (official Alibaba distribution), and Homebrew, which are expected. As always, curl | bash install scripts carry typical supply-chain risk, but the URLs are official Alibaba domains.
Credentials
The skill requires Alibaba Cloud credentials (AccessKey/Secret) to be configured in the Alibaba Cloud CLI profile. That is proportionate to the stated purpose. However the registry metadata lists no primary credential or required env vars; instead credentials are implicit via the CLI config. Users should be aware the skill will use whatever IAM credentials the CLI profile provides.
Persistence & Privilege
Skill is not always:true and is user-invocable. It does not request persistent system-wide changes or access to other skills. Autonomous invocation is allowed (platform default); combined with configured CLI credentials this means the agent could make API calls under those credentials when invoked.
Assessment
This skill is coherent for its stated purpose, but before installing: 1) Install the Alibaba Cloud CLI from official sources and verify the URL. 2) Create a dedicated RAM user with the minimal permissions (rdsai:ChatMessages and only other RDS actions if you intend to let it perform them); do NOT use root account keys. 3) Configure credentials into a limited CLI profile (e.g., rdsai) and confirm with aliyun configure list. 4) Be aware the skill will use whatever credentials exist in the configured CLI profile — restrict/rotate those keys and review audit logs. 5) Avoid pasting sensitive secrets into chat; review and test commands offline before allowing autonomous agent runs. If you need stronger assurance, ask the publisher for provenance (homepage/source) and a signed/verified distribution.

Like a lobster shell, security has layers — review code before you run it.

latestvk979b4202rw2kab9jad3fzy749845cvx

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

Alibaba Cloud RDS Copilot Intelligent Operations Assistant

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

Scenario Description

Architecture: Alibaba Cloud CLI + RdsAi OpenAPI

Main features:

  • Understand user's natural language requests (Chinese or English), identify if related to RDS Copilot
  • Directly call Alibaba Cloud CLI to execute aliyun rdsai chat-messages command for real-time RDS Copilot queries
  • When receiving results or user-pasted error messages, further explain, diagnose, and provide recommendations

Installation

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

macOS Installation

# 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)"

Linux Installation

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

Verify Installation

aliyun version

Credential Configuration

Option 1: Interactive Configuration (Recommended)

aliyun configure --profile rdsai

Follow the prompts to enter:

  • Access Key Id: Your AccessKey ID
  • Access Key Secret: Your AccessKey Secret
  • Default Region Id: cn-hangzhou (or other regions)

Option 2: Non-interactive Configuration

aliyun configure set \
  --profile rdsai \
  --mode AK \
  --access-key-id <yourAccessKeyID> \
  --access-key-secret <yourAccessKeySecret> \
  --region cn-hangzhou

Command Format

Basic Command Structure

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' \
  [--conversation-id '<conversation ID>']

Parameter Description

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

ParameterRequired/OptionalDescriptionDefault
--queryRequiredUser query content-
--inputs RegionId=OptionalAlibaba Cloud region IDcn-hangzhou
--inputs Language=OptionalLanguagezh-CN
--inputs Timezone=OptionalTimezoneAsia/Shanghai
--inputs CustomAgentId=OptionalCustom Agent IDNone
--event-modeOptionalEvent modeseparate
--endpointRequiredAPI endpointrdsai.aliyuncs.com
--conversation-idOptionalConversation ID for multi-turn dialogueNone
--regionOptionalRegion for API callCredential default region
--profileOptionalSpecify credential profile nameDefault profile
--user-agentRequiredCustom User-AgentAlibabaCloud-Agent-Skills

RAM Permissions

This skill requires the following RAM permissions. See references/ram-policies.md for details.

PermissionDescription
rdsai:ChatMessagesCall RDS AI Assistant API

Core Workflow

1. Confirm Task Type and Parameters

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)

2. Construct Command and Call CLI

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

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

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

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

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

3. Parse Results and Follow-up Processing

  • Explain RDS Copilot's response to the user in natural language
  • If the response contains SQL or operational steps, assess risks and warn:
    • Avoid executing high-risk statements directly in production (e.g., large table DELETE / UPDATE / schema changes)
    • Recommend validating in test environment or adding backup/condition restrictions
  • If continuing the conversation, record the ConversationId from the response for the next query

Output Format

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 content
  • Event: Event type (workflow_started, message, workflow_finished)

Success Verification

  1. CLI installation successful: aliyun version shows version number
  2. Credential configured correctly: aliyun configure list shows configured credentials
  3. API call successful: Response contains ConversationId and Answer in JSON format
  4. Response content valid: Answer is relevant to the query content

See references/verification-method.md for detailed verification steps.


Cleanup

This skill only performs read-only query operations, does not create any cloud resources, no cleanup required.


API and Command List

See references/related-apis.md for details.

ProductAPI ActionCLI CommandDescription
RdsAiChatMessagesaliyun rdsai chat-messagesRDS AI Assistant dialogue API

Best Practices

  1. Use multi-turn dialogue: For complex issues, use --conversation-id for context-aware multi-turn conversations
  2. Specify correct region: Set RegionId parameter based on the RDS instance's region
  3. Be cautious in production: SQL recommendations from RDS Copilot should be validated in test environment first
  4. Save conversation ID: Save the returned ConversationId if you need to follow up or continue analysis
  5. Use configuration file: Recommend using aliyun configure to configure credentials, avoid exposing sensitive information in command line
  6. Use --profile: You can configure multiple credential profiles and switch between accounts using --profile

Reference Links

Reference DocumentDescription
Alibaba Cloud CLI DocumentationAlibaba Cloud CLI User Guide
references/related-apis.mdAPI and Command List
references/ram-policies.mdRAM Policy Configuration
references/verification-method.mdVerification Methods
references/acceptance-criteria.mdAcceptance Criteria

Files

5 total
Select a file
Select a file to preview.

Comments

Loading comments…