Elastic CLI command reference
The Elastic CLI (elastic) lets you manage Elasticsearch, Kibana, and Elastic Cloud resources from the command line. It supports both self-managed Elastic Stack deployments and Elastic Serverless projects.
Use the CLI to:
- Connect to multiple clusters or projects using named contexts
- Manage Elastic Cloud Hosted deployments and Serverless projects
- Automate operations in CI/CD pipelines and LLM agent workflows
To get started, see Install the Elastic CLI and Configure the Elastic CLI.
--[no-]json- output as JSON
version
Print the elastic CLI version
stack
Interact with Elastic Stack components (Elasticsearch, Kibana, Fleet)
cloud
Manage Elastic Cloud (hosted deployments and serverless projects)
docs
Search, read, and ask questions about Elastic documentation
config
Author and maintain the elastic config file
sanitize
Sanitize values for safe use in Elasticsearch
ELASTIC_CLI_CONFIG_FILE- Override the config file path (precedence: --config-file > this > home directory discovery)
ELASTIC_NO_BANNER- Set to 1 to suppress the startup logo
ELASTIC_CLOUD_ADMIN_API- Override the Elastic Cloud admin API base URL
~/.elasticrc.yml- Primary config file (recommended)
~/.elasticrc.yaml- Alternative YAML extension
~/.elasticrc.json- JSON form of the config file
~/.elasticrc-
Extensionless form of the config file