CLI

The agentgrep CLI is the fastest path to your local AI agent prompt and history archives from a terminal. It wraps the same read-only discovery and parsing layer the MCP server exposes — search, find stores, filter by agent — and lets you pipe everything through --json or --ndjson so any script or non-MCP agent can consume the results.

With uvx run installed:

$ uvx agentgrep --help

Then run it from the terminal:

$ uvx agentgrep search "deploy"
$ uvx agentgrep search --agent claude --json "deploy"
$ uvx agentgrep find --json
agentgrep search

Search prompts and history across every configured agent.

agentgrep search
agentgrep find

Discover the on-disk stores agentgrep can read.

agentgrep find

Use from another agent

The CLI is a first-class consumer for any agent that doesn’t speak MCP. Two flags govern machine-readable output:

  • --json emits a single JSON document with an envelope carrying the record list. Best when the caller wants to parse the whole result at once.

  • --ndjson streams one JSON object per line. Best for piping into jq, into another CLI, or into an agent that consumes results incrementally.

Both flags work on search and find. See JSON output and JSON output for the record shapes.

Agents that already speak MCP should prefer agentgrep-mcp — same discovery and parsing surface, but exposed as MCP tools with typed schemas.

Examples

search is the default subcommand, so agentgrep bliss is equivalent to agentgrep search bliss:

$ agentgrep bliss

Combine multiple terms with an agent filter:

$ agentgrep serene bliss --agent codex

Stream history matches as NDJSON:

$ agentgrep search prompt history --type history --ndjson

List stores for one agent as JSON:

$ agentgrep find cursor --json

Command: agentgrep

Usage

usage: agentgrep [-h] [--color {auto,always,never}] {search,find} ...

Options

--color

when to use colors: auto (default), always, or never

Default
auto
Choices
auto, always, never