[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E5KN9223Y76DRC5YF98MB2":3,"skill-same:01M7E5KN9223Y76DRC5YF98MB2":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":14,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":34,"ownerDescription":35,"updatedAt":36,"install":37,"resources":50},"01M7E5KN9223Y76DRC5YF98MB2","alibabacloud-workbench-cli",null,"Agent-native CLI for managing ECS instances without public IPs, primarily for single-instance operations. It supports millisecond-level remote command execution, large file transfers up to 1GB, and TCP port forwarding. It offers four authentication modes: AK, RamRoleArn, CredentialsCmd, and CredentialsURI. Use it to run commands, deploy code, view logs, check processes, transfer files, set up port forwarding, or query and filter ECS instance lists.","Jane-o-O-o-O\u002Fpersonal-agent","Jane-o-O-o-O","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F179437561?v=4","01M7E4A2T6D0QNC04YPW4P0E9F","Jin Zhangzheng","01M7E4A2TRHBYJEQJM6FZKKZ1X",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FJane-o-O-o-O\u002Fpersonal-agent\u002Fblob\u002Fmain\u002Fresources\u002Fecosystem\u002Fupstream\u002Faliyun-aiops-skills\u002Fd22aa735c7e5\u002Fskills\u002Fdevelopertools\u002Fsolutions\u002Falibabacloud-workbench-cli\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: alibabacloud-workbench-cli\ndescription: |\n  Agent-native CLI for managing ECS instances without public IPs, primarily for single-instance operations. It supports millisecond-level remote command execution, large file transfers up to 1GB, and TCP port forwarding. It offers four authentication modes: AK, RamRoleArn, CredentialsCmd, and CredentialsURI. Use it to run commands, deploy code, view logs, check processes, transfer files, set up port forwarding, or query and filter ECS instance lists.\nlicense: Apache-2.0\nmetadata:\n  domain: cloud-infrastructure\ncompatibility: Requires workbench CLI binary installed. Cross-platform Linux\u002FmacOS (amd64\u002Farm64), Windows (amd64). Network access to *.aliyuncs.com and Workbench backend WebSocket endpoints required.\nallowed-tools: Bash\n---\n\n# Workbench CLI Expert\n\nHelp users operate Alibaba Cloud ECS instances — especially those **without public IP addresses** — using the `workbench` command-line tool. Core capabilities for Agent workflows: millisecond-level remote command execution (`exec`), file transfer up to 1GB (`upload`\u002F`download`), and port forwarding. This skill covers: install → configure credentials → exec\u002Ftransfer\u002Fforward → manage sessions → troubleshoot errors.\n\n## Instructions\n\n### 1. Install the Workbench CLI\n\n**Pre-check:**\n\n```bash\nworkbench version     # Should print version, commit, build date\n```\n\n**Linux \u002F macOS:**\n\n```bash\ncurl -fsSL https:\u002F\u002Fworkbench-cli.oss-cn-hangzhou.aliyuncs.com\u002Finstall.sh | bash\n```\n\n**Windows (PowerShell):**\n\n```powershell\nirm https:\u002F\u002Fworkbench-cli.oss-cn-hangzhou.aliyuncs.com\u002Finstall.ps1 | iex\n```\n\n**Upgrade:**\n\n```bash\nworkbench upgrade                        # Upgrade to latest\nworkbench upgrade --version 0.2.0        # Upgrade to specific version\n```\n\n### 2. Configure credentials\n\nCredentials are stored in `~\u002F.workbench\u002Fconfig.json` with `0600` permissions. As an Agent, write this file directly instead of using the interactive `workbench config` command.\n\n```bash\n# Create config directory\nmkdir -p ~\u002F.workbench\n\n# Write config file (example: AK mode)\ncat > ~\u002F.workbench\u002Fconfig.json \u003C\u003C 'EOF'\n{\n  \"current\": \"default\",\n  \"profiles\": {\n    \"default\": {\n      \"mode\": \"AK\",\n      \"access_key_id\": \"\u003CAccessKeyID>\",\n      \"access_key_secret\": \"\u003CAccessKeySecret>\"\n    }\n  }\n}\nEOF\n\n# Set secure permissions\nchmod 600 ~\u002F.workbench\u002Fconfig.json\n```\n\n**Config file schema by mode:**\n\nAK mode:\n```json\n{\n  \"current\": \"default\",\n  \"profiles\": {\n    \"default\": {\n      \"mode\": \"AK\",\n      \"access_key_id\": \"LTAI...\",\n      \"access_key_secret\": \"...\"\n    }\n  }\n}\n```\n\nRamRoleArn mode (auto-refreshes STS tokens):\n```json\n{\n  \"current\": \"default\",\n  \"profiles\": {\n    \"default\": {\n      \"mode\": \"RamRoleArn\",\n      \"access_key_id\": \"LTAI...\",\n      \"access_key_secret\": \"...\",\n      \"ram_role_arn\": \"acs:ram::123456789:role\u002FWorkbenchRole\",\n      \"role_session_name\": \"workbench-session\"\n    }\n  }\n}\n```\n\nCredentialsURI mode (HTTP endpoint returns credentials):\n```json\n{\n  \"current\": \"default\",\n  \"profiles\": {\n    \"default\": {\n      \"mode\": \"CredentialsURI\",\n      \"credentials_uri\": \"http:\u002F\u002Flocalhost:8080\u002Fcredentials\"\n    }\n  }\n}\n```\n\n| Mode | When to use |\n| --- | --- |\n| **AK** (default) | Development, long-lived credentials |\n| **StsToken** | Temporary security credentials (AccessKey + STS Token) |\n| **RamRoleArn** | Production, cross-account, least-privilege via STS role assumption (auto-refreshes tokens) |\n| **CredentialsCmd** | Zero-trust \u002F Vault integration — external command outputs credential JSON |\n| **CredentialsURI** | Metadata service \u002F sidecar — HTTP endpoint returns credential JSON |\n\n**Profile management (non-interactive):**\n\n```bash\nworkbench config list                     # List all profiles (* marks active)\nworkbench config switch --profile prod    # Switch active profile\nworkbench config get                      # Show current profile details (JSON)\nworkbench config get --profile prod       # Show specific profile details\nworkbench config delete --profile old     # Delete a profile (cannot delete active)\n```\n\n### 3. Command reference\n\n```\nworkbench\n├── exec             # Execute remote command (non-interactive, millisecond-level)\n├── upload           # Upload local file to instance (up to 1GB, via OSS relay)\n├── download         # Download file from instance (up to 1GB, via OSS relay)\n├── list             # List ECS instances\n├── session          # Session management (list \u002F close)\n├── daemon           # Daemon lifecycle (start \u002F status \u002F stop)\n├── config           # Credential configuration & profile management\n│   ├── set          # Set a single config field\n│   ├── list         # List all profiles\n│   ├── switch       # Switch active profile\n│   ├── get          # Show profile details\n│   └── delete       # Delete a profile\n├── upgrade          # Self-update\n└── version          # Print version info\n```\n\n**Global flags:**\n\n| Flag | Purpose | Default |\n| --- | --- | --- |\n| `--output` \u002F `-o` | Output format: `text|json` | `text` |\n| `--region` \u002F `-r` | Alibaba Cloud region (e.g., `cn-hangzhou`) | auto-inferred from instance ID prefix |\n| `--profile` \u002F `-P` | Use a specific profile (overrides active profile) | current active profile |\n\n### 4. List instances\n\n```bash\nworkbench list ecs --region cn-hangzhou\nworkbench list ecs --region cn-hangzhou --status Running\nworkbench list ecs --region cn-hangzhou --tag env=prod --tag team=infra\nworkbench list ecs --region cn-hangzhou --instance-type ecs.g7.large\nworkbench list ecs --region cn-hangzhou --instance-name my-instance\nworkbench list ecs --region cn-hangzhou --image-id ubuntu_22_04_x64_20G_alibase_20230907.vhd\nworkbench list ecs --region cn-hangzhou --output json\n```\n\n`--region` is **required** for `list ecs`. Filters: `--status` (Running|Stopped|Starting|Stopping), `--tag` (key=value or key, repeatable, AND logic), `--instance-type` (e.g. ecs.g7.large), `--instance-name` (supports wildcards `*`), `--image-id`, `--vpc-id`, `--zone-id`, `--vswitch-id`, `--private-ip` (comma-separated), `--limit` (1-100, default 50), `--next-token` (pagination).\n\nJSON output schema:\n\n```json\n[{\n  \"instance_id\": \"i-bp1xxxxx\",\n  \"instance_name\": \"web-prod-01\",\n  \"instance_type\": \"ecs.g7.large\",\n  \"region_id\": \"cn-hangzhou\",\n  \"status\": \"Running\",\n  \"private_ip\": \"172.16.0.10\",\n  \"public_ip\": \"\",\n  \"os_type\": \"linux\",\n  \"image_id\": \"ubuntu_22_04_x64_20G_alibase_20230907.vhd\",\n  \"tags\": {\"env\": \"prod\"}\n}]\n```\n\n### 5. Remote command execution\n\n**Built-in safety**: The CLI is a non-interactive executor — it does NOT provide a persistent shell. Each invocation is isolated and stateless, which prevents accidental cascading damage from lingering shell sessions.\n\n**Agent pre-check requirement**: Before executing destructive commands (e.g., `rm -rf`, `shutdown`, `reboot`, `mkfs`, `dd`, service stop\u002Frestart, or any command that deletes data or halts the system), the Agent MUST confirm with the user by describing the intended action, the target instance, and the potential impact. Do NOT execute destructive commands without explicit user approval.\n\n```bash\nworkbench exec --instance-id i-bp1xxxxx --command \"df -h\"\nworkbench exec --instance-id i-bp1xxxxx --command \"sleep 30\" --timeout 10\nworkbench exec --instance-id i-bp1xxxxx --command \"df -h\" --output json\n```\n\n| Flag | Required | Description | Default |\n| --- | --- | --- | --- |\n| `--instance-id` \u002F `-i` | Yes | ECS instance ID | — |\n| `--command` \u002F `-c` | Yes | Command to execute | — |\n| `--timeout` | No | Timeout in seconds | `30` |\n\n**Important**: Each `exec` invocation runs in an independent shell context. State (cd, export) is NOT preserved between calls. Use `&&` or `;` to chain commands that need shared context in a single invocation.\n\nJSON output schema:\n\n```json\n{\n  \"output\": \"Filesystem ...\\n\",\n  \"stderr\": \"\",\n  \"exit_code\": 0\n}\n```\n\n### 6. File transfer\n\n**Built-in safety**: The `upload` command has a built-in overwrite protection. When the remote destination file already exists, the CLI prompts for confirmation before overwriting:\n\n```\nRemote file \"\u002Froot\u002Fid.txt\" already exists (728 B, modified Jul 27 10:42). Overwrite? [y\u002FN]\n```\n\nThe default answer is **No** — if the user does not explicitly confirm, the upload is aborted. This prevents accidental overwriting of existing remote files.\n\n**Agent pre-check requirement**: When using `upload` in automated\u002FAgent workflows where interactive confirmation is not possible, the Agent MUST first check whether the target file exists on the remote instance (e.g., via `workbench exec --command \"ls -la \u003Cpath>\"`) and inform the user if a file will be overwritten.\n\n```bash\nworkbench upload .\u002Fapp.jar \u002Fopt\u002Fapp\u002Fapp.jar --instance-id i-bp1xxxxx\nworkbench download \u002Fvar\u002Flog\u002Fapp.log .\u002F --instance-id i-bp1xxxxx\nworkbench download \u002Fvar\u002Flog\u002Fapp.log \u002Ftmp\u002Flocal-copy.log --instance-id i-bp1xxxxx\n```\n\nTransfer goes through OSS as intermediary — transparent to the user, no OSS configuration needed. `download` second arg (local-path) is optional, defaults to current directory.\n\n### 7. Session management\n\n```bash\nworkbench session list\nworkbench session list --output json\nworkbench session close \u003Csession-id>\nworkbench session close --all\n```\n\n**Session lifecycle**: OPEN → RECONNECTING → BROKEN → CLOSED. Idle timeout 30min → auto CLOSED. Multiple operations on same instance share one session (transparent multiplexing).\n\n### 8. Daemon management\n\n```bash\nworkbench daemon start      # Manual start (usually not needed)\nworkbench daemon status\nworkbench daemon stop       # Closes all sessions\n```\n\n- **Auto-start**: Spawned on first CLI invocation.\n- **Auto-exit**: 60 seconds after last session closes.\n- **Singleton**: One per OS user (PID file lock).\n- **IPC**: JSON-RPC over Unix socket (`~\u002F.workbench\u002Frun\u002Fdaemon.sock`).\n\n### 9. Region inference\n\nThe CLI auto-infers region from the instance ID 3-character prefix (covers 290+ regions). If inference fails, `--region` is required. For `list` command, `--region` is always required.\n\n## Exit Codes\n\n| Code | Constant | Trigger |\n| --- | --- | --- |\n| **0** | `ExitSuccess` | Successful execution |\n| **1** | `ExitGeneral` | Unclassified runtime error (includes instance not found, API errors, etc.) |\n| **2** | `ExitArgument` | Missing, malformed, or invalid flag value |\n| **3** | `ExitSessionNotFound` | Session ID invalid or expired |\n| **4** | `ExitAuth` | Authentication or authorization failed |\n| **5** | `ExitNetwork` | Network timeout, WebSocket exception |\n| **6** | `ExitDaemonUnreach` | Local daemon not running or socket invalid |\n| **7** | `ExitSessionBusy` | Session attached by another TTY |\n| **N** | *(exec only)* | `exec` transparently passes through the remote command's exit code |\n\nError JSON output (on failure with `--output json`):\n\n```json\n{\n  \"code\": 1,\n  \"message\": \"InvalidParameter.InstanceId: the specified instance does not exist\"\n}\n```\n\n## RAM Permissions\n\nMinimum RAM policy required:\n\n```json\n{\n  \"Version\": \"1\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"ecs-workbench:LoginECSInstance\",\n        \"ecs-workbench:ChatMessages\"\n      ],\n      \"Resource\": \"*\"\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"ecs:DescribeInstances\",\n        \"ecs:DescribeCloudAssistantStatus\",\n        \"ecs:StartTerminalSession\"\n      ],\n      \"Resource\": \"*\"\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": \"ram:CreateServiceLinkedRole\",\n      \"Resource\": \"*\",\n      \"Condition\": {\n        \"StringEquals\": {\n          \"ram:ServiceName\": \"workbench.ecs.aliyuncs.com\"\n        }\n      }\n    }\n  ]\n}\n```\n\nRestrict to specific instances: replace `\"Resource\": \"*\"` in each statement with the corresponding format:\n- ecs-workbench:LoginECSInstance : `acs:ecs:\u003Cregion>:\u003Caccount-id>:ecs\u002F\u003Cinstance-id>`\n- ecs actions: `acs:ecs:\u003Cregion>:\u003Caccount-id>:instance\u002F\u003Cinstance-id>`\n\n## Troubleshooting\n\n| Error message pattern | Exit Code | First Action |\n| --- | --- | --- |\n| `InvalidAccessKeyId` \u002F authentication errors | 4 | Verify AK\u002FSK in `~\u002F.workbench\u002Fconfig.json`. Re-run `workbench config`. |\n| `profile not found` | 1 | Check profile name with `workbench config list`. |\n| `not found in \u003Cregion>` \u002F instance not found | 1 | Verify instance ID and region. Use `workbench list --region \u003Cregion>` to confirm. |\n| Network timeout \u002F WebSocket errors | 5 | Check network connectivity to `*.aliyuncs.com`. Verify security group rules. |\n| Session busy \u002F attach errors | 7 | Another terminal is attached. Close it first, or use `workbench session close \u003Cid>`. |\n| `cannot start daemon` \u002F socket errors | 6 | Run `workbench daemon status`. If stopped, any command will auto-restart it. |\n| Permission denied (RAM) | 4 | Attach the RAM policy from `## RAM Permissions` to the user or role. |\n| `insecure permissions` | 2 | Run `chmod 600 ~\u002F.workbench\u002Fconfig.json`. |\n| STS token expired | 4 | If using `RamRoleArn` mode, the CLI auto-refreshes. If using static STS, update the token. |\n","# Workbench CLI Expert\n\nHelp users operate Alibaba Cloud ECS instances — especially those **without public IP addresses** — using the `workbench` command-line tool. Core capabilities for Agent workflows: millisecond-level remote command execution (`exec`), file transfer up to 1GB (`upload`\u002F`download`), and port forwarding. This skill covers: install → configure credentials → exec\u002Ftransfer\u002Fforward → manage sessions → troubleshoot errors.\n\n## Instructions\n\n### 1. Install the Workbench CLI\n\n**Pre-check:**\n\n```bash\nworkbench version     # Should print version, commit, build date\n```\n\n**Linux \u002F macOS:**\n\n```bash\ncurl -fsSL https:\u002F\u002Fworkbench-cli.oss-cn-hangzhou.aliyuncs.com\u002Finstall.sh | bash\n```\n\n**Windows (PowerShell):**\n\n```powershell\nirm https:\u002F\u002Fworkbench-cli.oss-cn-hangzhou.aliyuncs.com\u002Finstall.ps1 | iex\n```\n\n**Upgrade:**\n\n```bash\nworkbench upgrade                        # Upgrade to latest\nworkbench upgrade --version 0.2.0        # Upgrade to specific version\n```\n\n### 2. Configure credentials\n\nCredentials are stored in `~\u002F.workbench\u002Fconfig.json` with `0600` permissions. As an Agent, write this file directly instead of using the interactive `workbench config` command.\n\n```bash\n# Create config directory\nmkdir -p ~\u002F.workbench\n\n# Write config file (example: AK mode)\ncat > ~\u002F.workbench\u002Fconfig.json \u003C\u003C 'EOF'\n{\n  \"current\": \"default\",\n  \"profiles\": {\n    \"default\": {\n      \"mode\": \"AK\",\n      \"access_key_id\": \"\u003CAccessKeyID>\",\n      \"access_key_secret\": \"\u003CAccessKeySecret>\"\n    }\n  }\n}\nEOF\n\n# Set secure permissions\nchmod 600 ~\u002F.workbench\u002Fconfig.json\n```\n\n**Config file schema by mode:**\n\nAK mode:\n```json\n{\n  \"current\": \"default\",\n  \"profiles\": {\n    \"default\": {\n      \"mode\": \"AK\",\n      \"access_key_id\": \"LTAI...\",\n      \"access_key_secret\": \"...\"\n    }\n  }\n}\n```\n\nRamRoleArn mode (auto-refreshes STS tokens):\n```json\n{\n  \"current\": \"default\",\n  \"profiles\": {\n    \"default\": {\n      \"mode\": \"RamRoleArn\",\n      \"access_key_id\": \"LTAI...\",\n      \"access_key_secret\": \"...\",\n      \"ram_role_arn\": \"acs:ram::123456789:role\u002FWorkbenchRole\",\n      \"role_session_name\": \"workbench-session\"\n    }\n  }\n}\n```\n\nCredentialsURI mode (HTTP endpoint returns credentials):\n```json\n{\n  \"current\": \"default\",\n  \"profiles\": {\n    \"default\": {\n      \"mode\": \"CredentialsURI\",\n      \"credentials_uri\": \"http:\u002F\u002Flocalhost:8080\u002Fcredentials\"\n    }\n  }\n}\n```\n\n| Mode | When to use |\n| --- | --- |\n| **AK** (default) | Development, long-lived credentials |\n| **StsToken** | Temporary security credentials (AccessKey + STS Token) |\n| **RamRoleArn** | Production, cross-account, least-privilege via STS role assumption (auto-refreshes tokens) |\n| **CredentialsCmd** | Zero-trust \u002F Vault integration — external command outputs credential JSON |\n| **CredentialsURI** | Metadata service \u002F sidecar — HTTP endpoint returns credential JSON |\n\n**Profile management (non-interactive):**\n\n```bash\nworkbench config list                     # List all profiles (* marks active)\nworkbench config switch --profile prod    # Switch active profile\nworkbench config get                      # Show current profile details (JSON)\nworkbench config get --profile prod       # Show specific profile details\nworkbench config delete --profile old     # Delete a profile (cannot delete active)\n```\n\n### 3. Command reference\n\n```\nworkbench\n├── exec             # Execute remote command (non-interactive, millisecond-level)\n├── upload           # Upload local file to instance (up to 1GB, via OSS relay)\n├── download         # Download file from instance (up to 1GB, via OSS relay)\n├── list             # List ECS instances\n├── session          # Session management (list \u002F close)\n├── daemon           # Daemon lifecycle (start \u002F status \u002F stop)\n├── config           # Credential configuration & profile management\n│   ├── set          # Set a single config field\n│   ├── list         # List all profiles\n│   ├── switch       # Switch active profile\n│   ├── get          # Show profile details\n│   └── delete       # Delete a profile\n├── upgrade          # Self-update\n└── version          # Print version info\n```\n\n**Global flags:**\n\n| Flag | Purpose | Default |\n| --- | --- | --- |\n| `--output` \u002F `-o` | Output format: `text|json` | `text` |\n| `--region` \u002F `-r` | Alibaba Cloud region (e.g., `cn-hangzhou`) | auto-inferred from instance ID prefix |\n| `--profile` \u002F `-P` | Use a specific profile (overrides active profile) | current active profile |\n\n### 4. List instances\n\n```bash\nworkbench list ecs --region cn-hangzhou\nworkbench list ecs --region cn-hangzhou --status Running\nworkbench list ecs --region cn-hangzhou --tag env=prod --tag team=infra\nworkbench list ecs --region cn-hangzhou --instance-type ecs.g7.large\nworkbench list ecs --region cn-hangzhou --instance-name my-instance\nworkbench list ecs --region cn-hangzhou --image-id ubuntu_22_04_x64_20G_alibase_20230907.vhd\nworkbench list ecs --region cn-hangzhou --output json\n```\n\n`--region` is **required** for `list ecs`. Filters: `--status` (Running|Stopped|Starting|Stopping), `--tag` (key=value or key, repeatable, AND logic), `--instance-type` (e.g. ecs.g7.large), `--instance-name` (supports wildcards `*`), `--image-id`, `--vpc-id`, `--zone-id`, `--vswitch-id`, `--private-ip` (comma-separated), `--limit` (1-100, default 50), `--next-token` (pagination).\n\nJSON output schema:\n\n```json\n[{\n  \"instance_id\": \"i-bp1xxxxx\",\n  \"instance_name\": \"web-prod-01\",\n  \"instance_type\": \"ecs.g7.large\",\n  \"region_id\": \"cn-hangzhou\",\n  \"status\": \"Running\",\n  \"private_ip\": \"172.16.0.10\",\n  \"public_ip\": \"\",\n  \"os_type\": \"linux\",\n  \"image_id\": \"ubuntu_22_04_x64_20G_alibase_20230907.vhd\",\n  \"tags\": {\"env\": \"prod\"}\n}]\n```\n\n### 5. Remote command execution\n\n**Built-in safety**: The CLI is a non-interactive executor — it does NOT provide a persistent shell. Each invocation is isolated and stateless, which prevents accidental cascading damage from lingering shell sessions.\n\n**Agent pre-check requirement**: Before executing destructive commands (e.g., `rm -rf`, `shutdown`, `reboot`, `mkfs`, `dd`, service stop\u002Frestart, or any command that deletes data or halts the system), the Agent MUST confirm with the user by describing the intended action, the target instance, and the potential impact. Do NOT execute destructive commands without explicit user approval.\n\n```bash\nworkbench exec --instance-id i-bp1xxxxx --command \"df -h\"\nworkbench exec --instance-id i-bp1xxxxx --command \"sleep 30\" --timeout 10\nworkbench exec --instance-id i-bp1xxxxx --command \"df -h\" --output json\n```\n\n| Flag | Required | Description | Default |\n| --- | --- | --- | --- |\n| `--instance-id` \u002F `-i` | Yes | ECS instance ID | — |\n| `--command` \u002F `-c` | Yes | Command to execute | — |\n| `--timeout` | No | Timeout in seconds | `30` |\n\n**Important**: Each `exec` invocation runs in an independent shell context. State (cd, export) is NOT preserved between calls. Use `&&` or `;` to chain commands that need shared context in a single invocation.\n\nJSON output schema:\n\n```json\n{\n  \"output\": \"Filesystem ...\\n\",\n  \"stderr\": \"\",\n  \"exit_code\": 0\n}\n```\n\n### 6. File transfer\n\n**Built-in safety**: The `upload` command has a built-in overwrite protection. When the remote destination file already exists, the CLI prompts for confirmation before overwriting:\n\n```\nRemote file \"\u002Froot\u002Fid.txt\" already exists (728 B, modified Jul 27 10:42). Overwrite? [y\u002FN]\n```\n\nThe default answer is **No** — if the user does not explicitly confirm, the upload is aborted. This prevents accidental overwriting of existing remote files.\n\n**Agent pre-check requirement**: When using `upload` in automated\u002FAgent workflows where interactive confirmation is not possible, the Agent MUST first check whether the target file exists on the remote instance (e.g., via `workbench exec --command \"ls -la \u003Cpath>\"`) and inform the user if a file will be overwritten.\n\n```bash\nworkbench upload .\u002Fapp.jar \u002Fopt\u002Fapp\u002Fapp.jar --instance-id i-bp1xxxxx\nworkbench download \u002Fvar\u002Flog\u002Fapp.log .\u002F --instance-id i-bp1xxxxx\nworkbench download \u002Fvar\u002Flog\u002Fapp.log \u002Ftmp\u002Flocal-copy.log --instance-id i-bp1xxxxx\n```\n\nTransfer goes through OSS as intermediary — transparent to the user, no OSS configuration needed. `download` second arg (local-path) is optional, defaults to current directory.\n\n### 7. Session management\n\n```bash\nworkbench session list\nworkbench session list --output json\nworkbench session close \u003Csession-id>\nworkbench session close --all\n```\n\n**Session lifecycle**: OPEN → RECONNECTING → BROKEN → CLOSED. Idle timeout 30min → auto CLOSED. Multiple operations on same instance share one session (transparent multiplexing).\n\n### 8. Daemon management\n\n```bash\nworkbench daemon start      # Manual start (usually not needed)\nworkbench daemon status\nworkbench daemon stop       # Closes all sessions\n```\n\n- **Auto-start**: Spawned on first CLI invocation.\n- **Auto-exit**: 60 seconds after last session closes.\n- **Singleton**: One per OS user (PID file lock).\n- **IPC**: JSON-RPC over Unix socket (`~\u002F.workbench\u002Frun\u002Fdaemon.sock`).\n\n### 9. Region inference\n\nThe CLI auto-infers region from the instance ID 3-character prefix (covers 290+ regions). If inference fails, `--region` is required. For `list` command, `--region` is always required.\n\n## Exit Codes\n\n| Code | Constant | Trigger |\n| --- | --- | --- |\n| **0** | `ExitSuccess` | Successful execution |\n| **1** | `ExitGeneral` | Unclassified runtime error (includes instance not found, API errors, etc.) |\n| **2** | `ExitArgument` | Missing, malformed, or invalid flag value |\n| **3** | `ExitSessionNotFound` | Session ID invalid or expired |\n| **4** | `ExitAuth` | Authentication or authorization failed |\n| **5** | `ExitNetwork` | Network timeout, WebSocket exception |\n| **6** | `ExitDaemonUnreach` | Local daemon not running or socket invalid |\n| **7** | `ExitSessionBusy` | Session attached by another TTY |\n| **N** | *(exec only)* | `exec` transparently passes through the remote command's exit code |\n\nError JSON output (on failure with `--output json`):\n\n```json\n{\n  \"code\": 1,\n  \"message\": \"InvalidParameter.InstanceId: the specified instance does not exist\"\n}\n```\n\n## RAM Permissions\n\nMinimum RAM policy required:\n\n```json\n{\n  \"Version\": \"1\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"ecs-workbench:LoginECSInstance\",\n        \"ecs-workbench:ChatMessages\"\n      ],\n      \"Resource\": \"*\"\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"ecs:DescribeInstances\",\n        \"ecs:DescribeCloudAssistantStatus\",\n        \"ecs:StartTerminalSession\"\n      ],\n      \"Resource\": \"*\"\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": \"ram:CreateServiceLinkedRole\",\n      \"Resource\": \"*\",\n      \"Condition\": {\n        \"StringEquals\": {\n          \"ram:ServiceName\": \"workbench.ecs.aliyuncs.com\"\n        }\n      }\n    }\n  ]\n}\n```\n\nRestrict to specific instances: replace `\"Resource\": \"*\"` in each statement with the corresponding format:\n- ecs-workbench:LoginECSInstance : `acs:ecs:\u003Cregion>:\u003Caccount-id>:ecs\u002F\u003Cinstance-id>`\n- ecs actions: `acs:ecs:\u003Cregion>:\u003Caccount-id>:instance\u002F\u003Cinstance-id>`\n\n## Troubleshooting\n\n| Error message pattern | Exit Code | First Action |\n| --- | --- | --- |\n| `InvalidAccessKeyId` \u002F authentication errors | 4 | Verify AK\u002FSK in `~\u002F.workbench\u002Fconfig.json`. Re-run `workbench config`. |\n| `profile not found` | 1 | Check profile name with `workbench config list`. |\n| `not found in \u003Cregion>` \u002F instance not found | 1 | Verify instance ID and region. Use `workbench list --region \u003Cregion>` to confirm. |\n| Network timeout \u002F WebSocket errors | 5 | Check network connectivity to `*.aliyuncs.com`. Verify security group rules. |\n| Session busy \u002F attach errors | 7 | Another terminal is attached. Close it first, or use `workbench session close \u003Cid>`. |\n| `cannot start daemon` \u002F socket errors | 6 | Run `workbench daemon status`. If stopped, any command will auto-restart it. |\n| Permission denied (RAM) | 4 | Attach the RAM policy from `## RAM Permissions` to the user or role. |\n| `insecure permissions` | 2 | Run `chmod 600 ~\u002F.workbench\u002Fconfig.json`. |\n| STS token expired | 4 | If using `RamRoleArn` mode, the CLI auto-refreshes. If using static STS, update the token. |\n",{"name":5,"license":15,"metadata":24,"description":26,"allowed-tools":27,"compatibility":28},{"domain":25},"cloud-infrastructure","Agent-native CLI for managing ECS instances without public IPs, primarily for single-instance operations. It supports millisecond-level remote command execution, large file transfers up to 1GB, and TCP port forwarding. It offers four authentication modes: AK, RamRoleArn, CredentialsCmd, and CredentialsURI. Use it to run commands, deploy code, view logs, check processes, transfer files, set up port forwarding, or query and filter ECS instance lists.\n","Bash","Requires workbench CLI binary installed. Cross-platform Linux\u002FmacOS (amd64\u002Farm64), Windows (amd64). Network access to *.aliyuncs.com and Workbench backend WebSocket endpoints required.","main","b08d387cde83fdd23ca4a75f0a74173f810967ec","resources\u002Fecosystem\u002Fupstream\u002Faliyun-aiops-skills\u002Fd22aa735c7e5\u002Fskills\u002Fdevelopertools\u002Fsolutions\u002Falibabacloud-workbench-cli","https:\u002F\u002Fgithub.com\u002FJane-o-O-o-O\u002Fpersonal-agent","https:\u002F\u002Fgithub.com\u002FJane-o-O-o-O","https:\u002F\u002Fjane-zz.me\u002F","金张政 Jane-zz | Agent Engineer · AI Native Builder | Runtime · Context · Evals · GraphRAG | 官方作品集 jane-zz.me","2026-10-04 16:27:52",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add Jane-o-O-o-O\u002Fpersonal-agent --skill alibabacloud-workbench-cli",{"tool":43,"command":44},"bunx","bunx skills add Jane-o-O-o-O\u002Fpersonal-agent --skill alibabacloud-workbench-cli",{"tool":46,"command":47},"pnpm","pnpm dlx skills add Jane-o-O-o-O\u002Fpersonal-agent --skill alibabacloud-workbench-cli","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJane-o-O-o-O\u002Fpersonal-agent\u002Fblob\u002Fmain\u002Fresources\u002Fecosystem\u002Fupstream\u002Faliyun-aiops-skills\u002Fd22aa735c7e5\u002Fskills\u002Fdevelopertools\u002Fsolutions\u002Falibabacloud-workbench-cli\u002FSKILL.md",true,[51],{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fram-policies.md","REFERENCE","参考文档",1550,"https:\u002F\u002Fgithub.com\u002FJane-o-O-o-O\u002Fpersonal-agent\u002Fblob\u002Fmain\u002Fresources\u002Fecosystem\u002Fupstream\u002Faliyun-aiops-skills\u002Fd22aa735c7e5\u002Fskills\u002Fdevelopertools\u002Fsolutions\u002Falibabacloud-workbench-cli\u002Freferences\u002Fram-policies.md",[58,66,73,80,87,94],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":62,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7EA3ZT5SZYH1DMJ9XHGK0JK","style-extract","Analyze Yuque documents to extract vocabulary, sentence, and tone patterns into a reusable writing-style profile. Use when the user wants to understand or reproduce their voice or keep documents consistent; trigger phrases include “分析一下我的写作风格”, “用我的风格写一篇...”, “帮我生成一个风格画像”, “extract my writing style”, and “write like me”.","MIT","https:\u002F\u002Fgithub.com\u002FJane-o-O-o-O\u002Fpersonal-agent\u002Fblob\u002Fmain\u002Fresources\u002Fecosystem\u002Fupstream\u002Fyuque-skills\u002F2959228ad3e8\u002Fskills\u002Fstyle-extract\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":62,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7EA3TK8GT3V1E166QX3B0G0","stale-detector","Scan a Yuque knowledge base for stale or outdated documents and recommend updates or archiving. Use when the user is cleaning up, maintaining, or periodically reviewing a knowledge base; trigger phrases include “帮我检查哪些文档过期了”, “知识库体检”, and “find stale docs”.","https:\u002F\u002Fgithub.com\u002FJane-o-O-o-O\u002Fpersonal-agent\u002Fblob\u002Fmain\u002Fresources\u002Fecosystem\u002Fupstream\u002Fyuque-skills\u002F2959228ad3e8\u002Fskills\u002Fstale-detector\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":62,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7EA3PEWR596VVPAN0XW3ZFR","smart-summary","Summarize a Yuque document or knowledge base at one-line, key-point, or detailed granularity. Use when the user wants a quick overview of a document or repo; trigger phrases include “帮我总结一下这篇文档”, “这个知识库讲了什么”, and “summarize this doc”.","https:\u002F\u002Fgithub.com\u002FJane-o-O-o-O\u002Fpersonal-agent\u002Fblob\u002Fmain\u002Fresources\u002Fecosystem\u002Fupstream\u002Fyuque-skills\u002F2959228ad3e8\u002Fskills\u002Fsmart-summary\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":62,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7EA3JCBX7BVSSF0TEZXDJ47","smart-search","Search personal Yuque knowledge bases with natural-language queries and synthesize answers with source links. Use when the user wants to find information in their own documents; trigger phrases include “搜一下我的文档”, “我的知识库里有没有...”, “搜索我的语雀\u002F知识库”, and “search my Yuque”.","https:\u002F\u002Fgithub.com\u002FJane-o-O-o-O\u002Fpersonal-agent\u002Fblob\u002Fmain\u002Fresources\u002Fecosystem\u002Fupstream\u002Fyuque-skills\u002F2959228ad3e8\u002Fskills\u002Fsmart-search\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":62,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7EA3DDETPJYVCDHAXFBRRG6","reading-digest","Extract core insights, golden quotes, and action items from articles, then create structured Yuque reading notes. Use when the user wants key takeaways or a personal reading-notes base; trigger phrases include “帮我做阅读笔记”, “读书笔记”, and “extract key points from this article”.","https:\u002F\u002Fgithub.com\u002FJane-o-O-o-O\u002Fpersonal-agent\u002Fblob\u002Fmain\u002Fresources\u002Fecosystem\u002Fupstream\u002Fyuque-skills\u002F2959228ad3e8\u002Fskills\u002Freading-digest\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":62,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M7EA37RF6AY0KCX9KQC1Q2YY","note-refine","Polish rough Yuque notes into structured, readable documents while preserving their meaning. Use when the user wants to clean up a draft, improve layout, or turn fragments into a document; trigger phrases include “帮我整理一下这篇笔记”, “把这个文档排版优化一下”, and “polish my notes”.","https:\u002F\u002Fgithub.com\u002FJane-o-O-o-O\u002Fpersonal-agent\u002Fblob\u002Fmain\u002Fresources\u002Fecosystem\u002Fupstream\u002Fyuque-skills\u002F2959228ad3e8\u002Fskills\u002Fnote-refine\u002FSKILL.md",[],[]]