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 PyPI2pip install elastro-client34# Or install from source5pip install git+https://github.com/Fremen-Labs/elastro.gitCommon Commands
Initialize configuration and perform common operations.
Common Commands
1# Initialize configuration2elastro config init34# Create an index5elastro index create products --shards 3 --replicas 167# Interactive Template Wizard8elastro template wizard910# Add a document11elastro doc index products --id 1 --file ./product.json1213# Search documents14elastro doc search products --term category=laptopData Ingest & Processing
Format, validate, profile, and stream data from local sources (CSV, SQL, NDJSON) into Elasticsearch.
Ingest Engine
1# Stream CSV data into an index2elastro ingest import data.csv --index customers --format csv34# Stream live SQL databases5elastro ingest import --sql "SELECT * FROM users" --dsn postgresql://user:pass@localhost/db --index users67# Profile dataset to identify PII risk and types8elastro ingest profile data.csv --sample-size 1000910# Auto-detect optimal mappings11elastro ingest auto-map data.json --sample-size 5001213# Interactively build Grok patterns14elastro 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 list34# List with full JSON details5elastro ilm list --full67# Create a policy using the Interactive Wizard (Recommended)8elastro ilm create my-policy910# Create a policy from a file11elastro ilm create my-policy --file ./policy.json1213# Explain lifecycle status for an index14elastro ilm explain my-indexSnapshot & Restore
Manage backup repositories and restore data with confidence using the restoration wizard.
Repository Management
Repository Commands
1# List all repositories2elastro snapshot repo list34# Create a filesystem repository5elastro snapshot repo create my_backup fs --setting location=/tmp/backups67# Create an S3 repository8elastro snapshot repo create my_s3_backup s3 --setting bucket=my-bucket --setting region=us-east-1Snapshot Operations
Snapshot Commands
1# List snapshots in a repository2elastro snapshot list my_backup34# Create a snapshot (async default)5elastro snapshot create my_backup snapshot_167# Create and wait for completion8elastro snapshot create my_backup snapshot_2 --wait --indices "logs-*,metrics-*"Restoration
Restore Commands
1# Restore a snapshot (Interactive Wizard)2elastro snapshot restore3# Launches a wizard to select repo -> snapshot -> indices -> rename pattern45# Restore specific indices from CLI6elastro snapshot restore my_backup snapshot_1 --indices "logs-*"