Alopex CLI
Alopex CLI provides access to embedded and server-backed Alopex DB features. It supports SQL, KV, Vector, and Columnar workflows with streaming output and an interactive TUI by default on TTY terminals.
Quick start
Local (embedded) SQL:
Server profile (HTTPS required):
Output formats
Use --output to control formatting:
table(default)jsonjsonlcsvtsv
Streaming flags
For SELECT queries, streaming output supports:
--fetch-size <n>: server batch size (server profiles only)--max-rows <n>: stop after N rows--deadline <duration>: timeout (examples:60s,5m,1h)
Example:
TUI mode
The CLI launches the TUI automatically on TTY terminals. For SQL, just run:
Non-SQL commands that return rows also default to the TUI:
Force batch output with --batch or any explicit --output format:
Keybindings (TUI):
q/Esc: quit?: help/: searchn/N: next/previous matchhjklor arrow keys: move selectiong/G: jump top/bottomCtrl+d/Ctrl+u: page down/upEnter: toggle detail panelJ/K: scroll detail panel
Note: the TUI requires a TTY. When running in non-interactive mode, the CLI
falls back to batch output and preserves --output formatting.
Use --max-rows (or --limit) to cap memory usage for large result sets.
Admin console
Run the CLI without a subcommand to open the admin console:
You can also open the admin console scoped to a target by omitting its subcommand:
The admin console uses a three-pane layout inspired by rainfrog:
- Left: resource tree with search (tables, columns, segments, KV keys)
- Right top: detail/input panel (actions + parameters)
- Right bottom: status/preview panel
Focus controls:
h/lor ←/→: move focus between Table/Detail/Status- Table:
j/kmove,/search,g/Gtop/bottom,Ctrl+d/Ctrl+upage,Enterselect - Detail:
Tabfield,eedit,olist options,Enterexecute - Status:
j/kscroll,g/Gtop/bottom,Ctrl+d/Ctrl+upage
Lifecycle actions (archive/restore/backup/export) live in the Actions list and respect server auth capabilities.
Profiles and server connections
Profiles are stored in ~/.alopex/config (TOML). Example with a local profile:
[]
= "local"
[]
= "/var/lib/alopex"
Server profile with fallback to local data directory:
[]
= "server"
[]
= "https://db.example.com"
# Optional local fallback when the server is unavailable
[]
= "/var/lib/alopex"
Set a default profile:
= "prod"
Profile management commands (local profiles only):
Authentication
Token
[]
= "server"
[]
= "https://db.example.com"
= "token"
= "YOUR_TOKEN"
Basic (password_command)
[]
= "server"
[]
= "https://db.example.com"
= "basic"
= "alice"
= "security find-generic-password -w -s alopex"
mTLS
[]
= "server"
[]
= "https://db.example.com"
= "mtls"
= "/etc/alopex/client.pem"
= "/etc/alopex/client-key.pem"
Server management commands
All server commands require a server profile. Commands:
Examples
SQL streaming to CSV:
KV get:
Vector search: