@agentdoc/cli
v0.3.5
Published
agentdoc CLI - create, pull, push, and manage markdown agentdocs
Maintainers
Readme
@agentdoc/cli
The official CLI for AgentDoc — the fastest way to turn AI-generated markdown into a shareable URL.
npm install -g @agentdoc/cli
agentdoc login
agentdoc create "My first doc"The CLI exposes every public-API capability — docs, projects, tags, collaborators, webhooks, API keys, workspaces, approvals — so anything you can do in the browser or via the REST API, you can do from your terminal.
Quickstart
1. Sign in
agentdoc loginOpens a browser to authorize the device — no API key needed. Or pass one directly:
agentdoc login --key ad_sk_xxx2. Create a shareable doc
agentdoc create "Deploy Checklist" # empty stub
agentdoc create "Deploy Checklist" --file deploy.md # upload a local file as the body
agentdoc create --file deploy.md # title auto-derived from the file's first H1
agentdoc create --file deploy.md --project engineering -t runbook -t deploy
agentdoc share deploy-checklist # refresh the unlisted link
agentdoc publish deploy-checklist
# → public only after publishNew docs default to UNLISTED: anyone with the tokenized URL can open them, but they are not publicly indexed. Use --visibility PRIVATE for owner-only drafts or agentdoc publish <slug> when you explicitly want a public page.
3. Track local files like git
mkdir my-docs && cd my-docs
agentdoc init
agentdoc track changelog.md
agentdoc push # push local → remote
agentdoc pull # pull remote → local
agentdoc status # what's changed?Every tracked file is linked to a remote doc by slug. Edit locally, push when ready.
4. Group docs into projects
agentdoc project create "Engineering"
agentdoc project assign deploy-checklist engineering # creates the project if needed
agentdoc project clone engineering # clone whole project to a folder
agentdoc config set project engineering
agentdoc config set tags engineering,runbookProjects and tags should be set when the doc is created, not after a cleanup pass. Use --project and repeat --tag / -t on create, update, track, fork, import, or standalone push so docs land in the right collection with useful discovery labels from the start. When --project <slug> names a missing project, the CLI creates a private project automatically.
5. Collaborate with humans and agents
agentdoc collab invite deploy-checklist --email [email protected] --role EDITOR
agentdoc agent add deploy-checklist <api-key-id> --role EDITORCommand groups
Run agentdoc --help for a complete list, or browse the full reference at agentdoc.com/docs/cli.
| Group | What it does |
| ------------ | ---------------------------------------------------------------------- |
| login / whoami / logout | Device-flow auth, account info |
| create / list / info / share / publish / delete / fork | Doc CRUD |
| update / edit | Full-content replace vs. partial str_replace edits (--replace … --with …, optional --expected-sha for CAS) |
| search / browse / history / diff | Discovery and version diffing |
| init / track / push / pull / status | Local file tracking |
| project | Projects: CRUD, share, collab, agents, activity |
| collab / agent | Doc collaborators (humans + agents) |
| tag / star / comment / react / notifications / activity | Engagement |
| webhook | Webhook subscriptions |
| keys / workspace | API keys, custom domain, branding |
| review | Approval workflow (Pro/Scale) |
| stats / top | Workspace analytics |
| export / import | Bulk doc I/O as .md files |
| install <agent> | Wire the AgentDoc MCP into Claude Desktop, Cursor, Windsurf, etc. (for claude-code, also installs SKILL.md into ~/.claude/skills/agentdoc/) |
Configuration
Credentials and config live in ~/.agentdoc/config.json:
{
"apiKey": "ad_sk_xxx",
"userId": "...",
"email": "[email protected]",
"workspaceId": "...",
"apiUrl": "https://api.agentdoc.com"
}Override the API base for self-hosting or local dev:
AGENTDOC_API_URL=http://localhost:4000 agentdoc listLocal file tracking (.agentdoc/)
A directory becomes a tracked workspace once you run agentdoc init. State lives in .agentdoc/:
config.json— workspace + project defaultstracking.json— manifest of tracked files (slug, version, content hash, per-file settings)
Locking, per-file visibility, and project assignment are configurable via:
agentdoc lock <file> # block accidental push/pull
agentdoc config file <file> visibility UNLISTED
agentdoc config file <file> project engineering
agentdoc config file <file> tags engineering,runbookFull tracking docs: docs/local-tracking.md in the monorepo.
Requirements
- Node.js 20 or newer
- An agentdoc.com account (free) — or skip the account and use anonymous API keys via the REST API
Links
- Product: agentdoc.com
- REST API docs: agentdoc.com/docs
- Full CLI reference: agentdoc.com/docs/cli
- Source: github.com/daveosterjr/agentdoc (
packages/cli) - Issues: github.com/daveosterjr/agentdoc/issues
License
MIT
