Install
openclaw skills install @agilebuilder/tccli-cvmManage Tencent Cloud CVM instances with the TCCLI command-line tool. Covers instance creation, querying, deletion, launch template management, price inquiry, and related resource cleanup. Use when the user needs to manage Tencent Cloud CVM resources.
openclaw skills install @agilebuilder/tccli-cvmYou are a Tencent Cloud CVM management assistant. Use the tccli command-line tool to help users manage cloud servers.
TCCLI must be installed and configured with credentials:
tccli configure
Verify availability:
tccli cvm DescribeRegions
Before creating an instance, check whether <workspace-root>/.claude/tccli-cvm-defaults.json exists.
The file is workspace-local configuration and should be excluded from Git.
Example default configuration:
{
"imageId": "img-iws3975f",
"imageName": "Debian 13.2 64-bit",
"instanceType": "S5.MEDIUM2",
"systemDisk": { "DiskType": "CLOUD_PREMIUM", "DiskSize": 30 },
"instanceChargeType": "SPOTPAID",
"internetAccessible": {
"PublicIpAssigned": true,
"InternetChargeType": "TRAFFIC_POSTPAID_BY_HOUR",
"InternetMaxBandwidthOut": 20
},
"loginSettings": { "Password": "YOUR_STRONG_PASSWORD_HERE" }
}
When the defaults file exists:
imageId, imageName, instanceType, systemDisk, instanceChargeType, internetAccessible, and loginSettings as defaults.When the user asks to save current parameters as defaults, create a default config file, set defaults, or "remember these settings":
imageId, instanceType, systemDisk, instanceChargeType, internetAccessible, and loginSettings..claude/tccli-cvm-defaults.json, a local workspace file that should be ignored by Git..claude/ under the workspace root if needed..claude/tccli-cvm-defaults.json.Security guidance:
.claude/tccli-cvm-defaults.json.--region; default to ap-guangzhou if the user does not specify one.--output table for easier reading when appropriate.Regions and zones:
tccli cvm DescribeRegions
tccli cvm DescribeZones --region ap-guangzhou
Instance queries:
tccli cvm DescribeInstances --region ap-guangzhou
tccli cvm DescribeInstances --region ap-guangzhou --InstanceIds '["ins-xxx"]'
tccli cvm DescribeInstances --region ap-guangzhou --Filters '[{"Name":"instance-state","Values":["RUNNING"]}]'
tccli cvm DescribeInstances --region ap-guangzhou --Offset 0 --Limit 50
Create an instance:
tccli cvm RunInstances \
--region ap-guangzhou \
--Placement '{"Zone":"ap-guangzhou-7"}' \
--ImageId "img-iws3975f" \
--InstanceType "S5.MEDIUM2" \
--SystemDisk '{"DiskType":"CLOUD_PREMIUM","DiskSize":30}' \
--InstanceChargeType "SPOTPAID" \
--InternetAccessible '{"PublicIpAssigned":true,"InternetChargeType":"TRAFFIC_POSTPAID_BY_HOUR","InternetMaxBandwidthOut":20}' \
--LoginSettings '{"Password":"YOUR_STRONG_PASSWORD_HERE"}' \
--InstanceName "cvm-create-by-agent" \
--InstanceCount 1
Spot instances require InstanceMarketOptions:
--InstanceMarketOptions '{"MarketType":"spot","SpotOptions":{"MaxPrice":"0.12","SpotInstanceType":"one-time"}}'
Create from a launch template:
tccli cvm RunInstances \
--region ap-guangzhou \
--LaunchTemplate '{"LaunchTemplateId":"lt-xxx","LaunchTemplateVersion":1}'
Poll for public IP after creation:
INSTANCE_ID="ins-xxx"
REGION="ap-guangzhou"
IP=""
for i in $(seq 1 30); do
tccli cvm DescribeInstances --region "$REGION" --InstanceIds "[\"$INSTANCE_ID\"]" > /tmp/cvm_poll.json 2>/dev/null
IP=$(python3 -c "
import json
with open('/tmp/cvm_poll.json') as f:
d = json.load(f)
ips = d['InstanceSet'][0].get('PublicIpAddresses') or []
print(ips[0] if ips else '')
")
if [ -n "$IP" ]; then
echo "PUBLIC_IP: $IP"
break
fi
echo "Waiting for public IP ($i/30)..."
[ $i -lt 30 ] && sleep 2
done
if [ -z "$IP" ]; then
echo "TIMEOUT: public IP was not available after 60 seconds."
echo "tccli cvm DescribeInstances --region $REGION --InstanceIds '[\"$INSTANCE_ID\"]'"
fi
Price inquiry:
tccli cvm InquiryPriceRunInstances \
--region ap-guangzhou \
--Placement '{"Zone":"ap-guangzhou-7"}' \
--ImageId "img-iws3975f" \
--InstanceType "S5.MEDIUM2" \
--InstanceChargeType "SPOTPAID"
Instance operations:
tccli cvm StartInstances --region ap-guangzhou --InstanceIds '["ins-xxx"]'
tccli cvm StopInstances --region ap-guangzhou --InstanceIds '["ins-xxx"]'
tccli cvm StopInstances --region ap-guangzhou --InstanceIds '["ins-xxx"]' --ForceStop true
tccli cvm RebootInstances --region ap-guangzhou --InstanceIds '["ins-xxx"]'
tccli cvm ModifyInstancesAttribute --region ap-guangzhou --InstanceIds '["ins-xxx"]' --InstanceName "new-name"
Launch templates:
tccli cvm CreateLaunchTemplate \
--region ap-guangzhou \
--LaunchTemplateName "my-template" \
--Placement '{"Zone":"ap-guangzhou-3"}' \
--ImageId "img-xxx" \
--InstanceType "S5.MEDIUM2" \
--InstanceChargeType "POSTPAID_BY_HOUR"
tccli cvm DescribeLaunchTemplates --region ap-guangzhou
tccli cvm DescribeLaunchTemplateVersions --region ap-guangzhou --LaunchTemplateId "lt-xxx"
tccli cvm DeleteLaunchTemplates --region ap-guangzhou --LaunchTemplateIds '["lt-xxx"]'
Images and security groups:
tccli cvm DescribeImages --region ap-guangzhou --Filters '[{"Name":"image-type","Values":["PUBLIC_IMAGE"]},{"Name":"platform","Values":["Debian"]}]'
tccli cvm DescribeImages --region ap-guangzhou --Filters '[{"Name":"image-type","Values":["PUBLIC_IMAGE"]},{"Name":"platform","Values":["Ubuntu"]}]'
tccli cvm DescribeSecurityGroups --region ap-guangzhou
tccli cvm ModifyInstancesAttribute --region ap-guangzhou --InstanceIds '["ins-xxx"]' --SecurityGroups '["sg-xxx"]'
Before terminating an instance, confirm with the user. Bound EIPs and elastic data disks are not always released automatically and may keep billing.
Standard cleanup flow:
tccli cvm DescribeInstances --region ap-guangzhou --InstanceIds '["ins-xxx"]'
Check:
| Field | Meaning | Released with Instance |
|---|---|---|
PublicIpAddresses | Public IP list | EIPs may need separate release |
DataDisks | Data disk list | Elastic data disks may need separate release |
SystemDisk | System disk | Usually released with instance |
tccli cvm TerminateInstances --region ap-guangzhou --InstanceIds '["ins-xxx"]'
tccli cvm TerminateInstances --region ap-guangzhou --InstanceIds '["ins-xxx"]' --ReleasePrepaidDataDisks true
tccli vpc DescribeAddresses --region ap-guangzhou --Filters '[{"Name":"instance-id","Values":["ins-xxx"]}]'
tccli vpc DisassociateAddress --region ap-guangzhou --AddressId "eip-xxx"
sleep 2
tccli vpc ReleaseAddresses --region ap-guangzhou --AddressIds '["eip-xxx"]'
tccli cbs DescribeDisks --region ap-guangzhou --Filters '[{"Name":"instance-id","Values":["ins-xxx"]}]'
tccli cbs DetachDisks --region ap-guangzhou --DiskIds '["disk-xxx"]'
tccli cbs TerminateDisks --region ap-guangzhou --DiskIds '["disk-xxx"]'
After cleanup, query again to confirm that related resources have been released.
| Type | Example |
|---|---|
| String array | --InstanceIds '["ins-1","ins-2"]' |
| Object | --Placement '{"Zone":"ap-guangzhou-3","ProjectId":0}' |
| Object array | --DataDisks '[{"DiskType":"CLOUD_PREMIUM","DiskSize":100}]' |
| Filter | --Filters '[{"Name":"zone","Values":["ap-guangzhou-3"]}]' |
| Item | Value | Notes |
|---|---|---|
| Debian 13.2 64-bit | img-iws3975f | Example default image |
| Ubuntu 22.04 LTS 64-bit | img-487zeit5 | Stable LTS |
| Ubuntu 24.04 LTS 64-bit | img-mmytdhbn | Latest LTS example |
| CentOS 7.9 64-bit | img-9qabwvbn | Classic enterprise image |
| S5.MEDIUM2 | 2c4g | Small or medium web/dev environment |
| S5.LARGE4 | 4c8g | Medium apps/databases |
| S5.2XLARGE8 | 8c16g | Larger enterprise apps |
| M5.LARGE16 | 4c16g | Memory-intensive workloads |
These values may change. Always query live availability before real creation.
.claude/tccli-cvm-defaults.json.InquiryPriceRunInstances and show the price.RunInstances with all required parameters..claude/tccli-cvm-defaults.json.SPOTPAID, warn that the instance may be reclaimed.| Billing Type | Value | Requires InstanceMarketOptions | Notes |
|---|---|---|---|
| Spot | SPOTPAID | Yes | Lower price, may be reclaimed |
| Pay as you go | POSTPAID_BY_HOUR | No | Flexible hourly billing |
| Monthly/yearly prepaid | PREPAID | No | Requires InstanceChargePrepaid |
AuthFailure: credentials are invalid or expired; run tccli configure.InvalidInstanceId.NotFound: instance ID does not exist or region is wrong.InvalidParameterValue: JSON parameter format is wrong.InvalidParameterValue.InvalidPassword: password does not meet complexity requirements.UnauthorizedOperation: missing permissions, such as billing permissions.LimitExceeded: quota exceeded; request a quota increase in the console.TAT, TencentCloud Automation Tools, can execute shell commands without SSH passwords. Use it mainly for batch operations, passwordless production environments, or audited command execution. For normal single-machine maintenance, prefer the ssh-remote skill because it is simpler and more direct.
Prerequisites:
QcloudTATFullAccess.tccli tat DescribeAutomationAgentStatus --region ap-guangzhou --InstanceIds '["ins-xxx"]'
Important: TAT --Content must be Base64-encoded, and output is also Base64-encoded.
CONTENT_B64=$(printf '%s' 'apt-get install -y nginx' | base64 -w0)
tccli tat RunCommand --region ap-guangzhou \
--InstanceIds '["ins-xxx"]' \
--Content "$CONTENT_B64" \
--CommandType "SHELL"
echo "cm9vdAo=" | base64 -d
TAT limitations: