Skip to content

Add function-handler section to llms.txt and urlcode docs search CLI - #432

Merged
jimhoyd merged 1 commit into
mainfrom
issue-406-docs-search
Sep 22, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
issue-406-docs-search

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a short function-handler section to llms.txt: the (request, {args, env, route}) signature, string-form vs long-form args binding, and a pointer to urlcode docs search instead of grepping llms-full.txt.
  • Add urlcode docs search TEXT [--json], a CLI command with parity to the MCP search_docs tool: at most three bounded excerpts from the packaged agent docs corpus (same searchDocs implementation in src/agent-context.ts).
  • Update docs/TOOLING.md to document the CLI equivalent, the CLI usage/help text, and the capabilities --json tooling list.
  • Add a CLI test (test/recipes.test.ts) asserting bounded excerpt output, the matched:/text format, and the no-args/unknown-subcommand error cases.
  • Add a changeset.

Context

From #406: a benchmark run showed an agent reading llms.txt (14 KB), then running four grep passes plus two reads over llms-full.txt (240 KB) hunting for the function handler signature and args binding, because llms.txt didn't answer those questions and there was no bounded CLI search comparable to the MCP search_docs tool.

Verification

  • npm run verify (lint, typecheck, check, build, full test suite including workspace packages) passes clean on this branch, rebased onto latest main.
  • Manually ran node src/cli.ts docs search "function args env" and confirmed bounded excerpt output matching search_docs's shape.
  • npm run docs:llms (the llms-full.txt generator) produces no diff after the llms.txt change, confirming it stays in sync.

Closes #406

🤖 Generated with Claude Code

…h CLI

- llms.txt: document the function handler shape (request, {args, env, route}),
  string-form vs long-form args binding, and point at 'urlcode docs search'
  instead of grepping llms-full.txt for a routine question.
- CLI: add 'urlcode docs search TEXT [--json]', with parity to MCP search_docs
  (at most three bounded excerpts from the packaged agent docs corpus).
- Update docs/TOOLING.md, CLI capability matrix (capabilities --json tooling
  list) and CLI help/usage for the new command.
- Add a CLI test asserting bounded excerpt output and the no-args/unknown
  error cases.
- Add a changeset.

Closes #406

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@jimhoyd
jimhoyd merged commit 8ee2bc3 into main Sep 22, 2026
35 checks passed
@jimhoyd
jimhoyd deleted the issue-406-docs-search branch September 22, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Put function handler shape and args binding in llms.txt; add a docs search CLI

1 participant