Skip to main content
The Keystroke documentation is the source of truth for APIs, patterns, and examples — and your agent can search and read it as it works, with no setup. Prefer what the docs return over prior knowledge. Docs access comes in two forms that mirror the two ways to build: the CLI for local work, and the MCP server for chat-first agents. Both are read-only and reach the same documentation.

From the CLI

The CLI ships two documentation commands. They need no authentication and no project — they work the moment the CLI is installed.
keystroke docs search "webhook trigger"        # find pages by topic
keystroke docs query "cat /quickstart.mdx"     # read a page by path
CommandUse 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).
Pass a path returned by 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:
ToolUse for
search_docsBroad or conceptual lookups; returns matching pages and their paths.
query_docsExact 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 .md to any docs URL to get a markdown version, e.g. https://keystroke.ai/docs/quickstart.md.
  • The whole indexhttps://keystroke.ai/docs/llms.txt is 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.mdx or head -n 120 /path.mdx over cat on large pages, and batch several files into one read.
  • Convert a filesystem path to a docs URL by dropping the .mdx extension (/quickstart.mdx/quickstart).
keystroke docs query "tree / -L 2"                   # see the top-level layout
keystroke docs query "rg -il 'defineWorkflow' /"     # find pages mentioning a symbol
keystroke docs query "head -n 200 /cli.mdx"          # read the top of a page

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.