elastic/cli(opens in a new tab)
Language: TypeScript
Interact with Elasticsearch, Elastic Serverless and Elastic Cloud APIs from the command line
- stars
- 54
- watchers
- 1
- forks
- 31
- open issues
- 69
- Last updated
- 10/31/2026
Language: TypeScript
Interact with Elasticsearch, Elastic Serverless and Elastic Cloud APIs from the command line
Interact with the Elastic Stack and Elastic Cloud from the command line.
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.
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 -gfails with anEACCESpermission error on Linux/macOS, either re-run withsudoor (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
Prefer elastic <command> --help --json for one command and elastic cli-schema
for the full tree. Do not ingest docs/cli/schema.json directly.
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
| 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 |