Every command accepts the global options-C, --root <dir> (target another project),
--no-daemon (bypass a running daemon), --fresh <lazy|flag|strict> (read-after-write
freshness for daemon queries — see below), and — for query commands — --json (machine-readable
output). --json is compact (single-line, no indentation) by default, since the consumer
is an LLM agent; add --pretty for human-readable, indented JSON. They’re omitted from the
tables below for brevity.
Freshness (--fresh)
The daemon serves from a warm in-memory index kept current by a background filesystem watcher,
so by default (lazy) a query reflects edits within the watcher’s short debounce window. When
you edit a file and query it immediately — the typical agent loop — that window can return a
pre-edit line number. --fresh trades a little latency for read-after-write guarantees:
Mode
Behavior
lazy (default)
Serve the warm index; rely on the watcher. Lowest latency.
flag
Stat the tree first; still serve the warm index, but warn (on stderr) that results may be stale if a file changed. Adds a stat-only walk.
strict
Reindex any on-disk changes and hot-swap before answering, so the result reflects the working tree. Adds a stat walk plus a reindex of what changed.
Over MCP, set the environment variable GREPLM_FRESHNESS=strict to apply strict freshness to
every tool call (the server defaults to lazy).
Run greplm <command> --help for the full flag list. Most query commands support --limit /
--offset for pagination.
Indexing
Command
Arguments & key options
What it does
greplm init
—
Create .greplm/ with a default config (no indexing)
Structural search (tree-sitter query or $NAME pattern)
greplm pack
<task> [--budget <tokens>]
Build a token-budgeted context pack for a task (default 8000)
Git time-travel
Requires a git repo.
Command
Arguments & key options
What it does
greplm blame
<file> <line>
Commit, author, and summary that last changed a line
greplm history
<name> [--limit <n>]
Commits that touched a symbol’s line range (newest first)
greplm changed
<rev>
Files changed since a revision, annotated with their symbols
Daemon & semantic search
Command
Arguments & key options
What it does
greplm serve
[--global]
Run the warm-index daemon (serves queries over a socket). --global serves every project from one process.
greplm semantic-index
[--model <dir>]
Build the optional semantic (vector) index
greplm semantic-search
<query> [--limit <n>] [--model <dir>]
Search the semantic index by meaning
The two semantic-* commands only exist in a build made with --features semantic; the released
binaries and cargo install greplm-cli do not include them, and will report an unrecognized
subcommand. See Usage — Semantic search for building with it, and
Configuration for the ranking knobs.
Setup & maintenance
Command
Arguments & key options
What it does
greplm setup
[--no-daemon-service]
First-run convenience: build the index and install the always-on global daemon service
Self-update via the official install script; --check reports without installing
Agent & MCP setup
Command
Arguments & key options
What it does
greplm welcome
—
Show first-run checklist (MCP config, agent files, search)
greplm mcp config
[--pretty] [-q/--quiet]
Print copy-paste MCP client JSON (stdout) with paste hints (stderr)
greplm agent add
[tool] [--global] [--force]
Install the bundled subagent and main-loop guidance for a tool (auto-detects when omitted; falls back to AGENTS.md). --force refreshes the guidance block in place
greplm agent list
[--global]
List supported tools with their subagent and rules (memory-file) destinations