CLI Reference
The engram CLI provides a local interface for setup, ingesting text, querying the store, and checking subnet status.
Install
bash
pip install engram-subnetengram --help
Tip
The CLI defaults to a local FAISS store and sentence-transformers embedder. No OpenAI key or running miner needed for basic use.
engram init
Interactive setup wizard — creates a .env file and verifies your installation. The fastest way to get started.
bash
engram init
The wizard asks about your role and writes the right config:
bash
$ engram init╭──────────────────────────────────────────╮│ Welcome to Engram ││ This wizard will help you set up your ││ environment. │╰──────────────────────────────────────────╯What are you setting up?[miner] Run a miner node and earn TAO[validator] Run a validator and set weights[dev] Use the SDK locally> minerSubtensor network [finney/test/ws://...]: testSubnet UID: 450Wallet name: defaultHotkey name: minerYour public IP address: 1.2.3.4...✓ Written: /your/project/.envChecking your installation...✓ engram package installed✓ engram-core (Rust) built✓ openai installed✓ bittensor installedNext steps:btcli subnet register --netuid 450 ...python neurons/miner.py
| Flag | Description |
|---|---|
| --role miner|validator|dev | Skip the role prompt |
| --out PATH | Output path for .env file (default .env) |
| --force | Overwrite existing .env without prompting |
engram ingest
bash
# Ingest a stringengram ingest "The transformer architecture changed everything."# With metadataengram ingest "BERT uses bidirectional representations." --meta '{"source":"arxiv"}'# From a JSONL fileengram ingest --file data/corpus.jsonl# Ingest an entire directory recursively (.txt, .md, .jsonl)engram ingest --dir ./docs# Custom source labelengram ingest "My note" --source personal-notes
| Flag | Description |
|---|---|
| TEXT | Text to embed and store (positional) |
| --file, -f PATH | Path to a .txt or .jsonl file |
| --dir PATH | Recursively ingest all .txt / .md / .jsonl files |
| --meta, -m JSON | JSON metadata string (default {}) |
| --source, -s STR | Source label added to metadata (default "cli") |
engram query
bash
engram query "how does self-attention work?"engram query "neural network training" --top-k 10engram query "vector databases" --meta
| Flag | Description |
|---|---|
| TEXT | Search query (required) |
| --top-k, -k INT | Number of results to return (default 5) |
| --meta | Show metadata column in results table |
engram status
bash
# Local store statusengram status# Live metagraph — connects to chain and probes all minersengram status --liveengram status --live --netuid 450
| Flag | Description |
|---|---|
| --live, -l | Fetch live data from chain and health-check all miners |
| --netuid INT | Subnet UID (overrides NETUID env var) |
engram wallet-stats
bash
# All wallet activity on this minerengram wallet-stats# Single wallet detailengram wallet-stats 5FHGPfixdXLs...# With live TAO stakeengram wallet-stats --live --netuid 450
Environment variables
| Variable | Default | Description |
|---|---|---|
| FAISS_INDEX_PATH | ./data/engram.index | Local FAISS index file path |
| USE_LOCAL_EMBEDDER | true | Use sentence-transformers (no API key needed) |
| OPENAI_API_KEY | — | Required if USE_LOCAL_EMBEDDER=false |
| SUBTENSOR_NETWORK | — | Network for --live (test, finney, ws://...) |
| NETUID | 450 | Default subnet UID |
| WALLET_NAME | default | Wallet coldkey name |
| WALLET_HOTKEY | default | Wallet hotkey name |
| MINER_URL | http://127.0.0.1:8091 | Miner URL for wallet-stats command |
engram docs · v0.1edit on github →