﻿---
title: Elastic CLI
description: Use the Elastic CLI to interact with the Elastic Stack and Elastic Cloud from the command line.
url: https://www.elastic.co/elastic/docs-builder/docs/4118/reference/elastic-cli
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# Elastic CLI
The Elastic CLI (`elastic`) provides a single command-line interface for Elasticsearch, Kibana, and Elastic Cloud. Use it to interact directly with Elasticsearch and Kibana across deployment types, or to manage Elastic Cloud Hosted deployments and Elastic Cloud Serverless projects through the Elastic Cloud API.
The CLI groups its API commands into two main namespaces:
- **`elastic stack`:** Connect directly to Elasticsearch and Kibana APIs across fully self-managed deployments, Elastic Cloud on Kubernetes, Elastic Cloud Enterprise, Elastic Cloud Hosted, and Elastic Cloud Serverless projects. You can use `elastic es` and `elastic kb` as shorter forms.
- **`elastic cloud`:** Use Elastic Cloud APIs to manage Elastic Cloud Hosted deployments and Elastic Cloud Serverless projects.

Use named contexts to save and switch between service connections. Commands support structured output for scripts, agents, and other tools.
<note>
  The Elastic CLI is a technical preview and is under active development. Not all Elastic APIs are available as CLI commands. Refer to the [Elastic CLI command reference](https://www.elastic.co/elastic/docs-builder/docs/4118/reference/elastic-cli/cli) for the available commands.
</note>


## Get started

The following resources help you start using the Elastic CLI:
- Follow the [Elastic CLI quickstart](https://www.elastic.co/elastic/docs-builder/docs/4118/reference/elastic-cli/cli/quickstart) to install the CLI, configure an Elasticsearch connection, and run your first commands.
- Refer to [Install the Elastic CLI](https://www.elastic.co/elastic/docs-builder/docs/4118/reference/elastic-cli/cli/installation) for detailed instructions to install, update, or uninstall the CLI.
- Refer to [Configure the Elastic CLI](https://www.elastic.co/elastic/docs-builder/docs/4118/reference/elastic-cli/cli/configuration) to manage connection contexts and credentials.


## Learn more

- Refer to the [Elastic CLI command reference](https://www.elastic.co/elastic/docs-builder/docs/4118/reference/elastic-cli/cli) for commands, options, and input schemas.
- Follow [Connect to Elastic Cloud with the Elastic CLI](https://www.elastic.co/elastic/docs-builder/docs/4118/reference/elastic-cli/cli/manage-elastic-cloud) to configure a connection and run example operations against the Elastic Cloud API.