awesome cli.

Monitoring & incidents

Elastic ecctl for coding agents

Elastic Cloud deployment inspection and management with explicit deployment IDs and JSON output.

Open the official project ↗

This article follows the official documentation. We haven’t tested this tool for a hands-on review.

When a coding agent needs to inspect an Elastic Cloud deployment, ecctl lets it use a command-line interface to send requests to the APIs, or software interfaces, for Elastic Cloud and Elastic Cloud Enterprise. A deployment is an Elastic environment set up to run services such as Elasticsearch. ecctl retrieves deployment information as JSON, a structured text format, so an agent can inspect the result without changing the deployment.

For example, an agent investigating an incident can list deployments and inspect one by its deployment ID. The commands below make network requests to Elastic; --output json controls how ecctl formats the response. The official ecctl documentation describes the available commands.

Install and authenticate

Follow the installation instructions or use the downloadable release files in the official ecctl repository for your operating system. The documentation cited here does not give a specific installation command, so follow the repository’s current instructions instead of assuming you should use a package manager or Go command.

ecctl accepts an API key through --api-key. The authentication documentation also describes username and password flags. With those flags, ecctl gets a JSON Web Token, a temporary token used to authenticate requests, and refreshes it periodically. For an agent, store the API key outside the prompt, such as in an environment variable available to the agent’s shell. Do not paste the key into the agent’s instructions or source code. See Elastic’s authentication documentation for the supported options.

After installation, check the local command interface:

ecctl --help

This displays help locally and does not inspect an Elastic deployment. Give the agent access only to credentials appropriate for the inspection you want it to perform.

Inspect a deployment

These commands list deployments, then retrieve details for one deployment. Replace <deployment-id> with an ID returned by the list command. Store the API key in EC_API_KEY before running the commands; the variable name is an example, not an ecctl setting.

ecctl deployment list --api-key "$EC_API_KEY" --output json
ecctl deployment show <deployment-id> --api-key "$EC_API_KEY" --output json

Both commands contact Elastic Cloud. The first lists deployments visible to the authenticated account. The second requests information for the specified deployment. The --output json flag tells ecctl to print JSON, which an agent can parse or compare with other command output. The ecctl usage examples show documented command patterns; check the installed version’s help if its syntax differs.

The example does not include a sample response because deployment details depend on the account and deployment. An agent should report fields in the actual JSON response and flag missing or ambiguous information rather than infer a deployment’s health from its ID or name.

A realistic prompt for this task is:

Use ecctl to list the Elastic Cloud deployments available to the configured credentials. Inspect deployment <deployment-id> and summarize the deployment details returned as JSON. Do not change any deployment settings.

The prompt contains no secret. The commands make read requests, and they do not ask ecctl to apply a deployment change. The account still needs authorization to read the requested information.

Know when ecctl fits

ecctl is useful when an agent needs to inspect Elastic Cloud with a shell command and pass structured output to later analysis. Its commands also support operational tasks beyond inspection. The ecctl repository recommends the Elastic Cloud Terraform provider for creating and managing deployments. Use Terraform to define infrastructure changes in a managed configuration. Use ecctl when its documented commands suit a specific operational task.

The cited documentation does not give ecctl’s current release or support status. Before using a command in automation, check the repository and the help output for the version you install.

Tool details come from awesome-ai-cli.