Skip to content
elasticPublic

About

Interact with Elasticsearch, Elastic Serverless and Elastic Cloud APIs from the command line

Resources

Code of conduct

Contributing

Security policy

Stars

54 stars

Watchers

1 watching

Forks

Latest commit

 

History

464 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Elastic CLI

Interact with the Elastic Stack and Elastic Cloud from the command line.

⚠️ Tech preview

This CLI tool is a technical preview and is still under active development. It does not yet support all features and APIs available in every version of the Elastic stack.

Installation

Install globally from npm so the elastic binary is available on your PATH:

npm install -g @elastic/cli
elastic --help

If you don't want a global install, you can run a one-off invocation with npx, which downloads and runs the CLI without persisting it:

npx -y @elastic/cli --help

If npm install -g fails with an EACCES permission error on Linux/macOS, either re-run with sudo or (recommended) point npm's global prefix at a user-owned directory:

mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

For agents

Prefer elastic <command> --help --json for one command and elastic cli-schema for the full tree. Do not ingest docs/cli/schema.json directly.

Quickstart

elastic config context add local --es-url http://localhost:9200 --es-api-key <api-key>
elastic status
elastic es info
elastic es search --index my-index
elastic cloud hosted deployments list-deployments

Documentation

Topic Page
Get started Quickstart
Install, update, and uninstall Install the Elastic CLI
Config file, contexts, credentials Configure the Elastic CLI
Config file properties Configuration file reference
Elastic Cloud Connect to Elastic Cloud
Tab completion Shell completion
Extensions Extend the Elastic CLI
Commands and global options Command reference

About

Interact with Elasticsearch, Elastic Serverless and Elastic Cloud APIs from the command line

Resources

Code of conduct

Contributing

Security policy

Stars

54 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages