The docspack command line
Every command, option and exit status, generated from the document the CLI's own parser and
--help are built from. What each command reads, writes or deletes is stated on it.
- Install
npm i -D docspack- Version
- 1.5.0
- Commands
- 23
For an agent: /cli.txt — every command in one line each. One command: /cli/<command>.md . The document itself: /cmdspec.json, in the cmdspec format.
docspack
Local, version-locked documentation for AI agents
docspack <command> [options]Options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
-v, --versionShow the version
--cmdspecPrint this program's own cmdspec document, as JSON
Commands
Index the docs packages this project depends on
Answer from the local index — the command to give an agent
Index this project's own sources, so an agent can ask them instead of reading them
Answer from this project's indexed corpus, not from its dependencies
Same index, formatted for a human reading the terminal
Show this project's docs packages and their index state
Wire docspack into the agent tooling this project already uses
What a library's exports gained and lost between two versions
Check the docs still describe the code you installed
Record documentation problems: add, list, submit, remove
Serve the index over MCP instead, as a long-lived process
List curated sources that `docspack build` can fetch
Scaffold a documentation package, then build and check it
Generate the .llms/ payload for publishing
Check a package the way the indexer and a reviewer would
Answer a query from the local package, as an agent would
Measure retrieval against a set of questions
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
docspack sync
Index the docs packages this project depends on
Reads node_modules and indexes every @vendor/docspack and @docspack-community/
It also reads each installed library’s own type declarations and indexes one entry per exported name. Half of a well-documented library’s exports are mentioned in no documentation anyone published, and those declarations are the only local answer for them. They are looked up by name, never ranked against prose, so they cannot crowd out the documentation that does exist.
A library that describes its own command line, with "cmdspec" in its package.json, has that description indexed as well, for the version installed.
docspack sync [options]Effects
effects: read, write; idempotent
Options
--forcere-index packages already in the store
--no-artifactsskip the declarations derived from installed libraries
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack sync
$ docspack sync --force
$ docspack sync --no-artifactsBuild a command line
docspack syncdocspack ask
Answer from the local index — the command to give an agent
Answers from the installed versions, in the Markdown an agent should read.
When the question names something an installed library exports and no documentation mentions, the answer leads with that name’s declaration from the installed build and says the documentation does not cover it. Ranking alone cannot tell that apart from a match. A question that names an endpoint (POST /v1/charges) or a command (git remote add) gets that operation or command first.
docspack ask <question>... [options]Effects
effects: read; idempotent
Arguments
<question>...requiredwords are joined with spaces
Options
-p, --package <s>only packages whose name contains this text
--limit <n>integer; at least 1; default 3maximum chunks to return
--max-tokens <n>integer; at least 1; default 3000token ceiling for the result set
--allsearch the whole store, not just this project
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Input and output
stdouttext/markdown, the answer
application/json, the chunks and their scores with --json
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
- 3nothing matched, and a docs package is installed but not indexed
Run `docspack sync`, then ask again.
- 4nothing matched, and everything installed is already indexed
Examples
$ docspack ask "how do I verify a webhook signature"
# Look in one package only, and return more
$ docspack ask "webhook signature" --package stripe --limit 5Build a command line
docspack ask <question>...docspack index
Index this project's own sources, so an agent can ask them instead of reading them
For a corpus this project already has rather than one somebody published: notes, an export, rows out of a query. Nothing is written but the index, in .docspack/local.db, which is a plaintext copy of whatever was indexed and is gitignored on the tool’s behalf.
Records arrive as JSON so no database driver is needed: sqlite3 -json … | docspack index --from-json -. A record with an id becomes one chunk under that id, because a row’s identity is its key.
What was indexed is recorded with each source’s size, mtime and hash, so a re-run does nothing when nothing has changed and recall can say when an answer may be superseded.
--repo indexes the repository at the working directory as two corpora. @local/repo-docs holds every Markdown file git tracks or would track, minus changelogs and test fixtures. @local/repo-code is a map of the code: one entry per top-level declaration holding its signature, doc comment and file:line, never its body, and one entry per workspace package. git decides what belongs to the project, so node_modules and build output are never read. They are separate because in one corpus the prose outranks the map; ask one with recall --name.
docspack index [options]Effects
effects: read, write; idempotent
Options
--repothis git repository's Markdown and a map of its code, as two corpora
--from <dir>directorydirectory of Markdown to package
--from-json <file>file; - means standard input or outputJSON records to index, or `-` for standard input
--name <s>default derived from the sourcename for the corpus
--forcere-index even when no source has changed
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Constraints
at most one of: --repo, --from
at most one of: --repo, --from-json
at most one of: --repo, --name
Input and output
stdinapplication/json, an array of records, each with text and optionally an id and a title with --from-json=-
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
# Index this repository's docs and a map of its code
$ docspack index --repo
$ docspack index --from ./notes
# Index rows straight out of a database
$ sqlite3 -json shop.db 'select id, title, body as text from posts' | docspack index --from-json -Build a command line
docspack indexdocspack recall
Answer from this project's indexed corpus, not from its dependencies
Separate from ask on purpose. ask answers from the versions this project installed, and a working corpus is never one of them — so a corpus cannot reach an answer about a dependency, and a dependency cannot reach an answer about your notes.
An answer leads with a warning when a source has changed since it was indexed.
docspack recall <question>... [options]Effects
effects: read; idempotent
Arguments
<question>...required
Options
--name <s>default every corpussearch one corpus only, by name, with or without `@local/`
--limit <n>integer; at least 1; default 3maximum chunks to return
--max-tokens <n>integer; at least 1; default 3000token ceiling for the result set
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Exit statuses
- 0success
- 1nothing matched
- 2the command was used wrongly
Examples
$ docspack recall "what did we decide about retries"
# Ask the map of this repository's code, after `index --repo`
$ docspack recall --name repo-code "where are requests forwarded to the backend"Build a command line
docspack recall <question>...docspack search
Same index, formatted for a human reading the terminal
The same index and ranking as ask, printed as a list of hits with a preview.
docspack search <query>... [options]Effects
effects: read; idempotent
Arguments
<query>...required
Options
-p, --package <s>only packages whose name contains this text
--limit <n>integer; at least 1; default 3maximum chunks to return
--max-tokens <n>integer; at least 1; default 3000token ceiling for the result set
--allsearch the whole store, not just this project
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
- 3nothing matched, and a docs package is installed but not indexed
- 4nothing matched, and everything installed is already indexed
Examples
$ docspack search webhook signatureBuild a command line
docspack search <query>...docspack list
Show this project's docs packages and their index state
Coverage is mechanical: the exported names a library declares, against the names its documentation mentions anywhere. It is reported, never gated on — a page listing every export and explaining none would score full marks.
docspack list [options]Effects
effects: read; idempotent
Options
--coveragehow much of each documented library's exports the prose mentions
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack list
$ docspack list --coverage
$ docspack list --jsonBuild a command line
docspack listdocspack agent
Wire docspack into the agent tooling this project already uses
install writes a marked block into AGENTS.md or CLAUDE.md — whichever the project already has — and a skill into .claude/skills/docspack/ when the project uses Claude Code. Everything outside the markers is left alone, and re-running rewrites the block rather than appending a second copy. With no subcommand, agent installs.
--recipe factory writes a way of working on top: rules for autonomous sessions in the block, a second skill, a SessionStart hook that indexes .factory/knowledge/ for recall, and a .factory/ layout of templates. Those .factory/ files are seeded — written once when absent and never again — so filling one in is never reported as drift.
--recipe repo is for working in an ordinary repository: rules in the block that send the agent to recall --name repo-code before it reads files to find something, four lines asking for fewer, larger tool calls, a docspack-repo skill, and a SessionStart hook that runs index --repo.
check writes nothing and exits non-zero when the wiring is missing or out of date, so CI notices a pasted instruction that has drifted from what the tool now does. It also prints what each instruction file costs, since the file is sent again on every turn, and over 1,000 tokens names its three largest sections.
docspack agent [<command>] [options]Effects
effects: read, write; idempotent
Options
--recipe <name>one of deps, factory, repothe way of working to write; read back from the block when omitted
--feedbackalso include recording documentation problems
--hooksadd a SessionStart hook that keeps the index in step
--mcpadd the MCP server to .mcp.json
--dry-runeffects become: readprint what would be written and write nothing
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Commands
Write the docspack block into AGENTS.md or CLAUDE.md
Fail when the wiring is missing or out of date
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack agent install --feedback --hooksBuild a command line
docspack agentdocspack agent install
Write the docspack block into AGENTS.md or CLAUDE.md
docspack agent install [options]Effects
effects: read, write; idempotent
Options
--dry-runeffects become: readprint what would be written and write nothing
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
--recipe <name>one of deps, factory, repothe way of working to write; read back from the block when omitted
--feedbackalso include recording documentation problems
--hooksadd a SessionStart hook that keeps the index in step
--mcpadd the MCP server to .mcp.json
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack agent install
$ docspack agent install --feedback --hooks
$ docspack agent install --recipe factory
$ docspack agent install --recipe repoBuild a command line
docspack agent installdocspack agent check
Fail when the wiring is missing or out of date
docspack agent check [options]Effects
effects: read; idempotent
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
--recipe <name>one of deps, factory, repothe way of working to write; read back from the block when omitted
--feedbackalso include recording documentation problems
--hooksadd a SessionStart hook that keeps the index in step
--mcpadd the MCP server to .mcp.json
Exit statuses
- 0success
- 1the wiring is missing or out of date
- 2the command was used wrongly
Examples
$ docspack agent checkBuild a command line
docspack agent checkdocspack changed
What a library's exports gained and lost between two versions
Compares two versions already in the global store, which is shared by every project on this machine, so nothing is fetched. Without a version it compares what is installed here against the most recently indexed other version.
Upgrades are overwhelmingly additive: the useful answer is what exists now that an older release did not have, and which of those names no documentation here mentions — the ones a model can know from neither its training data nor the vendor’s pages.
docspack changed <library> [options]Effects
effects: read; idempotent
Arguments
<library>required
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack changed hono
$ docspack changed hono@4.0.0Build a command line
docspack changed <library>docspack verify
Check the docs still describe the code you installed
Compares the identifiers the chunks name against what the documented libraries declare, read from their .d.ts files. Nothing you depend on is imported or executed. The libraries come from the manifest’s “documents”, or from the docspack key when the manifest has none.
docspack verify [options]Effects
effects: read; idempotent
Options
--package-dir <d>directoryverify one package directory instead of what is installed
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Exit statuses
- 0success
- 1anything was reported
- 2the command was used wrongly
Examples
$ docspack verify
$ docspack verify --jsonBuild a command line
docspack verifydocspack feedback
Record documentation problems: add, list, submit, remove
Writes to .docspack/feedback.jsonl in this project. Nothing is transmitted: docspack contains no code that can send a report anywhere.
drift must name the identifier that drifted. incorrect and missing must carry —expected, —actual and —repro, so a claim that cannot show its work cannot be recorded. submit prints a prefilled GitHub issue URL for a human to open and file.
docspack feedback <command> [options]Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Commands
Record one problem
Show recorded problems
Print a prefilled GitHub issue URL for a human to open
Delete recorded problems
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
docspack feedback add
Record one problem
docspack feedback add [options]Effects
effects: write
Options
--chunk <id>requiredthe chunk the problem is in
--kind <k>one of drift, incorrect, missing; default drift--evidence <text>requiredthe claim, in one line
--expected <text>what the documentation led you to expect
--actual <text>what happened instead
--repro <code>code that demonstrates it
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Constraints
--kind=incorrect requires: --expected, --actual, --repro
--kind=missing requires: --expected, --actual, --repro
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack feedback add --chunk @acme/docspack@1.4.0/api-auth --kind drift --evidence "client.setKey is not exported; setApiKey is"Build a command line
docspack feedback add --chunk <id> --evidence <text>docspack feedback list
Show recorded problems
docspack feedback list [options]Effects
effects: read; idempotent
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack feedback listBuild a command line
docspack feedback listdocspack feedback submit
Print a prefilled GitHub issue URL for a human to open
docspack feedback submit [options]Effects
effects: read; idempotent
Options
-p, --package <s>only findings from packages matching this text
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack feedback submitBuild a command line
docspack feedback submitdocspack feedback remove
Delete recorded problems
docspack feedback remove [<fingerprint>...] [options]Effects
effects: destructive; idempotent
Arguments
[<fingerprint>...]
Options
--allevery recorded finding
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Constraints
exactly one of: fingerprint, --all
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack feedback remove <fingerprint>Build a command line
docspack feedback removedocspack mcp
Serve the index over MCP instead, as a long-lived process
Serves the same index over the Model Context Protocol, for clients that prefer a tool definition to a shell command. query_local_docs returns exactly what ask prints. stdout is the protocol channel, so nothing else is written to it.
docspack mcp [options]Effects
effects: read; runs until stopped
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Input and output
stdinapplication/jsonl, MCP requests
stdoutapplication/jsonl, MCP responses
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack mcpBuild a command line
docspack mcpdocspack sources
List curated sources that `docspack build` can fetch
docspack sources [options]Effects
effects: none; idempotent
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack sources
$ docspack build hono --name @docspack-community/honoBuild a command line
docspack sourcesdocspack init
Scaffold a documentation package, then build and check it
Reads the surrounding project first — name, version, a docs directory, an OpenAPI document, the git remote, the license — and proposes a package built from what it found.
docspack init [<name>] [options]Effects
effects: read, write, network; prompts on a terminal unless --yes
Arguments
[<name>]package name
Options
-y, --yesskip the prompts and use flags plus detected defaults
--dry-runeffects become: readprint the file tree and write nothing
--mirror <id|url>bootstrap from a published llms.txt
--communityscaffold under @docspack-community
--template <t>one of full, minimal; default full--mode <m>one of standalone, in-repo--workflowundone by --no-workflowwrite the release workflow (the default)
--buildundone by --no-buildbuild and check after scaffolding (the default)
--name <name>package name, e.g. @acme/docspack
--pkg-version <v>package version
--from <dir>directorydirectory of Markdown to package
--openapi <file>fileOpenAPI JSON to package
--out <dir>directory; default ./docspackwhere to scaffold
--forceoverwrite files that already exist
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack init
$ docspack init --name @acme/docspack --from ./docs --yes
$ docspack init --mirror hono --community --yesBuild a command line
docspack initdocspack build
Generate the .llms/ payload for publishing
Splits each document at ## headings, then ###, then paragraphs, until every chunk fits the budget. —min-chunk-tokens packs the other way first, merging adjacent sections up to the budget: use it for generated reference, where a heading is a field name and one chunk per heading is hundreds of chunks too small to answer anything.
—openapi writes one chunk per operation: the base URL, the credential, the inputs with their types, the response, the failures and a runnable curl call, in LAPIS notation. Each chunk answers to both POST /v1/charges and the operationId, so docspack ask can be given either. Combine it with —from to publish prose and an API in one package.
—cmdspec writes one chunk per command of a command-line interface described in cmdspec, or in OpenCLI or Usage, converted: the synopsis, the inputs with their types and defaults, what the command changes, what it prints and what its exit status means. Each chunk answers to its command path, so docspack ask "git remote add" pins it.
With no flags, settings are read from the docspack key of the package.json in —out.
docspack build [<source>] [options]Effects
effects: read, write, network; idempotent
Arguments
[<source>]a curated source to fetch, from `docspack sources`
Options
--from <dir>directorydirectory of Markdown to package
--openapi <file>fileOpenAPI 3 document (JSON or YAML), one chunk per operation
--cmdspec <file>fileCLI description (cmdspec, OpenCLI or Usage), one chunk per command
--from-json <file>file; - means standard input or outputJSON records to package, or `-` for standard input
--name <name>package name, e.g. @acme/docspack
--pkg-version <v>package version
--out <dir>directory; default the current directoryoutput directory
--pages <n>integer; at least 1maximum documents to fetch from a remote source
--max-chunk-tokens <n>integer; at least 1; default 800split a section above this size
--min-chunk-tokens <n>integer; at least 1pack adjacent sections up to this size before splitting
--documents <p>repeatablelibrary this package documents, such as acme@1.4.0
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Constraints
at most one of: source, --from
at most one of: source, --openapi
at most one of: source, --cmdspec
at most one of: source, --from-json
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack build
$ docspack build --from ./docs --name @acme/docspack --pkg-version 1.4.0
$ docspack build --from ./reference --min-chunk-tokens 400 --max-chunk-tokens 900
$ docspack build --openapi ./openapi.json
# Prose and an HTTP API in one package
$ docspack build --from ./docs --openapi ./openapi.json
$ docspack build --from ./docs --cmdspec ./cmdspec.yamlBuild a command line
docspack builddocspack doctor
Check a package the way the indexer and a reviewer would
Errors are packages that will not index. Warnings are packages that will index and retrieve badly. Prose style is a note unless —pedantic, because writing by hand is not a reason to block a first publish.
docspack doctor [options]Effects
effects: read; idempotent
Options
--stricttreat structural warnings as failures
--pedantic--strict, and fail on prose style as well
--package-dir <d>directory; default .the package to read
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Exit statuses
- 0success
- 1the package is not ready to publish
- 2the command was used wrongly
Examples
$ docspack doctor
$ docspack doctor --strict
$ docspack doctor --jsonBuild a command line
docspack doctordocspack preview
Answer a query from the local package, as an agent would
Indexes the package in memory and answers through the same ranking and token budget an agent gets. Nothing is published, installed, or written to the global store.
docspack preview <query>... [options]Effects
effects: read; idempotent
Arguments
<query>...required
Options
--package-dir <d>directory; default .the package to read
--limit <n>integer; at least 1; default 3maximum chunks to return
--max-tokens <n>integer; at least 1; default 3000token ceiling for the result set
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Exit statuses
- 0success
- 1the command failed
- 2the command was used wrongly
Examples
$ docspack preview "how do I authenticate"Build a command line
docspack preview <query>...docspack eval
Measure retrieval against a set of questions
The evaluation set is a JSON array of questions and the chunk ids that would answer them:
[{ "query": "how do I verify a webhook signature", "expect": "webhooks-signing" },
{ "query": "rate limits", "expect": ["rate-limits", "errors"] }]Reports hit rate, top-1 rate and mean answer size — the numbers that settle the chunk budget, which no structural check can see. With —min-hit-rate it gates a publish on retrieval quality the way doctor --strict gates it on structure.
docspack eval <queries> [options]Effects
effects: read; idempotent
Arguments
<queries>requiredfile
Options
--package-dir <d>directory; default .the package to read
--limit <n>integer; at least 1; default 3chunks per answer, the window a hit must fall in
--max-tokens <n>integer; at least 1; default 3000token ceiling for each answer
--min-hit-rate <n>number; 0 to 100exit 1 below this percentage of questions answered
Inherited options
--store <path>file; default ~/.docspack/store.db; env DOCSPACK_STOREUse a different index
--cwd <dir>directory; default the current directoryRun in a different directory
--jsonMachine-readable output
-q, --quietOnly print errors
-h, --helpShow this help, or a command's help
Exit statuses
- 0success
- 1the hit rate is below --min-hit-rate
- 2the command was used wrongly
Examples
$ docspack eval ./eval/queries.json
$ docspack eval ./eval/queries.json --min-hit-rate 90
$ docspack eval ./eval/queries.json --limit 1 --jsonBuild a command line
docspack eval <queries>
Generated from cmdspec.json by @docspack/sheaf-react. Each command's builder writes a command line to copy; it
runs nothing.