Skip to content

About

Agent-first command-line control for Alibaba Cloud elastic computing resources.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Repository files navigation

ecctl

Agent-first command-line control for Alibaba Cloud elastic computing resources.

CI Documentation Go 1.26 or later

Documentation: English | 简体中文

ecctl gives agents and operators a consistent product/resource/action grammar, JSON-first output, machine-readable schemas, waiters, and spec-driven cloud behavior.

The Sandbox trial guide covers setup, sandbox/template creation, and backend limitations for E2B, FC, and ACS: 简体中文. Use the matching branch trial build when testing unreleased Sandbox features.

Installation

Install the latest public release with Homebrew:

brew tap aliyun/ecctl https://github.com/aliyun/elastic-compute-control-cli
brew install --cask aliyun/ecctl/ecctl
ecctl --version

The first command uses this repository directly as the aliyun/ecctl Tap. Since Homebrew 6.0, third-party taps are not trusted by default; installing with the fully qualified cask name trusts only this cask, so a separate brew trust step is not needed. Pre-built binaries for macOS, Linux, and Windows are also available from GitHub Releases.

Check for or install a newer release with ecctl update --check and ecctl update. The command supports both direct binary and Homebrew installations.

Or build from source with Go 1.26 or later:

git clone https://github.com/aliyun/elastic-compute-control-cli.git
cd elastic-compute-control-cli
make metadata-prepare
make build

The preparation step downloads and verifies the pinned OpenAPI metadata. Its generated files stay outside Git and are embedded in bin/ecctl; installed binaries do not download metadata at runtime. Source builds require this step, so direct go install is unsupported.

See the installation guide for requirements and other installation options.

Common Commands

These commands are a curated set of common workflows for users and agents. Unlike Alibaba Cloud CLI's API-operation-oriented interface, they demonstrate ecctl's resource verbs, machine-readable command details, normalized filters, concise inputs, multi-API workflows, built-in waiters, and readback. Replace values in angle brackets before running a command. Several examples change cloud resources; inspect their schema first.

Check several commands before use

ecctl schema ecs.instance.list ecs.instance.create ecs.disk.create --brief

One call returns required flags, risk, dry-run, idempotency, and waiter behavior.

Find running production instances

ecctl ecs instance list --region cn-hangzhou --filter status=Running --filter tag.env=prod

The consistent filter syntax returns normalized JSON without OpenAPI response wrappers.

Validate ECS creation

ecctl ecs instance create --region cn-hangzhou --type <instance-type> --image <image-id-or-name> --sg <sg-id> --vswitch <vswitch-id> --tag env=prod --dry-run

Short resource fields send a server-side validation request without creating an instance.

Create an ECS instance

ecctl ecs instance create --region cn-hangzhou --type <instance-type> --image <image-id-or-name> --sg <sg-id> --vswitch <vswitch-id> --name web-01 --tag env=prod

ecctl supplies ClientToken-compatible idempotency, waits for Running, and reads the instance back.

Update and tag an instance

ecctl ecs instance update <instance-id> --region cn-hangzhou --name web-02 --tag env=prod

ecctl selects the required OpenAPIs from the requested resource changes and reads the instance back.

Create a cloud disk

ecctl ecs disk create --region cn-hangzhou --zone <zone-id> --size 100 --category cloud_essd --name data-01 --tag env=prod

The command supplies idempotency, waits for Available, and returns the normalized disk view.

Attach a key pair

ecctl ecs instance update <instance-id> --region cn-hangzhou --key-pair <key-pair-name>

The resource update maps to the required key-pair API and reads the instance back.

Run a command on an instance

ecctl ecs instance exec <instance-id> --region cn-hangzhou --command 'uname -a'

One command runs Cloud Assistant, waits for completion, and reads the invocation result.

Authorize an HTTPS security-group rule

ecctl ecs sg authorize <sg-id> --region cn-hangzhou --rule tcp:443@0.0.0.0/0

A compact rule replaces verbose OpenAPI fields, and ecctl reads the security group back.

Get an ACK kubeconfig

ecctl ack kubeconfig get --region cn-hangzhou --cluster <cluster-id> --private-ip

The resource intent is explicit; callers do not need to know the OpenAPI operation or response shape.

Learn more in the Quick Start, Concepts, Command Discovery, and Resource Coverage guides.

Contributing

Start with the resource spec guide.

See the Go coverage guide for the independent 95% statement and 85% branch-outcome gates, local reports, and measurement scope.

Use the dependency security runbook to triage Dependabot alerts and validate dependency updates.

About

Agent-first command-line control for Alibaba Cloud elastic computing resources.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages