Elastic CLI command reference

The Elastic CLI command reference lists available namespaces, commands, options, and input schemas. Commands are grouped by the service or resource they manage.

For installation, configuration, and tutorials, refer to the Elastic CLI documentation.

Use the page navigation to browse the command tree. To explore the same hierarchy from the terminal, run elastic --help or append --help to a command, such as elastic es info --help. To inspect a command's input schema programmatically, combine --help with --json, for example elastic es info --help --json.

The elastic es and elastic kb shortcuts are equivalent to elastic stack es and elastic stack kb.

--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
ELASTIC_CLI_TELEMETRY
Set to a falsey value (false/0/no/off) to turn off collection of anonymous telemetry; overrides the config telemetry field
~/.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