Elastic CLI

The Elastic CLI (elastic) provides a single command-line interface for Elasticsearch, Kibana, and Elastic Cloud. Use it to interact directly with Elasticsearch and Kibana across deployment types, or to manage Elastic Cloud Hosted deployments and Elastic Cloud Serverless projects through the Elastic Cloud API.

The CLI groups its API commands into two main namespaces:

  • elastic stack: Connect directly to Elasticsearch and Kibana APIs across fully self-managed deployments, Elastic Cloud on Kubernetes, Elastic Cloud Enterprise, Elastic Cloud Hosted, and Elastic Cloud Serverless projects. You can use elastic es and elastic kb as shorter forms.
  • elastic cloud: Use Elastic Cloud APIs to manage Elastic Cloud Hosted deployments and Elastic Cloud Serverless projects.

Use named contexts to save and switch between service connections. Commands support structured output for scripts, agents, and other tools.

Note

The Elastic CLI is a technical preview and is under active development. Not all Elastic APIs are available as CLI commands. Refer to the Elastic CLI command reference for the available commands.

The following resources help you start using the Elastic CLI: