Skip to main content

CLI Reference

Shaktiman ships two binaries:

  • shaktiman — direct CLI over the index. Every MCP tool is also available as a CLI subcommand that reads the SQLite index without involving the daemon.
  • shaktimand — the MCP stdio server. Launched by your MCP client (e.g. Claude Code); you rarely invoke it by hand.

Persistent flags (shaktiman)

--format <json|text> Output format (default: json)

Every subcommand honors --format. Set --format text for human-readable output (matches the format the MCP server returns); leave the default json when piping to jq or other tools.

Management commands

shaktiman init <project-root>

Initialize a .shaktiman/ config directory. Writes a sample shaktiman.toml if one doesn't already exist; leaves existing config untouched.

shaktiman init /path/to/project

shaktiman index <project-root>

Cold-index a project directory. Refuses to run if a shaktimand daemon is already holding the project lock (the daemon handles indexing automatically).

FlagDefaultPurpose
--embedfalseAlso generate embeddings after indexing (requires Ollama).
--vector <backend>from configVector backend: brute_force, hnsw, qdrant, pgvector.
--db <backend>from configMetadata backend: sqlite, postgres.
--postgres-url <url>from config / envOverride the Postgres connection string.
--qdrant-url <url>from configOverride the Qdrant URL.

Progress is emitted on stdout (Indexing: N/M files (X%) / Embedding: N/M chunks (X%)). On a TTY the lines redraw in place; on a pipe they're emitted every 10 %.

Ctrl-C during embedding flushes progress to disk; the next run resumes from where it left off.

shaktiman reindex <project-root>

Purge all indexed data and reindex from scratch. Keeps configuration. Destructive — prompts for confirmation on TTYs.

All flags from index, plus:

FlagDefaultPurpose
--forcefalseSkip the confirmation prompt (required on non-interactive terminals).

shaktiman status <project-root>

Print a minimal index summary (file / chunk / symbol counts + parse errors + per-language file counts). Reads the index directly; no daemon required.

Query commands

Each query command wraps the MCP tool of the same name. Output is JSON by default; use --format text for a human-readable rendering.

shaktiman search <query>

See search MCP tool for result semantics.

FlagDefaultPurpose
--root <path>.Project root to read the index from.
--max <int>from [search].max_resultsMaximum results.
--mode <locate|full>from [search].default_modeResult mode.
--min-score <float>from [search].min_scoreMinimum relevance score.
--explainfalseInclude per-signal score breakdown (text format only).
--path <prefix>Filter results to a file or directory prefix.
--scope <impl|test|all>implResult scope.

shaktiman context <query>

See context MCP tool.

FlagDefaultPurpose
--root <path>.Project root.
--budget <int>from [context].budget_tokensToken budget (256–32768).
--scope <impl|test|all>implResult scope.

shaktiman symbols <name>

See symbols MCP tool.

FlagDefaultPurpose
--root <path>.Project root.
--kind <string>Filter by symbol kind (function, class, method, type, interface, variable).
--scope <impl|test|all>implResult scope.

shaktiman deps <symbol>

See dependencies MCP tool. Note the CLI name is deps, not dependencies.

FlagDefaultPurpose
--root <path>.Project root.
--direction <callers|callees|both>bothTraversal direction.
--depth <int>2BFS depth (1–5).
--scope <impl|test|all>implResult scope.

shaktiman diff

See diff MCP tool.

FlagDefaultPurpose
--root <path>.Project root.
--since <duration>24hTime window. Go duration syntax — no "d" or "w" units. Capped at 720h internally.
--limit <int>50Maximum diffs. Out-of-range values (<1 or >500) silently reset to the default.
--scope <impl|test|all>implResult scope.

shaktiman enrichment-status

See enrichment_status MCP tool.

FlagDefaultPurpose
--root <path>.Project root.

shaktiman summary

See summary MCP tool.

FlagDefaultPurpose
--root <path>.Project root.

shaktimand (MCP daemon)

shaktimand <project-root>

Takes a single positional argument: the project root. The daemon:

  1. Canonicalizes the project root path (symlinks + relative → absolute) so two daemons can't race by addressing the same directory differently.
  2. Creates .shaktiman/ if missing and opens shaktimand.log for structured logs (stdout is reserved for the MCP protocol, stderr for startup errors only).
  3. Acquires a flock on .shaktiman/daemon.pid. If the lock is taken, enters proxy mode — forwarding MCP traffic to the leader via /tmp/shaktiman-<hash>.sock — and never rotates the shared log.
  4. If it got the lock, loads the TOML config, validates the backend combination (see Backends), opens the socket for future proxies, and serves MCP over stdio.

shaktimand is not normally run by hand. Wire it via your MCP client's configuration (for Claude Code, see Claude Code Setup).

Source of truth

  • cmd/shaktiman/main.goinit, index, reindex, status.
  • cmd/shaktiman/query.gosearch, context, symbols, deps, diff, enrichment-status, summary.
  • cmd/shaktimand/main.go — daemon lifecycle and leader/proxy dispatch.