CLI Reference

Elastro CLI

Manage your Elasticsearch clusters, snapshots, and ILM policies directly from the terminal.

Installation

The CLI is installed automatically when you install Elastro.

Installation
1# Install from PyPI
2pip install elastro-client
3
4# Or install from source
5pip install git+https://github.com/Fremen-Labs/elastro.git

Common Commands

Initialize configuration and perform common operations.

Common Commands
1# Initialize configuration
2elastro config init
3
4# Create an index
5elastro index create products --shards 3 --replicas 1
6
7# Interactive Template Wizard
8elastro template wizard
9
10# Add a document
11elastro doc index products --id 1 --file ./product.json
12
13# Search documents
14elastro doc search products --term category=laptop

Data Ingest & Processing

Format, validate, profile, and stream data from local sources (CSV, SQL, NDJSON) into Elasticsearch.

Ingest Engine
1# Stream CSV data into an index
2elastro ingest import data.csv --index customers --format csv
3
4# Stream live SQL databases
5elastro ingest import --sql "SELECT * FROM users" --dsn postgresql://user:pass@localhost/db --index users
6
7# Profile dataset to identify PII risk and types
8elastro ingest profile data.csv --sample-size 1000
9
10# Auto-detect optimal mappings
11elastro ingest auto-map data.json --sample-size 500
12
13# Interactively build Grok patterns
14elastro ingest grok-builder --sample "10.0.0.1 - - [12/May/2026:07:03:12] \"GET /api/v1/users HTTP/1.1\" 200 1234"

ILM Policy Management

Easily manage your Index Lifecycle Management policies with an interactive wizard.

ILM Commands
1# List all policies (Table View)
2elastro ilm list
3
4# List with full JSON details
5elastro ilm list --full
6
7# Create a policy using the Interactive Wizard (Recommended)
8elastro ilm create my-policy
9
10# Create a policy from a file
11elastro ilm create my-policy --file ./policy.json
12
13# Explain lifecycle status for an index
14elastro ilm explain my-index

Snapshot & Restore

Manage backup repositories and restore data with confidence using the restoration wizard.

Repository Management

Repository Commands
1# List all repositories
2elastro snapshot repo list
3
4# Create a filesystem repository
5elastro snapshot repo create my_backup fs --setting location=/tmp/backups
6
7# Create an S3 repository
8elastro snapshot repo create my_s3_backup s3 --setting bucket=my-bucket --setting region=us-east-1

Snapshot Operations

Snapshot Commands
1# List snapshots in a repository
2elastro snapshot list my_backup
3
4# Create a snapshot (async default)
5elastro snapshot create my_backup snapshot_1
6
7# Create and wait for completion
8elastro snapshot create my_backup snapshot_2 --wait --indices "logs-*,metrics-*"

Restoration

Restore Commands
1# Restore a snapshot (Interactive Wizard)
2elastro snapshot restore
3# Launches a wizard to select repo -> snapshot -> indices -> rename pattern
4
5# Restore specific indices from CLI
6elastro snapshot restore my_backup snapshot_1 --indices "logs-*"