CLI Reference
v0.5.5The dk binary is a full-featured command-line client for Dakera. 15 command groups with ~80 subcommands covering memory, vectors, sessions, knowledge graphs, analytics, backups, API keys, cluster admin, and more.
Source: github.com/dakera-ai/dakera-cli · github.com/dakera-ai/dakera-cli
Installation
cargo install dakera-cli
Or download pre-built binaries from GitHub Releases. Run dk init to configure your server URL and default namespace.
Essential commands
# Store a memory
dk memory store my-agent "User prefers dark mode" -t semantic -i 0.8
# Recall memories (semantic search)
dk memory recall my-agent "UI preferences" -k 10
# List sessions for an agent
dk session list -a my-agent
# List namespaces
dk namespace list
# Server health check
dk health
Profile system
Named profiles in ~/.dakera/config.toml let you switch between environments (dev, staging, prod) without flags:
# Add a profile
dk config profile add staging -u https://staging.example.com -n staging
# Switch profiles
dk config profile use prod
Precedence: CLI flags → environment variables → active profile → built-in defaults.
All command groups
| Group | Description |
|---|---|
dk memory | store, recall, get, update, forget, search, importance, consolidate, feedback |
dk session | start, end, get, list, memories |
dk namespace | list, get, create, delete, policy get/set |
dk vector | upsert, query, delete, multi-search, unified-query, aggregate, export, explain |
dk agent | list, memories, stats, sessions |
dk knowledge | graph, full-graph, summarize, deduplicate |
dk analytics | overview, latency, throughput, storage |
dk admin | cluster-status, optimize, rebuild-indexes, cache, backup, quotas, slow-queries |
dk keys | create, list, get, delete, deactivate, rotate, usage |
dk ops | diagnostics, jobs, compact, shutdown, metrics |
dk index | stats, fulltext-stats, rebuild |
dk completion | bash, zsh, fish shell completions |
Run dk --help for the full command reference, or dk <group> --help for subcommand details. Output formats: -f table (default), -f json, -f compact. Destructive commands support --dry-run for safe previews.
Vector operations
# Upsert a vector with metadata
dk vector upsert my-namespace --id doc-001 --text "quarterly revenue report" \
--metadata '{"source":"finance","year":2026}'
# Query vectors (semantic search)
dk vector query my-namespace "revenue trends" -k 5
# Multi-namespace search
dk vector multi-search "customer feedback" --namespaces ns1,ns2,ns3 -k 10
# Explain scoring for a query
dk vector explain my-namespace "revenue" --id doc-001
# Export all vectors (backup)
dk vector export my-namespace -o vectors-backup.jsonl
Knowledge graph
# View full entity graph for an agent
dk knowledge graph my-agent
# Traverse from a specific entity
dk knowledge traverse my-agent --entity "John" --depth 3
# Summarize knowledge for an agent
dk knowledge summarize my-agent
# Deduplicate entity nodes
dk knowledge deduplicate my-agent --dry-run
Admin & backup
# Trigger a manual backup
dk admin backup --compress
# View cluster status
dk admin cluster-status
# Rebuild vector indexes (maintenance)
dk admin rebuild-indexes my-namespace --dry-run
# View slow queries
dk admin slow-queries --since 1h --min-latency 100ms
# Compact storage (reclaim disk)
dk ops compact
API key management
# Create a scoped API key
dk keys create --name "prod-reader" --scope read --namespace my-namespace
# List all keys
dk keys list
# View usage stats for a key
dk keys usage key-abc123
# Rotate a key (creates new, deactivates old)
dk keys rotate key-abc123
# Deactivate a key
dk keys deactivate key-abc123
Safety features
The CLI is designed for safe operation in production environments:
| Feature | Description |
|---|---|
--dry-run | Preview destructive operations (delete, forget, compact, rebuild) without executing. Shows what would happen. |
| Exit codes | 0 = success, 1 = runtime error (auth failure, server unreachable, invalid data), 2 = usage error (bad flags, missing args) |
| Confirmation prompts | Bulk deletes and namespace drops require -y or interactive confirmation |
| Output formats | -f json for scripting (stable schema), -f table for humans, -f compact for piping |