From the CLI
The CLI ships two documentation commands. They need no authentication and no project — they work the moment the CLI is installed.| Command | Use for |
|---|---|
keystroke docs search "<query>" | Broad or conceptual lookups when you don’t know the path. Returns matching pages with titles and paths. |
keystroke docs query "<command>" | Exact keyword/regex search, structure exploration, and reading a page by path with a shell-style command (cat, rg, ls, tree, head). |
search (with its .mdx extension) to query to read it: keystroke docs query "cat /learn/agents/build-agents.mdx".
From the MCP server
MCP clients get the same two capabilities as tools, always available once connected:| Tool | Use for |
|---|---|
search_docs | Broad or conceptual lookups; returns matching pages and their paths. |
query_docs | Exact keyword/regex search and reading pages by path against the docs filesystem. |
By URL
When an agent works over plain HTTP fetch instead of the CLI or MCP, the docs are still reachable as clean markdown:- A single page — append
.mdto any docs URL to get a markdown version, e.g.https://keystroke.ai/docs/quickstart.md. - The whole index —
https://keystroke.ai/docs/llms.txtis a machine-readable map of every page, handy for pointing an agent at the full docs at once.
How query works
query (and query_docs) run against a virtualized, read-only documentation filesystem rooted at / — not a shell on any machine. A few things to know:
- Stateless — each call resets the working directory to
/. Use absolute paths, or chain with&&. - Output is capped (~30KB per call). Prefer a targeted
rg -C 3 "term" /path.mdxorhead -n 120 /path.mdxovercaton large pages, and batch several files into one read. - Convert a filesystem path to a docs URL by dropping the
.mdxextension (/quickstart.mdx→/quickstart).
Baseline context: AGENTS.md
keystroke init scaffolds an AGENTS.md guide (symlinked to CLAUDE.md) with concise baseline context — the CLI, project layout, discovery, and working habits — that most coding agents read automatically. The CLI keeps AGENTS.md in sync with your installed version whenever you run a command in the project. AGENTS.md orients your agent; the docs commands above are how it goes deeper.
Next steps
CLI for agents
Headless behavior, JSON output, and the deploy-first loop.
MCP for agents
Build from any MCP client in a hosted workspace.
Build agents
Author agents, configure models, and add tools.
CLI reference
Every command, flag, and the local-vs-cloud target model.