Elasticsearch Shell
A powerful, interactive REPL for Elasticsearch with auto-completion.
Features
- Auto-completion: Smart suggestions for:
- HTTP methods (
GET,POST,PUT,DELETE) - Indices and aliases
- Common Elasticsearch API endpoints (
_search,_cat/indices, etc.) - Query DSL keywords inside JSON bodies.
- HTTP methods (
- Multi-line Editing: Comfortably write and edit complex queries.
- Persistent History: Your command history is saved across sessions in
~/.local/state/elasticsearch-shell/history. - Flexible Connection: Connect to Elasticsearch using Cloud ID and API Key, or via Host, Username, and Password.
Requirements
- Python 3.13+
uvpackage manager (e.g.,pip install uv)
Usage
The recommended way to run the application is with uvx:
uvx elasticsearch-shell
This will download and run the latest version in a temporary virtual environment.
Running from source (for development)
If you have cloned this repository, you can also run the script directly. The script uses uv to manage its dependencies automatically.
First, make the script executable:
chmod +x elasticsearch_shell/elasticsearch_shell.py
Then run it:
./elasticsearch_shell/elasticsearch_shell.py
Alternatively, you can run it with uv without making it executable:
uv run --script elasticsearch_shell/elasticsearch_shell.py
Configuration
Connection to your Elasticsearch cluster is configured via environment variables.
Method 1: Cloud ID and API Key
This is the recommended method for connecting to Elastic Cloud.
export ES_CLOUD_ID="your_cloud_id"
export ES_API_KEY="your_api_key_id:your_api_key_secret"
Method 2: Host, Username, and Password
For self-managed clusters or other connection scenarios.
export ES_HOST="https://your-elasticsearch-host:9200"
export ES_USERNAME="your_username"
export ES_PASSWORD="your_password"
How to Use
Once the shell is running, you can start making requests to Elasticsearch.
- The first line of your input should be the HTTP method and the path (e.g.,
GET /_search). - For requests with a body (like
POSTorPUT), write the JSON body on the following lines. - Press
Meta+Enter(orEscthenEnter) to submit the multi-line request. - Use
Ctrl+Dto exit.
Example
Here's how you would run a search query:
>>> GET /my-index/_search
{
"query": {
"match_all": {}
}
}
(Press Meta+Enter to submit)
The shell will then execute the request and print the JSON response from Elasticsearch.
Metadata
Release files for elasticsearch-shell 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| elasticsearch_shell-0.1.0.tar.gz | 6.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| elasticsearch_shell-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / elasticsearch_shell-0.1.0.tar.gz
| Download URL | elasticsearch_shell-0.1.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf371093e47c7ee88bb1efd287a8cf3ce494b78e23bdcb64959bc76112bb53ab
|
|
BLAKE2b-256 checksum How to use checksums |
db4af77d8308c05230413f8e3187936e773ae3cd5c6ce9157e6ca7362a8fc021
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / elasticsearch_shell-0.1.0-py3-none-any.whl
| Download URL | elasticsearch_shell-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09acb853a2d5880cc5f1898c46bc83f8548921ef3e7e636ddf56754b8b474196
|
|
BLAKE2b-256 checksum How to use checksums |
3b7518e2d2d8b4ec176165fd8b6adb1778022e7484cb045294979064141fb8b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for elasticsearch-shell 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.