Doc Bridge
Spec

Complete command reference for indexing, querying, gates, doctor, memory, and MCP.

View raw Markdown · llms.txt · For agents

ak-docs CLI

Command-line interface for @agentskit/doc-bridge. The npm package is scoped; the only published binary is ak-docs.

Naming

WhatName
npm package@agentskit/doc-bridge
CLI binaryak-docs
Config filedoc-bridge.config.ts
GitHub repoAgentsKit-io/doc-bridge

Install the package, run ak-docs — not doc-bridge on the shell.

Why a separate binary

ChoiceRationale
ak-docs, not agentskit docsDedicated tool; no need for full @agentskit/cli
ak-docs, not an OS subcommandOS CLIs imply sidecar / runs / pipelines
@agentskit/doc-bridge packagePart of AgentsKit npm scope; engine + first consumer alignment
ak-docs bin nameShort, memorable CLI; avoids colliding with package import path

Install

npm install @agentskit/doc-bridge
# or
pnpm add -D @agentskit/doc-bridge
{
  "name": "@agentskit/doc-bridge",
  "bin": {
    "ak-docs": "./bin/ak-docs.js"
  }
}

Commands (v1)

Layer 0 — no API key

CommandDescription
ak-docs initScaffold doc-bridge.config.json + agent INDEX stub
ak-docs init --scaffold-workspacesAlso create draft docs/for-agents/packages/*.md from discovered pnpm workspaces; never overwrites existing docs
ak-docs bootstrap agent-docsCreate draft docs/for-agents/human/*.md from configured human-doc adapters; never overwrites existing docs
ak-docs validate-configZod-validate config file
ak-docs demo [--fixture example|monorepo] [--text]Bundled 60s wow path: handoff, gate red→green, MCP snippet
ak-docs doctor [--text] [--badge] [--write-badge]Coverage score, gaps, gates, shields.io badge
ak-docs indexBuild DocBridgeIndex + optional llms.txt
ak-docs index --watchDebounced rebuild on agent/human doc changes
ak-docs query <target> [--agent] [--text]Resolve package/module/intent/change → handoff JSON or text
ak-docs search <term> [--agent] [--text]Full-text search over index
ak-docs ask <question>Human-readable local consult mode: search + best match + next handoff commands; no LLM
ak-docs askInteractive local REPL in a TTY; commands: search <term>, read <id-or-path>, open <id-or-path>, resolve <id>, gate [id], exit
ak-docs retrieve <query>Hybrid local/federated retriever chunks; deterministic local first
ak-docs init --demo / defaultScaffold demo ownership (example) + AGENTS.md snippet so query --agent works immediately
ak-docs init --no-demoConfig + empty INDEX only
ak-docs memory ingestNormalize local memory files (.agent-memory/**/*.md, .cursor/rules/*.mdc) into MemoryCandidate[]
ak-docs memory classifyDeterministically route candidates to agent/human/playbook/discard
ak-docs memory promoteBuild draft-only promotion body with safety scan; never auto-merges
ak-docs memory promote --pr [--dry-run] [--force]Write draft + open GitHub draft PR via gh
ak-docs registry topologyPrint the doc-curator topology for AgentsKit/Registry composition
ak-docs playbook draftBuild a draft Playbook feedback payload from local memory candidates
ak-docs playbook pattern [--text]Export published Doc Bridge Playbook pattern (OKF markdown / JSON)
ak-docs list <kind> [--text]List packages, apps, intents, …
ak-docs gate run [index-freshness]Check generated index freshness
ak-docs conformance run documentation-standard-v1 [--text|--json]Run the stable ecosystem documentation profile with evidence and remediation
ak-docs mcpStart MCP server (stdio default)
ak-docs mcp install --cursor | --claudeWrite MCP server config for Cursor or Claude Desktop

Layer 1 — optional AgentsKit peers (intelligence.enabled)

CommandDescription
ak-docs rag ingestIngest agent corpus into @agentskit/rag + file vector store
ak-docs rag search <query>Semantic search over ingested vectors
ak-docs chatInteractive terminal chat (@agentskit/ink + retriever + adapter)
ak-docs ask <question> --chatOne-shot grounded answer (handoffFirst when possible)

Peers: @agentskit/rag, @agentskit/ink, @agentskit/adapters, @agentskit/memory, react.

Global flags

FlagDescription
--config <path>Config file (default: auto-discover)
--json / --textOutput format for non-agent commands (default: json); --agent always emits agent JSON
--chatRequest planned intelligence-backed ask mode; errors clearly until intelligence.adapter and RAG/chat support are configured
--helpCommand help

Examples

ak-docs index
ak-docs query ownership auth --agent
ak-docs query ownership auth --text
ak-docs search "sidecar transport" --agent
ak-docs list packages --text
ak-docs gate run
ak-docs mcp

MCP server config (Cursor)

{
  "mcpServers": {
    "ak-docs": {
      "command": "ak-docs",
      "args": ["mcp"]
    }
  }
}

Programmatic API

import { buildIndex, query, defineConfig } from '@agentskit/doc-bridge'

export default defineConfig({ schemaVersion: 1, corpus: { agent: { root: 'docs' } } })

CLI is a thin wrapper over the same exports.

MCP_TOOLS exports the static tool descriptors used by tools/list.

Private Dogfood Alias

pnpm docs:internal:query   # private dogfood wrapper → ak-docs query …

Private repo wrappers stay private. ak-docs is the only public binary.

See also

The AgentsKit ecosystem

Build the agent. Then take it all the way.