CLI
The agentdoc CLI lets you create, edit, and publish docs from your terminal. Requires Node 20+.
Install
npm install -g @agentdoc/cliSign in
Opens your browser to authorize the device. No API key required.
agentdoc loginEveryday commands
A handful you'll reach for most often.
Create a new doc by title.
agentdoc create "Deploy Checklist"Create a doc from a local .mdfile. Title is auto-derived from the file's first H1 if you omit it.
agentdoc create --file deploy-checklist.md
agentdoc create "Deploy Checklist" --file deploy-checklist.md
agentdoc create --file deploy-checklist.md --project engineering -t runbook -t deployPush a local .md file into an existing doc.
agentdoc push README.md deploy-checklistList your docs.
agentdoc listPublish a doc so it's public at /@you/slug.
agentdoc publish my-slugOpen a doc in your browser.
agentdoc open my-slugAppend + find
Two atomic primitives so you don't have to read-then-edit for runlogs and don't have to paginate big docs to find a spot.
Append — adds to the end (default), the start, or the bottom of a named section. Concurrency-safe: two appends from different agents both land.
agentdoc append my-runlog "- 2026-05-09: deploy succeeded"
agentdoc append my-runlog --file entry.md
agentdoc append my-runlog --position after_heading --heading "## Log" --file entry.mdFind — locate matches inside one doc. Returns line/column/offset plus a snippet of context. Use it to jump to the right spot in a long doc instead of paginating through.
agentdoc find my-doc "TODO" --limit 50Focused edits
Change a doc without re-uploading the whole file. Two edit shapes, mix in one call:
String replace — like sed. Repeat the pair to batch.
agentdoc edit deploy-checklist \
--replace "- [ ] Run tests" --with "- [x] Run tests" \
-m "tests passed"Section replace — swap an entire markdown section by heading. The hash count bounds it: ## Foo stops at the next ## or #. Read the new body from a file with @path.
agentdoc edit deploy-checklist \
--section "## Rollback" --with-section @rollback.md \
-m "rewrite rollback steps"Pass --expected-sha (from agentdoc info's contentSha) for optimistic concurrency — the edit is rejected with HTTP 409 if someone else changed the doc first.
Projects and tags
Put docs in the right project and add useful tags when you create or track them. This keeps agent-created docs from turning into an orphaned list.
agentdoc project create "Engineering"
agentdoc create --file deploy-checklist.md --project engineering -t runbook -t deploy
agentdoc config set project engineering
agentdoc config set tags engineering,runbook
agentdoc track docs/api.mdUploading markdown from disk
If the markdown is already a file on disk, don't read it into the conversation and paste it into a flag. Hand the server the path instead — it opens the file directly, which saves tokens and avoids truncation for larger files. Three surfaces, same rule:
- CLI:
agentdoc create --file <file>to create a new doc from a file,agentdoc push <file> <slug>to push into an existing one, oragentdoc track <file>plus repeatedagentdoc pushfor a Git-like workflow. - MCP (local stdio): pass
file_pathtocreate_docorupdate_doc— this is the default calling pattern whenever a local.mdexists. Fall back tocontentonly for text generated in-conversation. The remote MCP atmcp.agentdoc.comdoesn't exposefile_path(it runs on our infra, not your machine) — use the CLI or REST upload below from there. - REST:
curl --data-binary @file.mdwithContent-Type: text/markdown. Skips JSON-escape overhead. See the API reference.
Track local files
Like git for markdown — link a local .md file to a remote agentdoc, then push and pull.
Initialize tracking in the current directory.
agentdoc initLink a local file to a remote doc.
agentdoc track README.mdSee what's out of sync, then push or pull.
agentdoc status
agentdoc push
agentdoc pullFull command list
Every command supports --help with flags, arguments, and examples.
agentdoc --help
agentdoc <command> --helpLooking for the HTTP API instead? See the REST API docs →