﻿---
title: Elastic CLI command reference
description: The Elastic CLI command reference lists available namespaces, commands, options, and input schemas. Commands are grouped by the service or resource they...
url: https://www.elastic.co/elastic/docs-builder/docs/4118/reference/elastic-cli/cli
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# 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](https://www.elastic.co/elastic/docs-builder/docs/4118/reference/elastic-cli).
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`.

## Global Options

<definitions>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>


## Commands

<page-card>
  Print the elastic CLI version
</page-card>


## Namespaces

<page-card>
  Interact with Elastic Stack components (Elasticsearch, Kibana, Fleet)
</page-card>

<page-card>
  Manage Elastic Cloud (hosted deployments and serverless projects)
</page-card>

<page-card>
  Search, read, and ask questions about Elastic documentation
</page-card>

<page-card>
  Author and maintain the elastic config file
</page-card>

<page-card>
  Sanitize values for safe use in Elasticsearch
</page-card>


## Environment Variables

<definitions>
  <definition term="ELASTIC_CLI_CONFIG_FILE">
    Override the config file path (precedence: --config-file > this > home directory discovery)
  </definition>
  <definition term="ELASTIC_NO_BANNER">
    Set to 1 to suppress the startup logo
  </definition>
  <definition term="ELASTIC_CLOUD_ADMIN_API">
    Override the Elastic Cloud admin API base URL
  </definition>
  <definition term="ELASTIC_CLI_TELEMETRY">
    Set to a falsey value (false/0/no/off) to turn off collection of anonymous telemetry; overrides the config telemetry field
  </definition>
</definitions>


## Configuration Files

<definitions>
  <definition term="~/.elasticrc.yml">
    Primary config file (recommended)
  </definition>
  <definition term="~/.elasticrc.yaml">
    Alternative YAML extension
  </definition>
  <definition term="~/.elasticrc.json">
    JSON form of the config file
  </definition>
  <definition term="~/.elasticrc">
    Extensionless form of the config file
  </definition>
</definitions>