# OpenDocs documentation (full text) Source: https://docs.opendocs.cc --- URL: https://docs.opendocs.cc/
Documentation
, and the nested paragraph breaks React hydration. */}
OpenDocs turns the Markdown your agent writes into organized, shareable links and on-brand PDF and Word files. You don't learn a tool: you paste one prompt into your agent, then ask for what you need in plain words.
Your agent installs OpenDocs, emails you a sign-in code and asks what to publish. Free for up to 50 documents. Walk through the quickstart or sign up in the browser.
## Then just ask“Publish the Q3 investor update to the Investors project and send me the PDF.”
A link your workspace can open, and a branded PDF next to the file.
“Share the onboarding handbook with {"dana@halvard.example"}.”
Dana gets an email and can read that one document.
“Use the Boardroom preset with our logo.”
Every PDF and Word file follows your brand from now on.
“Roll the pricing spec back to yesterday’s version.”
The old version comes back as a new one. Nothing is lost.
More things to ask your agent
## Find your way around --json # finishes; saves an API key
```
A new email gets an account, a workspace at `opendocs.cc/` and a
Default project. On `invalid_code`, ask for the newest email; on `code_expired`,
run the first command again. **Never run bare `opendocs login`**: without
`--email` or `--key` it waits for input and your tool call hangs.
- **Several workspaces:** if they name one, run `opendocs workspace list --json`
and `opendocs workspace use `.
## 2. Say it's ready and ask what to publish
Tell them which workspace they're in and that the Free plan covers 50 documents.
Ask what they'd like to publish. If they're unsure, offer something from the
current folder: the README, recent notes, a summary of the work you just did.
## 3. Publish
```bash
opendocs publish report.md --json
opendocs publish report.md --export pdf --json # also writes report.pdf next to it
opendocs publish ./docs --tags "q3-review" --json # a folder or several files: one batched call
opendocs publish proposal.md --project "Northwind" --json
```
- **Visibility defaults to `workspace`**: only members of their workspace can open
it. That's right for "share with the team".
- **Publishing the same file again updates it**: same URL, new version. The
folder's `.opendocs/state.json` remembers which file is which document. Don't use
`--new` unless they want a separate copy.
- **Never loop `publish` once per file.** Pass the folder or all the files at once.
- **Exports:** `--export pdf` works on every plan; `--export docx` needs Pro or
Team. Re-running `publish --export pdf` after edits updates what changed
and exports every file.
- **Projects work like branches.** If the document belongs to a client, product or
team, pass `--project`. Run `opendocs project list --json` first and reuse an
existing project rather than creating a near-duplicate. Follow the `organize`
preference from `whoami`: `ask` (ask before creating a project), `auto` (create
and say so) or `off` (use the active project).
## 4. Report back
- Put the full URL on its own line: the `url` field is a path such as
`/halvard/q3-review`, so prefix `https://opendocs.cc`.
- Say who can open it: "your workspace" (default), "only you", "the people you
shared it with" or "anyone with the link".
- After an export, give the file path (`export.path`). After an update, say which
version it is now. Say which project it went to if it isn't the usual one.
- If something failed, quote the error's `message`. It says what to do next.
## Ask before you do these
| Action | Why | How |
| --- | --- | --- |
| Make a document public | Anyone on the internet can read it | Ask, then `--visibility public --confirm-public` |
| Change the export theme | It changes every PDF and Word file in the workspace | Show the preset or color and font, ask, then `opendocs theme set ... --yes` |
| Send a document for signing | Real people get an email | Create the draft, show the signers, send only after a clear yes: `opendocs sign send --yes` |
| Delete a document | It can't be undone | Prefer `opendocs unpublish`. Delete only when asked, with `--yes` |
| Overwrite after a `version_conflict` | Someone else published a newer version | Show it, `opendocs pull` to compare, `--force` only if they agree |
| Invite someone to the workspace | It sends an email | Confirm the exact address and role |
For "share it with the client", prefer `opendocs share client@example.com`
over making it public.
## Errors you'll meet
- `document_limit`: the Free plan's 50 documents are used. Tell them; suggest
unpublishing old documents or upgrading. Don't retry.
- `docx_requires_pro` or `plan_required`: Word export, a custom export footer
and integrations need Pro or Team. Offer a PDF instead, or point them to
[billing](https://opendocs.cc/dashboard/billing).
- `rate_limited`: the CLI waits for the time the server asks and retries on its
own. Don't add your own retry loop, and don't run exports in parallel.
- Everything else: the [error reference](../errors.md).
## Next
- [Agent cookbook](../agents/cookbook.md): recipes for folders, projects,
versions, sharing, branding, Google Drive and signatures.
- [CLI reference](../cli/reference.md): every command and flag.
- [llms.txt](https://docs.opendocs.cc/llms.txt): every docs page as Markdown.
---
URL: https://docs.opendocs.cc/agents/cookbook
# Agent cookbook
These are the recipes an agent follows when someone asks for something in
OpenDocs, with the exact commands for CLI 0.4.7. If you're a person, you don't
need this page: ask your agent, and see
[What to ask your agent](../getting-started/what-to-ask.md) for ideas. If
you're building an agent or tool, this is the behavior to copy.
"You" below is the agent. "The person" is whoever you're working for.
## Before you start
- **Install and sign in.** The CLI is `npm install -g @opendocs.cc/cli`
(Node.js 20+). Without Node.js, run
`curl -fsSL https://opendocs.cc/install.sh | bash` and use
`bash ~/.claude/skills/opendocs/scripts/opendocs.sh` in place of `opendocs`;
it covers sign-in, publish, list, pull, history, share, export, team invites
and the theme, but not Drive, signatures or `--export` on publish.
- **Pass `--json` on every command.** stdout is one JSON object. Errors go to
stderr as `{ "error", "message", "docs_url" }` with a non-zero exit.
- **`` is a post ID, a slug, or a local `.md` file this folder
published.**
- **Links.** API `url` fields are paths such as `/halvard/q3-investor-update`;
prepend `https://opendocs.cc`. Put each link on its own line with nothing
after it.
- **Say who can open it**: workspace members (the default), only them
(private), the people it's shared with, anyone (public), or anyone with the
link for 24 hours (anonymous).
- **Check before anything that reaches other people or is hard to undo**:
public visibility, invitations, theme changes, signature requests, deletes.
## Sign the person up
When there's no saved login (any command, `opendocs whoami --json` included,
fails with `not_logged_in`), ask for their email and sign them up. It's free for up to 50
documents and needs no browser.
```bash
opendocs login --email dana@halvard.example --json
# → {"status": "code_sent", ...}. Ask: "Check your inbox for a code from OpenDocs and paste it here."
opendocs login --email dana@halvard.example --code 482913 --json
```
A new email gets an account, a workspace at `opendocs.cc/`, a Default
project and an API key named after you, saved to
`~/.config/opendocs/config.json`. Codes expire after 10 minutes and allow 5
tries: on `invalid_code` ask for the newest email, on `code_expired` send a new
one. Never run bare `opendocs login`; it waits for a key on stdin. If login
returns `pendingInvitations`, ask before joining any of them.
## Publish without an account
Only when the person doesn't want an account yet and agrees that anyone with
the link can read it:
```bash
opendocs publish notes.md --anonymous --json # url, claimUrl, expiresAt
```
Give them the `url` and the `claimUrl` exactly as returned, say it expires in
24 hours, and offer to sign them up. Logging in later from the same folder
keeps the document (or run `opendocs claim`). Anonymous publishing allows 30
documents an hour and 100 a day per IP, 10 files per run and 512 KB per file.
## Publish a document and send a PDF
"Publish the Q3 investor update to the Investors project and send me the PDF."
```bash
opendocs project list --json
opendocs publish q3-investor-update.md --project investors --export pdf --json
```
The result has the `url` and `export.path`, the PDF written next to the source
file. Tell them both. PDF works on every plan, with the workspace's export
theme; Free PDFs carry a "Made with OpenDocs" footer. Word (`--export docx`) needs Pro or
Team. If the publish succeeds and the export fails, the document stays up;
retry only the export:
```bash
opendocs export q3-investor-update --format pdf --json
```
`opendocs export` writes a PDF unless you pass `--format docx` (Pro and Team).
## Publish a folder
"Upload all the board pack docs." One command, never a loop:
```bash
opendocs publish ./board-pack --tags q3-board --json
opendocs publish ./board-pack --tags q3-board --export pdf --json # with PDFs
```
- Folders are recursive and skip `.obsidian`, `.trash`, `.git`, `.hg`,
`.opendocs` and `node_modules`.
- The CLI sends 25 documents per request and takes up to 500 files per run;
each file can be up to 1 MB.
- The result has `total`, `succeeded`, `failed` and `results[]` (plus
`export.results[]` with each PDF's `path`). A run with some failures still
exits 0: check `failed` and retry only those files.
- The shared tag is how the person finds the group later:
`opendocs list --tag q3-board --json`.
## Re-export a folder after edits
"I've fixed the numbers, send me fresh PDFs." Run the same command again from
the same folder:
```bash
opendocs publish ./board-pack --export pdf --json
```
In CLI 0.4.6 this updates the files that changed (`updated[]` with
`action: "updated"`), leaves the rest alone (`"unchanged"`, no new version) and
writes a fresh PDF for every file in the folder. Report the new version numbers
and the PDF paths.
## Keep a folder in sync
The CLI records what each folder published in `.opendocs/state.json`, so
publishing a file again updates the same document. To work on what's already
online:
```bash
opendocs clone --json # whole workspace into ./
opendocs clone board-pack --project board --json
opendocs status --json # up-to-date, modified, behind, conflict, untracked
opendocs pull board-pack/agenda.md -o board-pack/agenda.md # bring a "behind" file up to date
opendocs publish . --json # publish every change; new files become new docs
```
On `version_conflict` (someone published since your last sync), stop. Show the
person, compare with `opendocs pull --stdout`, and re-run with `--force`
only if they want their copy to win. Don't commit `.opendocs/`; the CLI
git-ignores it because it holds claim tokens.
## Update a document this folder didn't publish
If the person names a document published elsewhere, use its slug:
```bash
opendocs list --json --limit 20 # if you're not sure which one
opendocs pull q3-investor-update --stdout > q3-investor-update.md
# edit the file
opendocs update q3-investor-update.md --post-id q3-investor-update --json
```
`update` adds a version and keeps the link. Omitted `--visibility` and
`--tags` keep their current values. It has no `--export`; run
`opendocs export` afterwards. Any active workspace member can update any
document in the workspace, and the version history records who did.
## Put documents in the right project
Projects work like branches in a repository: one per client, product or
initiative. Before publishing, know where the document will go:
```bash
opendocs whoami --json # organize: ask | auto | off, and folderProject
opendocs project current --json # where the next publish goes, and why
opendocs project list --json # names, document counts, recentTitles
```
- An existing project clearly fits: publish with `--project ` and say
where it went.
- A new, ongoing topic: with `organize: ask` (the default), ask once ("Want me
to start a Brightwater project for this?"). With `auto`, create it and say
so. With `off`, use the active project.
- A folder or repository dedicated to one topic: `opendocs project link "Brightwater"`
once, and every new file published from there goes to that project.
- A one-off note: the active or Default project is fine.
```bash
opendocs publish proposal.md --project "Brightwater" --json # a new name creates the project
opendocs move old-proposal --project archive --json # the URL changes; ask first
opendocs config set organize auto --json # when the person says "stop asking"
```
Default-project URLs are `opendocs.cc//`; project URLs are
`opendocs.cc//projects//`.
## Switch workspace before publishing
When the person names a workspace, check it's the active one:
```bash
opendocs workspace list --json # match their words to name or slug
opendocs workspace use halvard-board --json # only if activeSlug differs
```
Switching only changes the CLI's local config and resets the active project to
that workspace's Default. If the workspace isn't listed (`not_a_member`), tell
them which ones are.
## Versions and rollback
"What changed in the investor update?" or "Go back to Tuesday's version."
```bash
opendocs history q3-investor-update --json # newest first, who and which agent published
opendocs pull q3-investor-update --version 3 --stdout # read an old version
opendocs rollback q3-investor-update 3 --json # publish v3 again as a new version
```
Rollback never deletes history, so it can itself be undone. Tell them the new
version number.
## Choose visibility safely
```bash
opendocs publish plan.md --json # workspace (default)
opendocs publish salary-bands.md --visibility private --json # only them
opendocs visibility launch-faq public --confirm-public --json # anyone with the link
```
"Share with the team" means keep `workspace`. Use `public` only when the
person explicitly asks for a public link, and say anyone with it can read the
document. Public also needs the workspace's **Allow public documents** setting.
Changing visibility, moving, sharing, unpublishing and deleting are for the
document's author and the workspace's owners and admins.
## Share with specific people
Prefer this to making a document public when the person wants to send it to a
client, investor or contractor:
```bash
opendocs share q3-investor-update.md sam@halvard.example --json # emails Sam a link
opendocs share q3-investor-update.md @brightwater.example --no-notify --json
opendocs share q3-investor-update.md --json # who has access
opendocs share q3-investor-update.md sam@halvard.example --remove --json
```
Guests verify their email with a code and can read only that document; they
don't join the workspace.
## Invite teammates
"Add Sam to the workspace." Confirm the exact email and the role (`member`
unless they say admin), because it sends an email:
```bash
opendocs team invite sam@halvard.example --json
opendocs team invite sam@halvard.example --role admin --json
opendocs team list --json # members, pending invitations, auto-join domains
```
Tell them Sam has to accept the email. `team remove` and `team leave` need
`--yes`, passed only after the person confirms. Free workspaces have 3 members
and Pro workspaces 5; `member_limit` means an owner needs to upgrade.
## Change the export theme (ask first)
The theme (preset, brand color, font, logo, footer) changes every PDF and Word
file in the workspace. It's Pro and Team only, and only owners and admins can
change it. Propose, wait for a yes, then apply:
```bash
opendocs theme --json # current theme and canEdit
opendocs theme presets --json # classic, boardroom, editorial, research, studio,
# field-guide, letterpress, terminal, launch
opendocs theme check "#13294B" --json # contrast check, changes nothing
opendocs theme set --preset boardroom --yes --json
opendocs theme set --color "#13294B" --font "IBM Plex Sans" --yes --json
opendocs theme logo ./halvard-logo.png --yes --json
opendocs theme set --logo-in-exports on --yes --json
opendocs theme footer --company "Halvard" --tagline "Investor relations" --link-url halvard.example --yes --json
opendocs export q3-investor-update --format pdf --json # preview for the person
```
The brand color must be dark: at least 4.5:1 against white, or the API refuses
it with `low_contrast`. Use the deepest shade of the brand's hue. Without
`--yes` outside a terminal these commands stop with `confirm_required`;
`plan_required` means the workspace is on Free, `forbidden` means the person
isn't an owner or admin.
## Save to Google Drive
Pro and Team, once an owner or admin has connected Drive and named the folders
in the dashboard's **Integrations** tab. Only save when the person asks.
```bash
opendocs integrations --json # integrations[].destinations[].name, settings, dashboardUrl
opendocs save q3-investor-update.md --folder "Investor updates" --json # PDF
opendocs save board-minutes-oct --folder "Board Minutes" --format docx --version 3 --json
```
Use a folder name exactly as `opendocs integrations` lists it. If their words
match none or several, ask. Give them `file.url` on its own line;
`file.verified: true` means Drive's checksum matches what OpenDocs rendered.
See [Google Drive](../integrations/google-drive.md).
## Request signatures
Pro and Team, with DocuSeal connected. Signing is always two steps, never one.
1. **Draft.** Use only names and emails the person gave you or the document
states; ask for anything missing. Nothing is emailed yet.
```bash
opendocs sign request offer-letter.md \
--signer "Employee=Priya Natarajan " \
--signer "Company=Dana Whitfield " \
--subject "Please sign: Offer letter" \
--expires 2026-11-30 --file-to "Signed agreements" --json
```
2. **Confirm.** Read back the summary: document and version, each signer and
email with their role, the order (one after another, or all at once with
`--parallel`), subject, expiry, where the signed copy is filed, and any
`warnings`. Offer the exact PDF they'll receive:
```bash
opendocs sign download --kind draft
```
3. **Send** only after an explicit yes. "Looks fine?" or silence is not a yes.
```bash
opendocs sign send --yes --json
```
If `confirmation.mode` is `browser`, your API key can't send
(`approval_required`): give them `confirmation.approveUrl` on its own line and
ask them to click Send there. If they change anything, cancel the draft
(`opendocs sign cancel --yes`) and request a new one. Later:
```bash
opendocs sign status --json # draft, pending, completed, declined, expired, cancelled, failed
opendocs sign download # signed PDF; --kind audit for the certificate
opendocs sign save --folder "Signed agreements" --json
```
Check status when asked; don't poll in a loop. A `signature` fenced block in the
document marks where each role signs. See
[E-signatures with DocuSeal](../integrations/docuseal.md).
## Handle errors
Read `error` and quote `message` to the person; it says what to do next.
| Error | What to do |
| --- | --- |
| `not_logged_in` | Sign them up (above). |
| `invalid_code`, `code_expired`, `too_many_attempts` | Ask for the newest code, or send a new one. |
| `version_conflict` | Stop and show them. `--force` only with their OK. |
| `document_limit` | Free plan's 50 published documents are used. Don't retry; see below. |
| `plan_required` | A custom export footer and integrations need Pro or Team (Word export returns `docx_requires_pro`). The rest of the theme works on Free. Offer the upgrade. |
| `confirm_required` | You ran a command that needs `--yes`. Ask first. |
| `confirm_public_required` | Public needs `--confirm-public` and their explicit OK. |
| `forbidden` | Their role can't do this; an owner or admin can. |
| `integration_not_connected`, `reconnect_required` | An owner or admin connects Drive or DocuSeal in the dashboard (`dashboardUrl`). |
| `destination_not_found` | Pick a folder from `destinations` with the person. Never guess. |
| `signer_roles_mismatch`, `invalid_signers` | Ask who signs for each role; fix the `--signer` values. |
| `too_many_files`, `too_many_posts` | Split into runs of 500 files, or exports of 10. |
| `export_failed` | Retry the export; the document is still up. |
| `rate_limited` | See below. |
The full list is in [Errors](../errors.md).
## Rate limits and big jobs
Limits are per account for signed-in requests and per IP otherwise, per minute:
600 requests per IP overall, 120 publishes, 20 batch publishes (25 documents
each), 120 exports, 30 batch exports (10 documents each), and at most 4 exports
running at once per account. Anonymous publishing allows 30 an hour and 100 a day
per IP.
The CLI (0.4.6+) handles a `429` for you: it waits the `Retry-After` time and
retries, up to 5 times for waits of up to 90 seconds, so a large publish slows
down instead of failing. Longer waits (the hourly anonymous limit, sign-in
codes) come straight back as `rate_limited`; tell the person when to try again.
Don't add your own retry loops and don't run exports in parallel. One
`publish --export` or `export --project` call handles a whole folder or
project. If you call the API directly, honor `Retry-After` yourself.
## When the Free document limit is reached
`document_limit` won't change on retry. Unpublished documents don't count
toward the 50, so offer:
- publishing only the files that fit (the error says how many slots are left),
- unpublishing old documents with `opendocs unpublish `, after they pick
which,
- upgrading to Pro for unlimited documents.
## Checklist
- The content is saved to a `.md` file.
- `--json` on every command.
- The right workspace and project, checked when it matters.
- One command for a folder, with a shared tag.
- No public visibility, invitation, theme change, signature request or delete
without the person's explicit yes.
- Each link on its own line, who can open it, and the path of any export.
## Related pages
- [The OpenDocs skill](../getting-started/skill-md.md)
- [CLI reference](../cli/reference.md)
- [Errors](../errors.md)
- [Plans and limits](../getting-started/plans-and-limits.md)
- [Set up your agent](../integrations/overview.md)
---
URL: https://docs.opendocs.cc/publishing/publish
# Publish a document
Publishing turns a Markdown file into a page at a link your team can open. Use it
whenever a document your agent wrote needs to be read by someone else: a spec, a
board update, release notes, a handbook.
> **Ask your agent**
>
> "Publish the Q3 investor update to the Investors project and send me the PDF."
>
> "Publish everything in the `docs` folder and tag it onboarding."
>
> "Publish the pricing notes, but keep them private to me for now."
## What you get
- **A link that doesn't change.** A document in the Default project lives at
`opendocs.cc/halvard/q3-investor-update`; in a named project it's
`opendocs.cc/halvard/projects/investors/q3-investor-update`. Updates keep the
same link. See [Projects](./projects.md).
- **Workspace visibility by default.** Members of your workspace can open it; nobody
else can. Your agent can make a document private to you, share it with specific
people, or (after asking you) make it public. See
[Who can see a document](../visibility/overview.md).
- **A title and slug from the file.** The first `# Heading` becomes the title, and
the slug in the URL is made from it.
- **Your images.** Images next to the Markdown file are uploaded with it, so the
page shows them.
- **A PDF or Word file if you asked.** It's written next to the source file:
`q3-investor-update.md` gets `q3-investor-update.pdf`. PDF works on every plan;
Word needs Pro or Team. See [PDF, Word and branding](./branded-exports.md).
Publishing the same file again from the same folder updates the document instead of
creating a copy, so "publish it again" after an edit is safe. See
[Updates and versions](./update-and-version-history.md).
On Free, a workspace can have 50 published documents. Updates don't count. See
[Plans and limits](../getting-started/plans-and-limits.md).
## Under the hood
Your agent saves the Markdown first, then runs `opendocs publish` with `--json` so
it can read the result instead of parsing terminal text.
```bash
opendocs publish q3-investor-update.md --project Investors --export pdf --json
```
```json
{
"postId": "7f3c9a52-1d4e-4b8a-9c61-2e5f8a0b3d17",
"slug": "q3-investor-update",
"url": "/halvard/projects/investors/q3-investor-update",
"title": "Q3 investor update",
"tags": [],
"versionNumber": 1,
"projectSlug": "investors",
"projectName": "Investors",
"projectSource": "flag",
"export": {
"format": "pdf",
"path": "q3-investor-update.pdf",
"bytes": 184320,
"success": true
}
}
```
`url` is a path on `opendocs.cc`. `projectSource` says why the document landed in
that project: `flag` (`--project`), `path` (a `projects//` folder in a
clone), `folder` (a linked folder) or `active` (the CLI's active project).
### Flags
| Flag | Meaning |
| --- | --- |
| `--title ` | Override the title. Single file only. |
| `--slug ` | Choose the URL slug. Single file only. |
| `--visibility ` | `private`, `workspace` (default) or `public`. |
| `--confirm-public` | Required with `--visibility public`. |
| `--tags ` | Comma-separated tags, applied to every file. |
| `--project ` | Project name, slug or ID instead of the active project. A new name creates the project. |
| `--export ` | Also export to `pdf` or `docx` and save next to the source. |
| `--new` | Create new documents even for files this folder already published. |
| `--force` | Overwrite the live version even if someone published a newer one. See [Sync a folder](./sync-and-history.md#conflicts). |
| `--anonymous` | Publish without an account: a 24-hour link. See [Share with people](../visibility/sharing-and-anonymous-links.md#anonymous-links). |
| `--json` | Global. Machine-readable output. |
| `--api-url ` | Global. Use a different API host. |
The CLI sends `markdown`, `title` and `slug` (when passed), `visibility`,
`workspaceId`, `projectId`, `tags`, `sourcePath` and `confirmPublic` to
[`POST /api/v1/publish`](../api-reference/publish.md).
### Titles and slugs
- The title is the frontmatter `title` if there is one, otherwise the first
`# Heading`. `--title` overrides both.
- Without `--slug`, the slug is made from the title.
- A slug that's taken in the project gets a numeric suffix (`launch-plan-2`).
- `tag`, `tags`, `project` and `projects` are reserved. A generated slug gets a
suffix; an explicit `--slug` with one of them is refused with `reserved_slug`.
### Many files and folders
Pass several files, or a folder, and the CLI publishes them in batches:
```bash
opendocs publish docs/*.md --tags onboarding --json
opendocs publish ./handbook --project Handbook --json
```
- Folders are read recursively for `.md` files. `.git`, `.hg`, `.obsidian`,
`.opendocs`, `.trash` and `node_modules` are skipped.
- Up to 500 files per run, sent to `POST /api/v1/publish/batch` in requests of 25.
Each file can be up to 1 MB.
- `--title` and `--slug` are refused with more than one file; each file's first
heading becomes its title. `--visibility`, `--tags` and `--confirm-public` apply
to every file.
- A shared tag finds the group again: `opendocs list --tag onboarding`.
- One command for the whole folder is better than a loop over files: it signs in
once, reports one summary and keeps the rate limits happy.
### Local images
Images referenced with ``, `
` or
reference-style links are uploaded before the document, and the Markdown is
rewritten to point at the uploaded copies.
- JPEG, PNG, WebP, GIF and SVG, up to 10 MB each and 30 per document.
- The image must be inside the folder that holds the Markdown file (subfolders are
fine). A path that leaves it, such as `../../private.png`, is skipped with a
warning.
- Remote image URLs are left as they are.
### Publish and export together
```bash
opendocs publish board-report.md --export pdf --json
opendocs publish ./investors --export pdf --json
```
The CLI publishes first, then exports each document and writes it next to its
source (`investors/q3-update.md` gets `investors/q3-update.pdf`). Since CLI 0.4.6,
re-running it on a folder that's already published updates the files that changed
and exports every file, including the unchanged ones, so you get a fresh set of
PDFs after a round of edits.
If an export fails, the document is still published; the CLI prints a retry
command such as `opendocs export --format pdf`. `--export docx` needs Pro
or Team (`docx_requires_pro` otherwise). `opendocs update` has no `--export`; run
`opendocs export` after it.
### Public publishing
```bash
opendocs publish changelog.md --visibility public --confirm-public
```
Without `--confirm-public`, the CLI and the API refuse. Even then, people outside
the workspace can read it only when the workspace owner has turned on public
documents. See [Public documents](../visibility/public-sharing.md).
:::warning
Don't use `public` to share something with your team. `workspace`, the default,
already does that. Use `public` only for links anyone on the internet may read.
:::
### Plan limit
Before uploading anything, the CLI checks the workspace's remaining document slots
and refuses a run that won't fit with `document_limit`. The API enforces the same
cap.
## Related pages
- [Updates and versions](./update-and-version-history.md)
- [Sync a folder](./sync-and-history.md)
- [Markdown that renders](./rendering-and-metadata.md)
- [CLI reference](../cli/reference.md)
---
URL: https://docs.opendocs.cc/publishing/projects
# Projects
A project groups documents that belong together inside a workspace, the way a
branch keeps a body of work apart in a repo: one per client, product, team or
initiative. Every workspace has a **Default** project for one-off documents. If you
never create another, the workspace works as a single library.
> **Ask your agent**
>
> "Start a project for the Northwind engagement and put the proposal in it."
>
> "What's in the Investors project?"
>
> "Move last year's board notes to Archive."
## What happens
- **The URL shows the project.** Default-project documents sit right under the
workspace; documents in a named project carry its slug:
```text
https://opendocs.cc/halvard/onboarding-checklist
https://opendocs.cc/halvard/projects/investors/q3-investor-update
```
Each project also has its own page, `opendocs.cc/halvard/projects/investors`, and
tag pages are scoped the same way (`opendocs.cc/halvard/tag/finance`,
`opendocs.cc/halvard/projects/investors/tag/finance`).
- **Your agent keeps things organized.** Before publishing, it checks which
project a document would land in and what each project holds. When you change
topic, it files the document in the matching project or suggests a new one.
One-off documents stay in Default.
- **Moving changes the link.** A document moved to another project gets that
project's URL, and the old link stops working. Move before you share. Moving
never changes the content or the version history.
- **Tags work inside projects.** Use a project for the body of work and tags for
smaller labels in it: an Investors project with documents tagged `board`,
`fundraising` and `finance`.
Any member can create a project. Owners and admins can rename or delete one; a
project must be empty to be deleted, and Default can't be renamed or deleted.
Moving a document is for its author, owners and admins.
### How proactive your agent is
The `organize` preference tells your agent how much to decide on its own. Say
"create projects without asking" or "stop sorting my documents" and it changes it:
```bash
opendocs config set organize ask # default: suggest new projects, ask first
opendocs config set organize auto # create and pick projects without asking, then say where things went
opendocs config set organize off # always use the active project
```
## Under the hood
### Which project a new document goes to
For each file it hasn't published before, the CLI picks the first of:
1. `--project ` on the command (created if the name is new).
2. The file's place in a cloned workspace: files under `projects//` go to
that project.
3. The folder's linked project (`opendocs project link`).
4. The CLI's active project (`opendocs project use`), Default to begin with.
The publish result reports it as `projectSource`: `flag`, `path`, `folder` or
`active`.
### Commands
```bash
opendocs project list # projects, document counts and recent titles
opendocs project current # where this folder publishes, and why
opendocs project create "Northwind" --slug northwind --use
opendocs project use investors # switch the active project
opendocs project use default # back to Default
opendocs project rename investors --name "Investor relations" --slug investor-relations
opendocs project delete old-drafts --yes # empty, non-default projects only
```
`--name` is required for `rename`. Changing a project's slug changes the URL of
every document in it.
Link a folder to a project, so new documents published from it go there:
```bash
opendocs project link "Northwind" # created if the name is new
opendocs publish ./proposal # → Northwind
opendocs project unlink
```
`opendocs clone --project ` links the cloned folder for you.
Publish to a project without switching, move a document, or work with one project:
```bash
opendocs publish proposal.md --project Northwind
opendocs move board-notes-2025 --project Archive # created if new
opendocs list --project investors
opendocs list --all-projects
opendocs pull --project investors --output ./investors
opendocs export --project investors -f pdf # into ./investors-pdf/
```
`opendocs move` reports the new URL. If the slug is taken in the target project,
the document gets a suffix and the CLI says so. Re-publishing a file this folder
already published with `--project ` also moves it.
`opendocs workspace use ` switches workspace and resets the active project
to that workspace's Default.
The project endpoints are in the [Projects API](../api-reference/projects.md).
## Related pages
- [Publish a document](./publish.md)
- [Find, download and remove](./list-get-pull-unpublish.md)
- [Sync a folder](./sync-and-history.md)
- [Workspaces and teams](../visibility/workspaces-and-team-access.md)
---
URL: https://docs.opendocs.cc/publishing/update-and-version-history
# Updates and versions
When a document changes, your agent publishes the new Markdown to the same
document. The link stays the same, so everyone you sent it to sees the latest
version, and every earlier version is kept.
> **Ask your agent**
>
> "I edited the handbook, update it."
>
> "Who changed the pricing spec this week, and what did it say on Monday?"
>
> "Roll the pricing spec back to version 3."
## What happens
- **Same link, new version.** Readers who open the link get the newest version.
Content that hasn't changed doesn't create a version.
- **Every version is kept,** with when it was published, who published it and
through which agent, such as Claude Code or Cursor.
- **Rolling back never deletes anything.** Restoring version 3 publishes its content
again as the newest version, so a rollback can itself be undone.
- **Your team can edit too.** Any active member of the workspace can update a
document, change its tags or restore a version, not only its author. The history
shows who made each change. Changing who can see it, moving, sharing,
unpublishing and deleting are for the author, owners and admins. See
[Workspaces and teams](../visibility/workspaces-and-team-access.md#who-can-do-what).
- **No silent overwrites.** If a teammate or another agent published a newer
version since your copy, your agent's update stops and it tells you, instead of
replacing their work. See [Sync a folder](./sync-and-history.md#conflicts).
## Under the hood
### Two ways to update
**Publish the file again** from the folder that first published it. This is what
your agent normally does:
```bash
opendocs publish handbook.md --json
```
The CLI finds the document in `.opendocs/state.json`, sends the version your copy
is based on, and the API refuses with `version_conflict` if the live document has
moved on. The result lists the file under `updated` with `action`: `updated`,
`unchanged`, `conflict` or `failed`. See [Sync a folder](./sync-and-history.md).
**`opendocs update`** works on any document you can edit, from any folder:
```bash
opendocs update pricing-spec.md --post-id pricing-spec --tags pricing,q4 --json
```
| Flag | Meaning |
| --- | --- |
| `--post-id ` | Required. The document to update. |
| `--title ` | Override the title. |
| `--visibility ` | `private`, `workspace` or `public`. Omit to keep the current one. |
| `--confirm-public` | Required when changing to `public`. |
| `--tags ` | Replace the tags with this comma-separated list. Omit to keep them. |
| `--json` | Global. Machine-readable output. |
```json
{
"postId": "4b1e7c20-8f3a-4d59-b6e2-91c0d7a3f845",
"versionId": "a9d2e6f1-3c47-4b80-8e15-7f2b9c6d0e34",
"versionNumber": 4,
"unchanged": false,
"slug": "pricing-spec",
"url": "/halvard/pricing-spec",
"title": "Pricing spec",
"visibility": "workspace",
"tags": ["pricing", "q4"]
}
```
Things to know about `update`:
- It uploads local images the same way `publish` does.
- It doesn't check for conflicts and doesn't update `.opendocs/state.json`. For a
file this folder tracks, use `publish` instead, or the next `publish` reports a
conflict with your own update.
- A slug in `--post-id` resolves inside the active workspace and project, so it
finds a teammate's document as well as your own. Any member of the workspace
can update a workspace document.
- Unchanged content returns `"unchanged": true` and no new version, but a new title,
visibility or tag list still applies.
- Changing visibility through `update` needs the same rights as
`opendocs visibility`: author, owner or admin.
- There's no `--export`. Run `opendocs export -f pdf` afterwards.
- It only works on published documents. See
[Unpublish and delete](./list-get-pull-unpublish.md#unpublish-and-delete).
### Version history and rollback
```bash
opendocs history pricing-spec.md # every version, newest first
opendocs pull pricing-spec.md --version 3 --stdout
opendocs rollback pricing-spec.md 3 # alias: opendocs restore
```
`` can be a post ID, a slug, or a local `.md` file this folder published.
`history --json` returns each version as:
```json
{
"versionNumber": 5,
"createdAt": "2026-10-21T09:14:03.000Z",
"createdBy": "dana",
"client": "claude-code",
"restoredFromVersion": 3,
"isCurrent": true
}
```
`client` comes from the `X-OpenDocs-Client` header. The CLI detects Claude Code,
Cursor, Codex, Gemini CLI and OpenCode on its own; other agents set it with the global
`--client ` flag or `OPENDOCS_CLIENT`. `restoredFromVersion` is set on
versions made by a rollback. Rollback doesn't touch
your local file: run `opendocs pull pricing-spec.md -o pricing-spec.md` before
editing again.
The endpoints are listed under
[Agent endpoints](../api-reference/agent-endpoints.md#version-history).
## Related pages
- [Sync a folder](./sync-and-history.md)
- [Find, download and remove](./list-get-pull-unpublish.md)
- [How OpenDocs works](../getting-started/how-opendocs-works.md)
---
URL: https://docs.opendocs.cc/publishing/sync-and-history
# Sync a folder
Your agent works from a folder of Markdown files. OpenDocs remembers which file is
which document, so publishing again updates documents instead of creating copies,
and you can download a whole workspace or project, edit it locally and publish the
changes back.
> **Ask your agent**
>
> "Download the Handbook project so I can edit it here."
>
> "What's changed in the handbook since we last published?"
>
> "Publish my edits to the handbook."
## What happens
- **Publishing again updates.** The first publish of `notes.md` creates
`opendocs.cc/halvard/notes`; the next one adds a version at the same link. A file
that hasn't changed is reported as unchanged and gets no new version.
- **A downloaded copy stays linked.** Files your agent downloads with `clone` are
tied to their documents, so publishing the folder updates them, and new files
become new documents.
- **You can see what's out of step.** Your agent can list which files you changed,
which changed online, and which are new.
- **Clashing edits stop.** If someone published a newer version since your copy,
that file isn't published; your agent tells you and asks which version to keep.
## Under the hood
### How the CLI remembers files
The CLI records each published file in `.opendocs/state.json`, in the current
folder or the nearest parent folder that has one. It holds the post ID, the
version your copy is based on and a hash of the file.
```bash
opendocs publish notes.md # v1, opendocs.cc/halvard/notes
# ...edit notes.md...
opendocs publish notes.md # v2, same URL
```
- `--new` creates a new document even for a file the folder already published.
- `.opendocs/` gets its own `.gitignore`, because it can hold claim tokens for
anonymous documents.
- Re-publishing a tracked file with `--project ` moves the document to that
project (author, owners and admins only).
- `opendocs update --post-id` doesn't read or write this file. See
[Updates and versions](./update-and-version-history.md#two-ways-to-update).
### Clone a workspace or project
```bash
opendocs clone # the whole workspace into ./halvard/
opendocs clone handbook --project handbook
cd handbook
opendocs status # what changed locally or online
opendocs publish . # publish every change; new files become new documents
```
| Flag | Meaning |
| --- | --- |
| `[dir]` | Target folder. Defaults to the workspace slug, or the project slug with `--project`. |
| `--project ` | Clone one project and link the folder to it. |
| `--tag ` | Only documents with this tag. |
| `--overwrite` | Replace files that already exist in the target folder. |
A workspace clone puts Default-project documents at the root and every other
project under `projects//`. New files you add under `projects//`
publish to that project.
### Status
`opendocs status` compares every tracked file with the live documents and lists
untracked `.md` files too:
| Shown as | `status` in `--json` | Meaning |
| --- | --- | --- |
| up to date | `up-to-date` | Nothing changed. |
| modified locally | `modified` | You edited it. `opendocs publish .` sends it. |
| newer version online | `behind` | Someone published since your copy. |
| changed locally and online | `conflict` | Both. Publishing it will stop with `version_conflict`. |
| new (not published) | `untracked` | A new file. Publishing creates a document. |
| file deleted locally | `missing-locally` | The document is still online. |
| no longer online | `gone-remotely` | It was unpublished or deleted. |
| anonymous | `anonymous` | A 24-hour anonymous link from this folder. |
### Conflicts
Every update from a tracked file sends the version it was based on
(`baseVersionNumber`). If the live document has moved past it, the API answers
`409 version_conflict` with `currentVersionNumber`, and the CLI leaves that file
alone and carries on with the rest.
```bash
opendocs pull notes.md --stdout # read the live version
opendocs pull notes.md -o notes.md # take theirs (your file is replaced)
opendocs publish notes.md --force # keep yours as the newest version
```
Pulling the latest version into a tracked file brings it back in step, so the next
publish goes through. `--force` skips the check; the teammate's version stays in the
history either way.
### History
Version history and rollback work on tracked files by name:
`opendocs history notes.md`, `opendocs rollback notes.md 2`. See
[Updates and versions](./update-and-version-history.md#version-history-and-rollback).
## Related pages
- [Updates and versions](./update-and-version-history.md)
- [Projects](./projects.md)
- [Find, download and remove](./list-get-pull-unpublish.md)
---
URL: https://docs.opendocs.cc/publishing/list-get-pull-unpublish
# Find, download and remove documents
Once documents are published, your agent can find them, bring their Markdown back
into your folder, export them, change who can see them, and take them down.
> **Ask your agent**
>
> "What have we published in the Investors project?"
>
> "Get me the current Markdown of the onboarding handbook."
>
> "Take down the old pricing page."
## What happens
- **Lists follow your active project.** Your agent lists the project you're working
in and tells you how many documents the other projects hold. Ask for "everything
in the workspace" to see them all.
- **Downloads are plain Markdown.** One document, a whole project or the whole
workspace, written into your folder. To edit and publish back, see
[Sync a folder](./sync-and-history.md).
- **"Take it down" means unpublish.** Your agent unpublishes unless you clearly ask
for deletion, and asks before deleting, because deletion can't be undone.
### Unpublish and delete
| | Unpublish | Delete |
| --- | --- | --- |
| The link | Stops working | Stops working |
| On the server | The document and every version are kept | Removed, with every version and tag |
| Who still sees it | Its author and the workspace's owners and admins (lists, `get`, `pull`); everyone else gets not found | Nobody |
| The URL slug | Stays reserved, so nothing else takes it | Freed for reuse |
| A Free plan slot | Freed | Freed |
| Undo | No command brings it back at the same link | None |
To bring it back, publish the file as a new document (`--new` from the folder that
published it). It gets a new link, such as `pricing-2`, because the unpublished
one keeps its slug. Use unpublish when
you want something offline but kept; delete when it should be gone and its URL
free.
Unpublishing and deleting are for the document's author, owners and admins, from
the CLI, the API or the dashboard; see
[Who can do what](../visibility/workspaces-and-team-access.md#who-can-do-what).
## Under the hood
Commands take a document as a post ID or a slug. `pull`, `export`, `history`,
`rollback`, `move` and `share` also accept a local `.md` file this folder
published. A slug resolves inside the active workspace and project, so it finds
teammates' documents as well as your own; a post ID works wherever you can read
the document. What you can then change depends on your role (see
[Who can do what](../visibility/workspaces-and-team-access.md#who-can-do-what)).
### List
```bash
opendocs list # active workspace, active project
opendocs list --project investors # another project
opendocs list --all-projects # every project in the workspace
opendocs list --all # every workspace you belong to
opendocs list --tag board --page 2 --limit 50
opendocs list --json
```
`--page` and `--limit` take positive integers; `--limit` is at most 100. A
project-scoped list ends with a hint such as
`37 more documents in 4 other projects: guides (30), handbook (3), ...`.
The JSON has the page, limit, total and each document's ID, slug, title,
visibility, `isPublished`, version number, project and `workspaceId` /
`workspaceSlug`. `scope` is `"all"` with `--all` and `"workspace"` otherwise;
`projectSlug` is the listed project (`null` with `--all-projects` or `--all`).
Project-scoped lists also carry `otherProjects` as `{ name, slug, postCount }`.
Unpublished documents are listed with `isPublished: false`.
### Get
```bash
opendocs get q3-investor-update --json
```
Shows the URL, post ID, slug, project, visibility, whether it's published, the
version number, when it was updated, and its tags.
### Pull
```bash
opendocs pull q3-investor-update # saves q3-investor-update.md
opendocs pull q3-investor-update --stdout
opendocs pull q3-investor-update -o drafts/q3.md
opendocs pull q3-investor-update --version 2 --stdout
opendocs pull --project investors -o ./investors
opendocs pull --workspace -o ./halvard-backup
opendocs pull --workspace --tag board --dry-run
```
| Flag | Meaning |
| --- | --- |
| `-o, --output ` | File for one document; folder for bulk pulls. |
| `--stdout` | Print the Markdown. One document only. |
| `--version ` | An earlier version. See `opendocs history`. |
| `--project [slug]` | Every document in the active project, or the one named. |
| `--workspace` | Every project in the active workspace. |
| `--tag ` | Only documents with this tag (bulk pulls). |
| `--overwrite` | Replace existing files (bulk pulls). |
| `--dry-run` | Show what would be written, write nothing. |
A workspace pull writes Default-project documents at the output root and other
projects under `projects//`. A bulk pull stops before writing if a file
exists, unless you pass `--overwrite`. Unlike `clone`, a pull doesn't link the
files for re-publishing.
If you wrote the document or are a member of its workspace, a pull gets the full
source, [`private` blocks](./rendering-and-metadata.md#private-blocks) included. A
guest it was shared with gets it without them.
### Export
```bash
opendocs export q3-investor-update -f pdf
opendocs export q3-investor-update -f pdf -o exports/
opendocs export intro guide api-spec -f pdf -o ./exports
opendocs export --project investors -f pdf
```
The default format is `pdf`; pass `-f docx` for Word (Pro and Team). Single exports are
saved as `.pdf` in the current folder unless `-o` names a file or folder;
several documents (up to 10 per command) or a whole `--project` go into a folder.
Filenames from the server are used only as plain names inside that folder. See
[PDF, Word and branding](./branded-exports.md#export-commands) for every flag.
### Change visibility
```bash
opendocs visibility q3-investor-update private
opendocs visibility q3-investor-update workspace
opendocs visibility changelog public --confirm-public
```
Changes who can see a document without creating a version or re-uploading
anything. Going `public` without `--confirm-public` fails with
`confirm_public_required` before any request is sent. See
[Who can see a document](../visibility/overview.md).
### Unpublish
```bash
opendocs unpublish old-pricing
```
Sets the document offline (`isPublished: false`) and keeps the record, its versions
and its slug. `opendocs update` and `opendocs visibility` refuse unpublished
documents, and publishing the tracked file again fails; pass `--new` to publish it
as a new document.
### Delete
```bash
opendocs delete old-pricing --yes
```
Removes the document, every version and its tags in one transaction, and frees the
slug. There's no recycle bin. The deletion is recorded in the workspace's audit
log.
- Outside a terminal (agents, scripts, CI), `--yes` / `-y` is required. Without
it the CLI exits with `confirm_required` and sends nothing.
- At a terminal without `--yes`, you're asked to type the post ID or slug again.
Anything else cancels.
### Tips for agents
- Use `list --json` to find the right document, and `get` to check its URL or
visibility before changing it.
- Use `pull --stdout` to read the current body without writing a file.
- Use `visibility` rather than `update` to change only who can see a document.
- "Remove" or "take down" means `unpublish`. Delete only when asked, with `--yes`.
## Related pages
- [Sync a folder](./sync-and-history.md)
- [Updates and versions](./update-and-version-history.md)
- [Post changes API](../api-reference/post-mutations.md)
---
URL: https://docs.opendocs.cc/publishing/branded-exports
# PDF, Word and branding
Any document can come back as a PDF or a Word file, typeset from the same Markdown
by OpenDocs's converter rather than printed from a web page. Every export uses
your workspace's **export theme**: a brand color, a font and your logo on any
plan, and on Pro and Team your own footer in place of "Made with OpenDocs". Files
from you, your team and your agents look the same.
> **Ask your agent**
>
> "Send me the board report as a PDF."
>
> "Export everything in the Investors project as PDFs."
>
> "Use the Boardroom preset with our logo on every export."
## What you get
- **A file in your folder.** When your agent publishes and exports in one step, the
PDF lands next to the Markdown (`board-report.md` gets `board-report.pdf`). A
whole project goes into a folder of its own.
- **PDF on every plan, with your branding.** Every plan can use its own logo,
brand color, font and presets. On Free, exports end with a "Made with OpenDocs"
footer, even if the workspace kept its own footer from an earlier paid plan;
that footer is saved and applies again when you upgrade.
- **Word (.docx) on Pro and Team.**
- **The same content as the page.** Tables, alerts, math, code, images, footnotes
and signature blocks all come through. See
[Markdown that renders](./rendering-and-metadata.md).
- **Optional landscape pages** for wide tables.
To file exports in Google Drive instead of your folder, ask your agent to save the
document to one of your workspace's Drive folders. See
[Google Drive](../integrations/google-drive.md).
### The export theme
The theme belongs to the workspace and applies to every PDF and Word export in it,
whoever makes it. Owners and admins can change it on any plan, in the dashboard
under **Settings → Export branding** or through their agent; only the footer needs
Pro or Team. Your agent proposes a preset (or a color and font) and waits for your
OK before changing it. **Download sample PDF** in the same section shows how your
exports look with the current settings.
## Presets
Each preset is a tested color and font pairing:
| Preset | Brand color | Font | Good for |
| --- | --- | --- | --- |
| `classic` | `#2E1C5C` purple | Arial | The OpenDocs house style |
| `boardroom` | `#13294B` navy | IBM Plex Sans | Board updates, investor memos, policies |
| `editorial` | `#6E1F2A` oxblood | Vollkorn | Essays and long reports |
| `research` | `#1F4D3A` forest green | Merriweather | Whitepapers, studies, technical reports |
| `studio` | `#1F2328` graphite | Inter | Product specs, design docs, release notes |
| `field-guide` | `#0F4C5C` deep teal | Lato | Handbooks, onboarding, how-to guides |
| `letterpress` | `#7C2D12` rust | EB Garamond | Proposals, letters, formal reports |
| `terminal` | `#1E40AF` cobalt | JetBrains Mono | Changelogs, runbooks, incident reviews |
| `launch` | `#86198F` fuchsia | Manrope | Launch briefs, one-pagers, announcements |
## Fonts
| Font | Style | Good for |
| --- | --- | --- |
| Arial | Neutral sans (default) | Anything |
| Inter | Modern sans | Specs, design docs |
| IBM Plex Sans | Corporate sans | Board updates, memos, policies |
| Lato | Warm humanist sans | Handbooks, how-to guides |
| Roboto | Familiar neutral sans | Reports and documents of any kind |
| Manrope | Modern grotesque | Launch briefs, one-pagers |
| Merriweather | Sturdy serif | Whitepapers, studies |
| Vollkorn | Editorial serif | Essays, long reports |
| EB Garamond | Classic Garamond serif | Proposals, letters, formal reports |
| JetBrains Mono | Monospace | Changelogs, runbooks, incident reviews |
Serifs suit long, reading-heavy documents; sans fonts suit specs, memos and
handbooks. With JetBrains Mono, code blocks use it too.
## The brand color must be dark
The converter uses the brand color for headings, links, the table-header background
(with white text on it) and the footer's first line. A light wash of it tints
alternating table rows and code blocks. Body text is always near-black (`#171717`)
and can't be changed.
- The color needs at least **4.5:1** contrast against white. Lighter colors are
refused with [`low_contrast`](../errors.md#low-contrast).
- Aim for **7:1** or more for long documents. Every preset is above 8:1.
- Use the deepest usable shade of your brand's hue: a navy instead of a bright
blue, a forest green instead of a lime. Pastel, neon, yellow and light grey don't
work.
## Logo and footer
When it's turned on, the logo sits in the top-right corner of every page. It also
appears on your workspace page. Use a PNG, JPEG or WebP up to 2 MB; a square or
wide PNG with a transparent background works best.
The footer has up to three parts: a company name (the workspace name by default), a
tagline and a link. It can be turned off.
## Under the hood
### Export commands
```bash
opendocs publish board-report.md --export pdf --json # publish, then write board-report.pdf
opendocs export board-report -f pdf # an existing document → ./board-report.pdf
opendocs export board-report -f docx -o exports/
opendocs export q3-update q2-update q1-update -f pdf -o ./investor-pdfs
opendocs export --project investors -f pdf # → ./investors-pdf/
```
| `opendocs export` flag | Meaning |
| --- | --- |
| `-f, --format ` | `pdf` or `docx`. The default is `pdf`. |
| `-o, --output ` | A file for one document (an existing folder or a path ending in `/` gets `.` inside it); a folder for several. |
| `--project ` | Every document in a project, in batches of 10. Default folder `./-`. |
| `--stdout` | Write the file to stdout. One document only. |
| `--landscape` | Landscape pages. |
| `--accent-color ` | Brand color for this export only. |
- One command takes up to 10 documents; more fail with `too_many_posts` before any
request. `--project` has no such limit.
- Batch exports, which `opendocs export` uses for several documents or
`--project` and `publish --export` uses for files it updated, include any
document you can read, teammates' included. One you can't read comes back as
`not_found` in the results.
- Each export is cached by its content and theme, so exporting an unchanged
document again is fast.
- `docx` on Free fails with `docx_requires_pro`.
- Rate limits: 120 exports and 30 batch exports a minute, at most 4 running at once
per account. The CLI waits and retries on `429`.
`publish --export` details, including re-exporting a folder after edits, are in
[Publish a document](./publish.md#publish-and-export-together). The endpoints are in
the [Exports API](../api-reference/exports.md).
### Theme commands
Reading the theme works for any member:
```bash
opendocs theme --json # current color, font, preset, logo, footer, canEdit
opendocs theme presets --json
opendocs theme fonts --json
opendocs theme check "#0B3D5C" # contrast against white; changes nothing
```
Changing it is for owners and admins, on any plan; `theme footer` needs Pro or
Team. Outside a terminal, `set`, `footer` and `logo` refuse with `confirm_required` unless you pass `--yes`, so your
agent asks you first:
```bash
opendocs theme set --preset boardroom --yes --json
opendocs theme set --color "#0B3D5C" --font "IBM Plex Sans" --yes --json
opendocs theme logo ./halvard-logo.png --yes
opendocs theme set --logo-in-exports on --yes
opendocs theme footer --company "Halvard" --tagline "Investor relations" \
--link-url halvard.example --link-label halvard.example --yes
opendocs theme footer --off --yes
opendocs theme logo --remove --yes
```
| `theme set` flag | Meaning |
| --- | --- |
| `--preset ` | Apply a preset's color and font. |
| `--color ` | Brand color, at least 4.5:1 on white. |
| `--font ` | One of the 10 fonts. |
| `--logo-in-exports on\|off` | Show the workspace logo in exports. |
| `--allow-low-contrast` | Save a color below 4.5:1 anyway. Not recommended. |
`theme footer` takes `--company`, `--tagline`, `--link-url`, `--link-label`, `--on`
and `--off`. After a change, export one document as a preview:
```bash
opendocs export board-report -f pdf
```
Errors: `forbidden` (members can't change the theme), `plan_required` (a footer
change on Free),
`low_contrast`, `invalid_preset`, `invalid_font`. The API behind these commands is
[`GET` and `PATCH /api/v1/workspace/branding`](../api-reference/agent-endpoints.md#export-theme).
## Related pages
- [Publish a document](./publish.md)
- [Markdown that renders](./rendering-and-metadata.md)
- [Google Drive](../integrations/google-drive.md)
- [Plans and limits](../getting-started/plans-and-limits.md)
---
URL: https://docs.opendocs.cc/publishing/rendering-and-metadata
# Markdown that renders
OpenDocs reads GitHub-flavored Markdown plus a few additions, and the page, the PDF
and the Word file all follow the same rules, so a document looks the same wherever
it's read. Your agent knows this syntax; you can ask for the result.
> **Ask your agent**
>
> "Add a warning callout above the pricing table saying the numbers are estimates."
>
> "Add signature lines for Dana and the Northwind contact at the end of the agreement."
## What renders
| Feature | How to write it |
| --- | --- |
| Headings, bold, italic, links, lists, blockquotes, horizontal rules | Standard Markdown |
| Strikethrough | `~~old price~~` |
| Tables, with column alignment | GitHub tables (`\|---:\|` aligns right) |
| Task lists | `- [ ] Draft` and `- [x] Review` |
| Footnotes | `Revenue grew 18%.[^1]` and `[^1]: Unaudited.` |
| Code with syntax highlighting | Fenced blocks with a language: ` ```python ` |
| Alerts | `> [!NOTE]`, `> [!TIP]`, `> [!IMPORTANT]`, `> [!WARNING]`, `> [!CAUTION]` on the first line of a blockquote |
| Math (KaTeX) | `$E = mc^2$` inline, `$$...$$` as a block, or a paragraph of `formula(...)` |
| Highlight, subscript, superscript | `==key figure==`, `H~2~O`, `x^2^` |
| Definition lists | A term on one line, `: Its definition` on the next |
| Abbreviations | `*[ARR]: Annual recurring revenue` anywhere; on the page, hovering `ARR` shows it |
| Emoji shortcodes | `:white_check_mark:` |
| Smart punctuation | Straight quotes become curly; `--` is an en dash, `---` an em dash |
| Images and figures | ``. An image alone in a paragraph becomes a figure, captioned by its title or by an italic line right below it. |
| A metadata line | `Author: Dana \| Status: Draft` near the title is styled as quiet metadata |
| Page breaks | `\pagebreak` or `` on its own line. In exports, a new page starts there. |
| Signature blocks | A ` ```signature ` fence. See [Signature blocks](#signature-blocks). |
| Private notes | A ` ```private ` fence. See [Private blocks](#private-blocks). |
A `$` followed by a digit stays a dollar sign, so "$5 and $10" isn't read as math.
### What doesn't render
- **Mermaid and other diagram code** shows as a code block, not a diagram. Export
the diagram as an SVG or PNG and include it as an image; SVGs stay sharp in PDFs.
- **Scripts, styles, iframes and event handlers** in raw HTML are removed. Raw HTML
can use formatting tags such as ``, ``, ``, ``, ``
and `
`.
- **Front matter** isn't shown. Only its `title` is used.
### On the page
- The title from the file is shown above the document, so its leading `# Title`
isn't repeated in the body.
- Every heading gets an anchor link (`¶`), and the headings form the table of
contents.
- Code blocks use a light GitHub color theme.
### In PDF and Word exports
Exports render the same syntax. A few differences:
- Images can be PNG, JPEG, GIF, WebP or SVG. SVGs are drawn sharp for print. Each
image keeps its own size, scaled down only when it's wider than the page.
- Math becomes native equations in Word.
- Raw HTML is reduced to its text and inline formatting; `
` tags are kept.
- The export theme sets the heading, link and table colors and the font. See
[PDF, Word and branding](./branded-exports.md).
### Improvements reach old documents
When the renderer learns new syntax, documents published earlier are re-rendered
from their stored Markdown the next time they're opened. That doesn't create a
version or change the document's updated date.
## Signature blocks
A `signature` fence lists who signs. On the page and in PDF and Word exports, each
entry is drawn as a signing box: a line to sign on, the name, title and role, and a
date line.
````md
```signature
- role: Halvard
name: Dana
title: Chief Operating Officer
- role: Client
name: Ines Moreau
title: Head of Operations, Northwind
```
````
`role` is required and must be unique in the block; `name` and `title` are
optional. A block that breaks the rules renders as an ordinary code block. When the
document is sent for signing through DocuSeal, each box gets that signer's
signature and date fields. The full rules are in
[Mark where people sign](../integrations/docuseal.md#mark-where-people-sign).
## Private blocks
A `private` fence is left out of the page, PDF and Word exports, files saved to
Google Drive, the Markdown download on the page, the workspace's Markdown ZIP and
workspace search, so you can keep working notes in the source file:
````md
```private
Numbers still need sign-off from finance.
```
````
The fence can be three or more backticks or tildes (`~~~private` works too), and
it ends at a closing fence of the same kind. A private fence that's never closed
hides everything after it. A `private` fence shown inside another code block, as
an example, is left alone.
:::note Who still sees it
The block stays in the stored Markdown. You and members of the document's
workspace, who can edit it, get it back with `opendocs pull` and the API's raw
Markdown routes. Guests it's shared with and public readers never see it. Keep
anything your teammates shouldn't read out of the document.
:::
## Titles, summaries and tags
- **Title:** the front matter `title`, else the first `# Heading`, else "Untitled
document". `--title` on publish overrides both. Up to 255 characters.
- **Slug:** made from the title unless `--slug` is given. See
[Publish a document](./publish.md#titles-and-slugs).
- **Summary:** the first paragraph of prose, skipping headings, tables, code,
blockquotes, images and HTML, up to 280 characters. It's used on the workspace
page, in lists and in link previews.
- **Tags:** up to 20 per document, 64 characters each, stored lowercase without
duplicates. The CLI takes them comma-separated (`--tags board,finance`); the API
takes an array.
## Safe rendering
Rendered HTML is sanitized with GitHub's rules plus the elements OpenDocs's syntax
adds. Front matter is read as data and never run.
## Related pages
- [Publish a document](./publish.md)
- [PDF, Word and branding](./branded-exports.md)
- [E-signatures](../integrations/docuseal.md)
---
URL: https://docs.opendocs.cc/visibility/overview
# Who can see a document
Publishing a document doesn't make it public. Every document has one of three
visibility levels, and the default keeps it inside your workspace.
> **Ask your agent**
>
> "Keep the salary bands private to me."
>
> "Who can see the Q3 investor update?"
>
> "Make the v2.4 changelog public."
## The three levels
| Visibility | Who can open it | Use it for |
| --- | --- | --- |
| `workspace` (default) | Active members of the workspace | Specs, plans, runbooks, anything for the team |
| `private` | Only you, the author. Owners and admins can't open it either. | Drafts and personal notes |
| `public` | Anyone with the link, once the workspace owner allows public documents | Changelogs, public guides, anything for the open web |
On top of any level, you can share one document with specific email addresses or a
whole email domain. Those people can read that document without joining the
workspace. This is usually the right choice for clients, investors and
contractors. See [Share with people](./sharing-and-anonymous-links.md).
Comments on a document are for the people working on it: members of the
workspace can leave them, and members and the people it's shared with can read
them. Readers of a public document see the document without its comments.
## What your agent does
- **Uses `workspace` unless you say otherwise.** "For the team" needs nothing
extra. "Just for me" makes it private.
- **Asks before anything public.** Making a document public is the one change your
agent always confirms with you first, and the CLI and API refuse it without an
explicit confirmation. See [Public documents](./public-sharing.md).
- **Prefers sharing over public** when you name people or a company outside the
workspace.
Changing visibility later keeps the link and the version history; it doesn't
create a new version. The author, owners and admins can change it; see
[Who can do what](./workspaces-and-team-access.md#who-can-do-what).
## Under the hood
Set it when publishing:
```bash
opendocs publish salary-bands.md --visibility private
opendocs publish changelog.md --visibility public --confirm-public
```
Change it later, without re-uploading the Markdown:
```bash
opendocs visibility salary-bands private
opendocs visibility changelog public --confirm-public
```
- The levels are `private`, `workspace` and `public`. New documents default to
`workspace`.
- Moving to `public` needs `--confirm-public` (CLI) or `"confirmPublic": true`
(API). The CLI fails with `confirm_public_required` before sending anything.
- `opendocs update --visibility ` changes it together with the content.
Without `--visibility`, updates keep the current level.
- Unpublished documents can't change visibility.
The endpoint is
[`POST /api/v1/posts/:postId/visibility`](../api-reference/post-mutations.md#post-apiv1postspostidvisibility).
## Related pages
- [Share with people](./sharing-and-anonymous-links.md)
- [Public documents](./public-sharing.md)
- [Workspaces and teams](./workspaces-and-team-access.md)
---
URL: https://docs.opendocs.cc/visibility/sharing-and-anonymous-links
# Share with people
Share a document with one person, or everyone at a company, without adding them to
your workspace or making the document public. It's the right way to send a
proposal to a client, a report to investors or a brief to a contractor.
> **Ask your agent**
>
> "Share the Northwind proposal with ines@northwind.example."
>
> "Let anyone at northwind.example read the proposal."
>
> "Who has access to the Q3 investor update?"
## What happens
- **People you name get an email** with the link. Your agent can skip the email if
you'd rather send the link yourself.
- **They sign in with that address to read it.** OpenDocs checks the address is
theirs with an emailed code (signing in with Google or GitHub also counts). No
password, no workspace to join.
- **They see only what you shared.** Guests can read the shared documents and
nothing else in the workspace, and they don't take up a member seat.
- **A domain lets in the whole company.** Sharing with `northwind.example` lets
anyone with a verified address there read the document. Use a company's own
domain, never a public mail provider such as `gmail.com`.
- **It works at any visibility.** A `private` document shared with Ines stays
hidden from your workspace but opens for her.
- **Private notes stay out.** Guests don't see
[`private` blocks](../publishing/rendering-and-metadata.md#private-blocks), on
the page or in the Markdown they download.
- **You can see and undo it.** Ask who has access, or to stop sharing with someone.
Sharing is for the document's author, owners and admins.
## Anonymous links
Without an account, your agent can still publish a link that works for 24 hours,
for example on the first try before you sign up. Your agent asks before doing this,
because anyone with the link can read it.
> **Ask your agent**
>
> "Give me a link to these meeting notes without signing up."
- **Anyone with the link can read it for 24 hours.** Then it's deleted.
- **You also get a claim link.** Open it and sign in, and the document moves into
your workspace as a normal document with `workspace` visibility and a link in
your workspace. The anonymous link stops working.
- **Signing up from the same folder keeps it automatically.** When your agent runs
`opendocs login --email ` in the folder it published from, the anonymous
documents are claimed into your new workspace.
- **Limits:** up to 512 KB of Markdown per document, no image uploads, and a banner
saying it was shared anonymously. Anonymous pages aren't indexed by search
engines or listed anywhere.
## Under the hood
### Sharing
```bash
opendocs share northwind-proposal ines@northwind.example # emails Ines a link
opendocs share northwind-proposal @northwind.example --no-notify
opendocs share northwind-proposal # list who has access
opendocs share northwind-proposal ines@northwind.example --remove
```
- `` is a post ID, a slug, or a local `.md` file this folder published.
- People are emails or domains, space- or comma-separated. `@northwind.example` and
`northwind.example` both mean the domain.
- `--no-notify` skips the email. Domains are never emailed.
- Up to 50 emails and 20 domains per request.
- The result has the `url` to send, the `emails` and `domains` with access, and
`notified`, the addresses that were emailed.
The endpoints are `GET`, `POST` and `DELETE /api/v1/posts/:postId/share`, with a
body of `{ "emails": [...], "domains": [...] }` (plus `"notify": false` on `POST` to
skip emails). See
[Agent endpoints](../api-reference/agent-endpoints.md#sharing-with-people-outside-the-workspace).
### Anonymous publishing
```bash
opendocs publish meeting-notes.md --anonymous --json
```
```json
{
"anonymous": true,
"total": 1,
"succeeded": 1,
"failed": 0,
"results": [
{
"file": "meeting-notes.md",
"success": true,
"action": "created",
"url": "https://opendocs.cc/a/...",
"claimUrl": "https://opendocs.cc/claim/...",
"expiresAt": "2026-10-26T10:12:00.000Z"
}
]
}
```
- Give the person the `claimUrl` exactly as returned.
- Up to 10 files per run. `--visibility`, `--tags`, `--project` and `--export` are
ignored. Local images aren't uploaded.
- Publishing the same file again with `--anonymous` updates the same link without
extending the 24 hours.
- The claim token is kept in `.opendocs/state.json`, which is why that folder is
git-ignored.
- `opendocs claim` claims everything this folder published anonymously into the
active workspace and project; `opendocs claim ` claims one.
`--visibility private` keeps it to yourself. Claimed documents count toward the
Free plan's 50.
- Anonymous publishing is limited to 20 documents an hour and 50 a day per IP
address.
- Readers can report an anonymous page. Once readers at 3 different addresses
have reported it, it's hidden until we've reviewed it.
The endpoints are under
[Anonymous documents](../api-reference/agent-endpoints.md#anonymous-documents-no-api-key).
## Related pages
- [Who can see a document](./overview.md)
- [Public documents](./public-sharing.md)
- [Workspaces and teams](./workspaces-and-team-access.md)
---
URL: https://docs.opendocs.cc/visibility/public-sharing
# Public documents
A public document can be read by anyone who has the link, without an OpenDocs
account. Use it for things meant for the open web: a changelog, a public guide, a
status page. To send a document to a client or investor, sharing it with their
email is usually better. See [Share with people](./sharing-and-anonymous-links.md).
> **Ask your agent**
>
> "Make the v2.4 changelog public."
>
> "Publish the API migration guide publicly so customers can read it."
## What happens
Two things have to be true before someone outside the workspace can read a
document:
1. **The document is public.** Your agent asks you before making it public, every
time, and the CLI and API refuse without an explicit confirmation.
2. **The workspace allows public documents.** This is the **Allow public posts**
setting in the dashboard, under **Settings → Sharing**. It's off in new
workspaces, and only the workspace owner can change it.
While the setting is off, a public document behaves like a `workspace` one: members
can read it and nobody else can. The dashboard marks it with an amber dot. Your
agent can't see or change the setting, so if a public link doesn't open for
people outside, check it in the dashboard.
When the setting is on:
- Public documents open for anyone with the link, at the usual address:
`opendocs.cc/halvard/changelog-v2-4`, or
`opendocs.cc/halvard/projects/product/changelog-v2-4` in a project.
- Your workspace page, `opendocs.cc/halvard`, becomes visible to anyone and lists
the public documents.
- Search engines aren't blocked from public pages. Treat a public link as published
on the web.
- On Pro and Team, public documents can live on your own domain instead, such as
`notes.halvard.example/changelog-v2-4`, and the opendocs.cc links redirect there.
See [Custom domains](../publishing/custom-domains.md).
Readers can also download the document's Markdown from the page, without its
`private` blocks. See [Private blocks](../publishing/rendering-and-metadata.md#private-blocks).
## Before you make something public
- Remove internal notes, or move them into `private` blocks.
- Check the title, tags and summary read well to outsiders.
- Make sure the workspace slug in the URL is the one you want. Changing it later
breaks every link to the workspace's documents; old slugs don't redirect.
## When not to use public
These are better served by `workspace`, the default, or by sharing:
- "Share this with my team."
- "Let the other workspace members review it."
- "Send it to the Northwind team."
- "Keep it internal but linkable."
## Under the hood
```bash
opendocs publish changelog-v2-4.md --visibility public --confirm-public
opendocs visibility changelog-v2-4 public --confirm-public
opendocs update changelog-v2-4.md --post-id changelog-v2-4 --visibility public --confirm-public
```
The API takes the same confirmation in the request body:
```json
{
"visibility": "public",
"confirmPublic": true
}
```
- Without it, the CLI fails with `confirm_public_required` before sending
anything. The API answers `400`: `invalid_request` from publish and update,
`visibility_change_failed` from the visibility endpoint.
- A public document in a workspace that doesn't allow public documents is accepted,
but nobody outside can read it until the owner turns the setting on.
- The setting is changed in the dashboard only. There's no CLI command or API-key
endpoint for it.
- `opendocs whoami` shows the workspace slug used in URLs. See
[Usernames and workspace slugs](../api-reference/usernames.md) for how it differs
from your username.
## Related pages
- [Who can see a document](./overview.md)
- [Share with people](./sharing-and-anonymous-links.md)
- [Workspaces and teams](./workspaces-and-team-access.md)
- [Custom domains](../publishing/custom-domains.md)
---
URL: https://docs.opendocs.cc/publishing/custom-domains
# Custom domains
On Pro and Team, a workspace can serve its documents on a domain you own:
`notes.halvard.example/q3-plan` instead of `opendocs.cc/halvard/q3-plan`. The
workspace page, projects, tag pages and documents all move there, over HTTPS,
and the opendocs.cc links keep working by redirecting to the new address.
> **Ask your agent**
>
> "Give me the link to the Q3 plan." (Agents use the custom-domain link once
> it's active.)
>
> "Publish the changelog publicly and link it from the README."
## What you need
- **A Pro or Team workspace.** What counts is the workspace's plan: the owner's
Pro or Team plan, or Founder or Creator access, which count as Pro and Team.
On Free, the setting shows a Pro badge.
- **A subdomain you can add DNS records to,** such as `notes.halvard.example`
or `docs.halvard.example`. One per workspace. Root domains
(`halvard.example`) aren't supported: the connection is a CNAME record, which
root domains can't have at most providers.
- **The owner or an admin** sets it up. Members can see the domain and its
status but not change it.
## Set it up
1. In the dashboard, open **Workspace settings** and find **Custom domain**.
2. Enter the domain, for example `notes.halvard.example`, and save. Paste a full
URL if you like; OpenDocs keeps only the domain.
3. Add the two records the card shows at your DNS provider. Each has a copy
button.
| Type | Name | Value |
| --- | --- | --- |
| CNAME | `notes.halvard.example` | `custom.opendocs.cc` |
| TXT | `_opendocs.notes.halvard.example` | `opendocs-verify=` |
The CNAME sends readers to OpenDocs. The TXT record proves the domain is
yours; the token is different for every workspace and domain. **Keep both
records** once the domain is active: OpenDocs checks them every 6 hours,
and a domain whose records fail three checks in a row stops serving.
4. Wait for the status to turn **Active**, or click **Check now**. DNS changes
usually show up within minutes, sometimes a few hours.
5. Click **Visit**. The first visit sets up the HTTPS certificate, which takes a
few seconds.
Not sure where your DNS is managed, or how to add records? While the domain
waits for DNS, the card has **Copy prompt for your agent**: a prompt with your
domain's records that you paste into Claude, ChatGPT or another agent. It finds
your DNS provider and adds the records for you, or walks you through it.
Saving the same domain again keeps its token, so the records stay valid.
Entering a different domain replaces the old one, with a new token.
### Names at your DNS provider
Some providers want the full name (`notes.halvard.example`), others only the
part before your domain (`notes`, and `_opendocs.notes` for the TXT record).
The card shows both. If a provider adds your domain to whatever you type,
entering the full name gives you `notes.halvard.example.halvard.example`, and
the check fails with "No CNAME record found".
- **Cloudflare:** DNS, then Records, then Add record. Set **Proxy status** to
**DNS only** (the grey cloud) on the CNAME. With the orange cloud, Cloudflare
answers for the domain instead of OpenDocs, the certificate can't be issued,
and the check says the domain is proxied by Cloudflare. Use `notes` and
`_opendocs.notes` as the names.
- **GoDaddy:** your domain's DNS page, then Add New Record. Names are relative:
`notes` and `_opendocs.notes`.
- **Namecheap:** Domain List, Manage, then Advanced DNS. Add a CNAME Record and
a TXT Record with the hosts `notes` and `_opendocs.notes`.
- **ISNIC (.is domains):** add the records wherever the domain's name servers
are. If they're ISNIC's DNS service, that's ISNIC's zone editor; if your .is
domain uses another provider's name servers, add them there.
- **Anywhere else** (Route 53, Google Cloud DNS, your hosting company): the
same two records. A trailing dot on the value (`custom.opendocs.cc.`) is fine.
## Status
| Status | What it means |
| --- | --- |
| **Waiting for DNS** | The records aren't there yet, or not as shown. The card says which one. |
| **Verifying** | The records check out. The HTTPS certificate is issued on the first visit, which takes a few seconds. |
| **Active** | Readers get your documents on the domain. |
| **Misconfigured** | The records were removed or changed, and the domain stopped serving. The card says which record and since when. |
| **Paused** | The workspace isn't on Pro or Team any more. Readers are sent to opendocs.cc until it is. |
OpenDocs re-checks every domain every 6 hours. If an active domain fails three
checks in a row, it stops serving, its status becomes **Misconfigured** and the
workspace owner gets an email. Fixing the records brings it back by itself at
the next check, or straight away with **Check now**. A failed **Check now** on
an active domain shows the problem but doesn't count toward the three, and
neither does a lookup that timed out.
## What readers see
| On the custom domain | Shows | Same as |
| --- | --- | --- |
| `/` | The workspace page | `opendocs.cc/halvard` |
| `/q3-plan` | A document in the Default project | `opendocs.cc/halvard/q3-plan` |
| `/projects/launch` | A project page | `opendocs.cc/halvard/projects/launch` |
| `/projects/launch/q3-plan` | A document in a project | `opendocs.cc/halvard/projects/launch/q3-plan` |
| `/tag/finance` | A tag page | `opendocs.cc/halvard/tag/finance` |
| `/projects/launch/tag/finance` | A project's tag page | `opendocs.cc/halvard/projects/launch/tag/finance` |
- **Your workspace's header, white-label if you like.** Pages show your logo
and workspace name instead of the OpenDocs header. The only mention of
OpenDocs is one "Published with OpenDocs" line in the footer, which you can
turn off under **Show "Published with OpenDocs"** in the Custom domain card.
Every link on the page (breadcrumbs, related documents, tags, search) stays
on your domain.
- **One address per page.** On opendocs.cc, every page of the workspace
redirects (308) to the same page on the custom domain, public or not, and
canonical URLs, Open Graph and structured data name the custom domain, so
search engines see one URL per document. (A document whose slug is an app
path such as `login` or `dashboard` stays on opendocs.cc.)
- **Its own sitemap and robots.txt.** `/sitemap.xml` lists the workspace's
public pages on your domain, and `/robots.txt` points to it. A workspace with
no public documents gets a `robots.txt` that disallows everything and an
empty sitemap. The opendocs.cc sitemap leaves the workspace out.
- **Downloads.** PDF, Word and Markdown downloads work on the domain, for public
documents and for signed-in readers' private ones.
- **No tracking.** Custom domains load no OpenDocs analytics, no ad pixels and
no cookie banner.
- **App pages stay on OpenDocs.** Paths such as `/dashboard`, `/login` and
`/signup` go to opendocs.cc. A page that doesn't exist shows your workspace's
"not found" page.
- **Slug changes are safe.** The domain belongs to the workspace, not its slug,
so renaming the workspace's slug doesn't break it.
### Links from OpenDocs
Once the domain is active, OpenDocs hands out custom-domain links for every
published document, public or not: the dashboard (the workspace card,
**View** and **Copy link**), the CLI (0.4.9 and later), and the `publicUrl`
field in API responses (see [Under the hood](#under-the-hood)). Older CLI
versions and old links point to opendocs.cc, which redirects.
## Private documents and sign-in
Documents that aren't public (workspace-only, private, or shared with specific
people) work on the custom domain too, for people who may read them:
1. A reader opens `notes.halvard.example/board-minutes`.
2. The domain quietly checks with opendocs.cc whether they're signed in.
Members of your workspace who already are come straight back signed in,
without seeing a sign-in page. Everyone else is back a moment later on a
"this page is private" page with a **Sign in** button: nobody is asked to
sign in or sign up unless they choose to.
3. **Sign in** goes to opendocs.cc. Members of your workspace then come
straight back. Anyone else, such as someone a document was shared with,
clicks **Continue as their@email** first, because your workspace will see
their name, email address and profile picture.
4. Someone signed in with an account that's neither a member nor has anything
shared with it on your domain stops on opendocs.cc ("This account doesn't
have access"), with **Use another account**. Your domain never learns who
they are.
5. Back on the custom domain they're signed in on that domain only, and the
document opens if they have access to it. Without access they see a
"you don't have access" page, as on opendocs.cc.
- The sign-in lasts 7 days, and ends when they sign out of opendocs.cc.
**Sign out** in the account menu on the custom domain signs them out of
OpenDocs: on the domain and on opendocs.cc.
- On the custom domain readers can read, comment and download. Everything else
(editing, settings) happens on opendocs.cc; **OpenDocs dashboard** in the
account menu opens the dashboard on this workspace.
- The opendocs.cc sign-in never reaches your domain, and the custom-domain
sign-in never reaches opendocs.cc or another custom domain.
## Downgrading and removing
- **Downgrade to Free:** the domain is kept but paused. Readers who open it are
redirected (302) to the same page on opendocs.cc, and opendocs.cc stops
redirecting to it. Upgrading again restores it, with nothing to set up.
- **Remove the domain:** **Remove** in the card, after a confirmation.
opendocs.cc stops redirecting at once and serves the workspace as before,
links point to opendocs.cc again, and sign-ins on the domain end. The domain
itself stops serving within a minute. You can delete the DNS records
afterwards.
- **Deleted the DNS records first?** The next check (within 6 hours, or **Check
now**) notices the CNAME is gone, and from then on opendocs.cc serves the
workspace again instead of redirecting to the domain. Remove the domain in the
card to finish; otherwise it turns **Misconfigured** after three checks and
the owner gets an email.
## Under the hood
The dashboard card uses these endpoints. They accept a session or an API key
(`Authorization: Bearer od_live_...`), so agents and scripts can manage the
domain too.
| Endpoint | Who | What |
| --- | --- | --- |
| `GET /api/v1/workspace/domain?workspaceId=` | Members | The domain, its status, the records to add and the last error |
| `PUT /api/v1/workspace/domain` | Owners and admins, Pro or Team | Connect or replace the domain. Body: `{ "workspaceId", "hostname" }` |
| `POST /api/v1/workspace/domain/check` | Owners and admins | Check the records now. Body: `{ "workspaceId" }`. 12 a minute |
| `PATCH /api/v1/workspace/domain` | Owners and admins, Pro or Team | Settings. Body: `{ "workspaceId", "showPoweredBy": false }` hides "Published with OpenDocs" |
| `DELETE /api/v1/workspace/domain?workspaceId=` | Owners and admins | Remove the domain |
```bash
curl https://api.opendocs.cc/api/v1/workspace/domain \
-X PUT \
-H "Authorization: Bearer od_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{ "workspaceId": "ws_123", "hostname": "notes.halvard.example" }'
```
The response describes the domain, with `state` as the dashboard shows it
(`pending`, `verifying`, `active`, `misconfigured` or `paused`). The full shape
is in the [Workspaces API](/api-reference/workspaces#custom-domain).
Errors follow the usual `{ "error", "message", "docs_url" }` shape:
`plan_required` on Free, `invalid_hostname` for a name OpenDocs can't serve,
`domain_taken` when another workspace has the domain active, and `forbidden`
for members. See [Error codes](/errors).
### `publicUrl`
Every API response that returns a document's `url` (publish, batch publish,
update, get, list, move, visibility, claim) also returns `publicUrl`, the
absolute link to share. It's the custom-domain URL when the domain is active
and the document is published (whatever its visibility), and the opendocs.cc
URL otherwise:
```json
{
"url": "/halvard/q3-plan",
"publicUrl": "https://notes.halvard.example/q3-plan"
}
```
Share `publicUrl`, and use it when one document links to another, so readers
stay on your domain.
## Troubleshooting
- **"No TXT record found at _opendocs..."** The TXT record is missing or under
another name. Check the name doesn't end in your domain twice (see
[Names at your DNS provider](#names-at-your-dns-provider)).
- **"The TXT record ... has a different verification value."** It's from an
earlier attempt. Replace the value with the one in the card.
- **"... points to ..., not custom.opendocs.cc."** The CNAME points somewhere
else, or the name has A records instead. Change it to a CNAME to
`custom.opendocs.cc`, and remove any A or AAAA records for the name.
- **"Use a subdomain such as notes.halvard.example."** Root domains aren't
supported. Connect a subdomain instead.
- **"... is proxied by Cloudflare."** Turn the record's proxy off (grey cloud,
DNS only).
- **Still waiting after you added everything.** DNS changes can take a while to
spread, longer if the record existed before with a long TTL. Click **Check
now** later; OpenDocs also checks every 6 hours on its own.
- **"... is connected to another OpenDocs workspace."** Remove it there first.
If the other workspace is no longer yours to change, replace its
`opendocs-verify` TXT value with yours; once its checks fail, the domain can
be connected here. While another workspace's value is still in the TXT
record, the check says so.
- **The first visit shows a certificate warning or takes a moment.** The
certificate is issued on the first visit after the domain turns active. Wait
a few seconds and reload.
- **"This domain isn't connected to OpenDocs."** The domain points to OpenDocs
but isn't active for any workspace: it's still waiting for its TXT record,
it's misconfigured, or it was removed.
## Related pages
- [Public documents](../visibility/public-sharing.md)
- [Workspaces and teams](../visibility/workspaces-and-team-access.md)
- [Plans and limits](../getting-started/plans-and-limits.md)
- [Workspaces API](/api-reference/workspaces#custom-domain)
---
URL: https://docs.opendocs.cc/visibility/workspaces-and-team-access
# Workspaces and teams
A workspace is where your team's documents live, at `opendocs.cc/`.
Everyone in it can read and edit the workspace's documents, and owners and admins
look after people and settings. Your first workspace is created when you sign up.
> **Ask your agent**
>
> "Invite Sam to our workspace as an admin."
>
> "Let anyone with a halvard.example email join the workspace."
>
> "Who's in the workspace, and are any invitations still pending?"
## What happens
- **Invitations need a yes.** Inviting someone sends an email they accept, so
nobody is added without confirming. Pending invitations count toward the
workspace's member limit.
- **Colleagues can join on their own.** With a company domain set up for auto-join,
anyone who signs in with a verified address at that domain can join as a member.
- **Members see the team's documents.** Every document with `workspace` (or
`public`) visibility is open to every active member. `private` documents stay
with their author.
- **The workspace holds the settings** that apply to everyone's documents: whether
public documents are allowed, the export theme, the Google Drive and
e-signature integrations, and on Pro and Team a
[custom domain](../publishing/custom-domains.md) such as `notes.halvard.example`.
You can belong to several workspaces and switch between them. Member limits are 3
per workspace on Free, 5 on Pro and unlimited on Team; see
[Plans and limits](../getting-started/plans-and-limits.md).
## Who can do what
Every workspace has one owner. Other people are admins or members.
| | Member | Admin | Owner |
| --- | --- | --- | --- |
| Read `workspace` and `public` documents | Yes | Yes | Yes |
| Read a `private` document | Own only | Own only | Own only |
| Publish documents and create projects | Yes | Yes | Yes |
| Edit any document: update, change tags, restore a version | Yes | Yes | Yes |
| Export any document they can read, one or several at once | Yes | Yes | Yes |
| Manage a document: visibility, move, share, unpublish, delete | Own only | Any | Any |
| Rename or delete projects | No | Yes | Yes |
| Invite people, set roles, remove members, set auto-join domains | No | Yes | Yes |
| Change the export theme (the footer needs Pro or Team) | No | Yes | Yes |
| Connect or remove the custom domain (Pro and Team) | No | Yes | Yes |
| Turn on **Allow public posts**, set the default sort | No | No | Yes |
- Admins can make a member an admin. Only the owner can demote or remove an admin.
The owner's role can't be changed, and the owner can't leave the workspace.
- The version history records who made each edit, so open editing stays
accountable. See [Updates and versions](../publishing/update-and-version-history.md).
- Who can use Google Drive and e-signatures is a workspace setting: every member by
default, or admins only. See [Google Drive](../integrations/google-drive.md) and
[E-signatures](../integrations/docuseal.md).
- The rules are the same in the dashboard, the CLI and the API. A change your role
doesn't allow is refused with `forbidden`. In the dashboard, the owner-only
switches are shown disabled for everyone else.
- Roles work on every plan.
## Under the hood
### Team
```bash
opendocs team list # members, pending invitations, auto-join domains
opendocs team invite sam@halvard.example --role admin
opendocs team resend sam@halvard.example
opendocs team revoke sam@halvard.example # cancel a pending invitation
opendocs team role sam@halvard.example member
opendocs team remove sam@halvard.example --yes
opendocs team auto-join add halvard.example
opendocs team auto-join remove halvard.example
```
- `--role` is `member` (default) or `admin`. `opendocs invite ` is a
shortcut for `team invite`.
- `team remove` and `team leave` need `--yes` outside a terminal.
- Auto-join takes only the domain of your own verified email, and refuses consumer
mail providers such as gmail.com and outlook.com.
The person invited accepts from the email, or from their own agent once signed in
with that address (`opendocs login` mentions pending invitations):
```bash
opendocs team invitations # invitations, and workspaces your email domain can join
opendocs team join halvard # accept and switch to it
opendocs team join halvard --no-switch
opendocs team decline halvard
opendocs team leave --yes
```
Accepting from the CLI and auto-join need a verified email; signing in with an
emailed code, Google or GitHub verifies it.
The endpoints are in the [Team and invitations API](../api-reference/team-and-invitations.md):
`POST /api/v1/workspace/team/invite`,
`PATCH /api/v1/workspace/team/members/:memberId/role`,
`DELETE /api/v1/workspace/team/members/:memberId`, and the invitation resend and
cancel routes.
### Workspaces
```bash
opendocs workspace list # every workspace you belong to
opendocs workspace use halvard # switch; the active project resets to Default
opendocs workspace create "Halvard Labs" --slug halvard-labs
opendocs workspace members
```
`workspace create` switches to the new workspace unless you pass `--no-switch`.
### Workspace slugs and usernames
Document URLs use the workspace slug (`opendocs.cc/halvard/...`); your personal
profile uses your username (`opendocs.cc/@dana`). Changing a workspace slug breaks
every existing link to its documents, because old slugs don't redirect. See
[Usernames and workspace slugs](../api-reference/usernames.md) and the
[Workspaces API](../api-reference/workspaces.md). A
[custom domain](../publishing/custom-domains.md) keeps working through a slug
change, because it's tied to the workspace rather than its slug.
## Related pages
- [Who can see a document](./overview.md)
- [Share with people](./sharing-and-anonymous-links.md)
- [Custom domains](../publishing/custom-domains.md)
- [Plans and limits](../getting-started/plans-and-limits.md)
---
URL: https://docs.opendocs.cc/integrations/google-drive
# Google Drive
Connect Google Drive to your workspace once, name the folders people should save
into, and from then on your agent can file any document there as a PDF, Word file
or Markdown. Signed contracts from [DocuSeal](./docuseal.md) can be filed
automatically. Nothing is saved to Drive unless someone asks.
> **Ask your agent**
>
> "Save the board minutes to the Board Minutes folder as a PDF."
>
> "Put version 3 of the Halvard onboarding guide in HR Policies as a Word file, and call it Onboarding guide 2026."
>
> "Which Drive folders can you save to?"
Google Drive is part of the Pro and Team plans. On Free, the dashboard's
**Integrations** page shows an upgrade prompt and agents get `plan_required`.
## What you need
- A workspace on Pro or Team. See [Plans and limits](../getting-started/plans-and-limits.md).
- An owner or admin of the workspace to connect Drive and add folders. This is done
once, in the dashboard; agents can't connect Drive or add folders.
- A Google account that can add files to the folders you want to use: a
Contributor or above on a shared drive, or someone who can edit the folder in My
Drive. This one account is used for everyone in the workspace.
## Connect Google Drive
1. In the [dashboard](https://opendocs.cc/dashboard), open **Integrations** (under
**Workspace** in the sidebar).
2. Under **Google Drive**, click **Connect Google Drive**.
3. Sign in with the Google account that can add files to your shared drives, and
allow access. Leave the Drive permission ticked on Google's screen.
4. You're back on the Integrations page. The card says **Connected** and shows the
account's email.
## Add and name folders
Agents only see the folders you add here, by the names you give them.
1. Click **Add folder**. Google's folder picker opens, titled "Choose a folder for
OpenDocs", with your shared drives and My Drive.
2. Pick a folder.
3. Type the name your agent should use, for example "Board Minutes". It starts as
the folder's own name. Names can be up to 80 characters and must be unique in
the workspace (ignoring case).
4. Click **Save**.
Each folder in the list shows its name and where it lives (the shared drive or My
Drive, then the folder). Use the pencil to rename it and the trash icon to remove
it. Removing a folder only removes it from OpenDocs; nothing in Drive is touched.
## Who can use it
Owners and admins connect Drive, add folders and change settings. Who can save
documents is a workspace setting, under **Settings** on the Integrations page:
| **Who can use integrations** | What it means |
| --- | --- |
| **Every member** (default) | Anyone in the workspace can save to folders and send for signature. |
| **Owners and admins only** | Members can still read and publish documents, but saving to Drive returns `forbidden`. |
Everyone in the workspace can open the Integrations page and see what's connected.
To save a document you also need to be able to read it, the same rule as for
exports.
## What lands in Drive
- **A new file each time.** Saving again creates another file next to the first;
nothing in Drive is overwritten or deleted.
- **File name:** the document's title plus the extension, for example
`Board minutes October 2026.pdf`, unless you ask for another name. The
characters `\ / : * ? " < > |` become spaces, and names are cut at 180
characters.
- **Format:** PDF unless you ask for Word (`.docx`) or Markdown (`.md`). PDF and
Word files use your workspace's [export theme](../publishing/branded-exports.md),
exactly like an export. Markdown is the document's source, with
[`private` blocks](../publishing/rendering-and-metadata.md) removed.
- **Version:** the latest version unless you ask for an earlier one by number
("version 3"). The file's Drive description says which document and version it
came from: `Saved from OpenDocs: "Board minutes October 2026", version 3.`
- **Stored as-is.** Files aren't converted to Google Docs, and Drive keeps their
first revision permanently.
- **Checked.** OpenDocs computes the file's SHA-256 before uploading and compares
it with the checksum Google reports. Your agent tells you if they don't match.
Your agent gives you a link to the new file in Drive. OpenDocs also records every
save: who asked, through which agent, the document and version, the folder, and
both checksums.
### Signed copies
When a signature request finishes, OpenDocs can file the signed PDF and its audit
log in a Drive folder for you, either automatically or when you ask. Both files are
marked read-only in Drive. See
[File signed copies in Google Drive](./docuseal.md#file-signed-copies-in-google-drive).
## Privacy
- **OpenDocs only sees what it created and what you picked.** It connects with
Google's `drive.file` permission, which covers files OpenDocs created and folders
someone picked in the Google Picker. It can't browse, search or read anything
else in your Drive. It also asks for your email address, to show which account
is connected.
- **Only on request.** Publishing or exporting never saves to Drive. A file is
saved only when someone asks for it, or when a signature request was set up to
file its signed copy.
- **One account for the workspace.** Files are created by the connected Google
account, whoever in the workspace asked for the save.
- **Disconnecting** (**Disconnect**, then **Disconnect and forget folders**) revokes
OpenDocs' access with Google and forgets the folder names. Files already saved
stay in Drive.
## Under the hood
Your agent uses two commands. `opendocs integrations` lists what's connected and
the folder names; `opendocs save` saves one document.
```bash
opendocs integrations --json
opendocs save board-minutes.md --folder "Board Minutes" --json
opendocs save halvard-onboarding-guide --folder "HR Policies" --format docx --version 3 --filename "Onboarding guide 2026" --json
```
`` is a post ID, a slug, or a local `.md` file this folder published.
| Flag | Default | Notes |
| --- | --- | --- |
| `--folder ` | Required | A folder name exactly as `opendocs integrations` lists it (case doesn't matter). |
| `--format ` | `pdf` | `pdf`, `docx` or `md`. |
| `--version ` | Latest | Save an earlier version (`3` or `v3`). See `opendocs history`. |
| `--filename ` | Document title | File name in Drive. A `.pdf`, `.docx` or `.md` ending is replaced with the right one. |
Rules agents follow: save only when the user asks, use a folder name exactly as
listed (never guess one), and give the user the Drive link on its own line.
`opendocs integrations --json` (trimmed):
```json
{
"workspace": { "id": "…", "slug": "halvard", "name": "Halvard" },
"tier": "pro",
"role": "member",
"canManage": false,
"canUse": true,
"settings": { "usableBy": "members", "signatureConfirmation": "chat" },
"dashboardUrl": "https://opendocs.cc/dashboard/integrations",
"integrations": [
{
"provider": "google_drive",
"name": "Google Drive",
"status": "connected",
"account": "dana@halvard.example",
"connectedAt": "2026-10-20T09:14:02.000Z",
"destinations": [
{
"id": "…",
"name": "Board Minutes",
"folderName": "Board minutes",
"driveName": "Halvard Leadership",
"url": "https://drive.google.com/drive/folders/…"
}
]
}
]
}
```
`status` is `connected`, `not_connected` or `error` (needs reconnecting; `error`
then holds the reason). Agents use `destinations[].name` as `--folder`.
`opendocs save --json`:
```json
{
"id": "…",
"provider": "google_drive",
"destination": { "id": "…", "name": "Board Minutes", "url": "https://drive.google.com/drive/folders/…" },
"document": { "id": "…", "slug": "board-minutes", "title": "Board minutes October 2026", "versionNumber": 3 },
"file": {
"id": "…",
"name": "Board minutes October 2026.pdf",
"url": "https://drive.google.com/file/d/…/view",
"bytes": 184320,
"sha256": "9f2c…",
"driveSha256": "9f2c…",
"verified": true,
"format": "pdf"
}
}
```
`verified` is `true` when Google's checksum matches `sha256` (or Google didn't
report one; then `driveSha256` is `null`).
The API behind it is `GET /api/v1/integrations?workspaceId=…` and
`POST /api/v1/posts/{postIdOrSlug}/storage` with
`{ "destination", "format", "versionNumber", "filename" }`. Saves count against
the export rate limit (120 a minute). See
[Integrations API](../api-reference/integrations.md).
## Troubleshooting
| What you see | What to do |
| --- | --- |
| `plan_required`, or "Integrations are part of Pro and Team" | Upgrade the workspace at [opendocs.cc/dashboard/billing](https://opendocs.cc/dashboard/billing). |
| `integration_not_connected` | Google Drive isn't connected to this workspace. An owner or admin connects it on the Integrations page. |
| `destination_not_found` | There's no folder by that name. The error lists the folder names; ask your agent which folders exist, or have an admin add one. |
| `forbidden` | The workspace lets only owners and admins use integrations. Ask one of them, or ask them to change the setting. |
| `reconnect_required`, or **Needs reconnecting** in the dashboard | Google access was revoked or expired. An owner or admin clicks **Reconnect** and signs in with the same Google account, which keeps your folders. |
| `destination_unavailable` | Google refused access to that folder: it was deleted or moved, or the connected account lost access. Remove the folder and add it again with **Add folder**. |
| "can't add files to" a folder, when adding it | The connected account can only view that folder. Use a folder where it's a Contributor or above. |
| "OpenDocs needs the Google Drive permission" | The Drive permission was unticked on Google's screen. Connect again and leave it ticked. |
| "The Google sign-in expired or was started elsewhere" | The connection wasn't finished within 10 minutes, or started in another tab. Click **Connect Google Drive** again. |
| `storage_failed` | Google Drive returned an error. Try again; the message has Google's reason. |
| `export_failed` or `export_timeout` | The PDF or Word file couldn't be rendered, so nothing was uploaded. Try again in a minute. |
| "Google Drive's checksum doesn't match" | The file in Drive may differ from what OpenDocs rendered. Open it in Drive to check, and save again if needed. |
## Related pages
- [E-signatures with DocuSeal](./docuseal.md)
- [Branded PDF and Word exports](../publishing/branded-exports.md)
- [Plans and limits](../getting-started/plans-and-limits.md)
- [CLI reference](../cli/reference.md)
- [Integrations API](../api-reference/integrations.md)
---
URL: https://docs.opendocs.cc/integrations/docuseal
# E-signatures with DocuSeal
Connect your workspace's DocuSeal account and your agent can send any document for
signing: contracts, offer letters, board resolutions, policy sign-offs. DocuSeal
emails the signers; the signed PDF and its audit log come back to OpenDocs, and can
be filed in [Google Drive](./google-drive.md). Your agent always prepares a draft
first, and nothing reaches a signer until you confirm it.
> **Ask your agent**
>
> "Send the consulting agreement to John Adams, adams@company.example, for signing."
>
> "Send the board resolution to Dana (dana@halvard.example) and Sam (sam@halvard.example) at the same time, and file the signed copy in Signed Agreements."
>
> "Has John signed the consulting agreement yet?"
E-signatures are part of the Pro and Team plans. On Free, agents get
`plan_required`.
## What you need
- A workspace on Pro or Team. See [Plans and limits](../getting-started/plans-and-limits.md).
- Your own DocuSeal account with API access, on docuseal.com, docuseal.eu or a
self-hosted instance. DocuSeal's API needs a DocuSeal Pro plan, and DocuSeal
bills each document sent through it. Signers get their emails from DocuSeal.
- An owner or admin of the workspace to connect it, once, in the dashboard.
## Connect DocuSeal
1. In the [dashboard](https://opendocs.cc/dashboard), open **Integrations** (under
**Workspace** in the sidebar).
2. Under **DocuSeal**, pick the **Account region**: **docuseal.com**,
**docuseal.eu**, or **Self-hosted**. For self-hosted, enter your
**Instance address** (`https://sign.halvard.example`, for example).
3. Paste your **API key**. On docuseal.com it's at
[console.docuseal.com/api](https://console.docuseal.com/api); on docuseal.eu at
[console.docuseal.eu/api](https://console.docuseal.eu/api); self-hosted, in your
instance's settings under API.
4. Click **Connect DocuSeal**. OpenDocs checks the key with DocuSeal before saving
it, and stores it encrypted. The card then says **Connected**, with the account
and region.
### Add the webhook (recommended)
Once connected, the card shows a webhook address. With it, OpenDocs hears about
each signature as it happens, and files signed copies as soon as the last person
signs.
1. Copy the webhook URL from the DocuSeal card.
2. In DocuSeal, open **Webhooks**, add the URL, and select the form and submission
events.
3. Copy the webhook's signing secret (it starts with `whsec_`) from DocuSeal, paste
it into the field under the URL in OpenDocs, and click **Save**.
Without the webhook, OpenDocs checks DocuSeal when someone looks at a request
(your agent checking the status, or opening the request in the dashboard).
A webhook only prompts OpenDocs to check: the status always comes from DocuSeal's
API, so a forged webhook can't mark anything signed. The URL contains a secret
token; keep it private. If you disconnect DocuSeal and connect it again, the URL
changes, so update it in DocuSeal.
## Mark where people sign
Add a `signature` block where the signatures go, usually at the end of the
document. Each entry is one person:
````md
```signature
- role: Consultant
name: John Adams
title: Principal, Adams Advisory
- role: Halvard
name: Dana
title: Chief Operating Officer
```
````
On the web and in PDF and Word exports, each entry is drawn as a signature box: a
line to sign on, the name (or the role, if there's no name), the title, the role
(when there's a name), and a date line. When the document is sent for signing,
DocuSeal puts a signature field and a date field in each box, and fills in the date
when that person signs. Normal exports don't carry those fields.
The rules:
- The fence's info string is `signature` and nothing else (any case). Three or more
backticks or tildes both work.
- Each entry starts with `- `. The keys are `role` (required), `name` and `title`
(optional); keys are case-insensitive, other keys are ignored, and values can be
quoted.
- Each `role` must be unique in the block (ignoring case), at most 60 characters,
and can't contain `;`, `{`, `}` or `=`.
- A block that breaks these rules (a missing or repeated role, or text before the
first `- `) is shown as an ordinary code block and isn't used for signing.
- A role that appears in more than one block is the same person signing in more
than one place.
- No block? OpenDocs adds one at the end of the PDF it sends, one box per signer.
Your published document isn't changed.
When the document has a block, every role in it needs exactly one signer. Your agent
matches each person you name to a role by the role or by the `name` in the block,
and asks you when it can't tell.
## What happens when you ask
1. **Your agent prepares a draft.** Nothing is emailed. OpenDocs renders the PDF
exactly as signers will get it and records its SHA-256 fingerprint, so what you
approve is byte for byte what's sent.
2. **Your agent shows you the draft:** the document and version, each signer's
name, email and role in signing order, whether they sign one after another or
all at once, the email subject and message, the expiry date, where the signed
copy will be filed, and any warnings, such as an email address outside your
workspace's email domains. It can give you the PDF to read first.
3. **You confirm**, in one of two ways, depending on the workspace setting:
- **In chat** (the default): you say yes, and your agent sends it. "Looks fine"
or silence doesn't count.
- **In the browser**: your agent gives you a link to the request in OpenDocs.
You check the document and every name and email, tick the box, and click
**Send to 1 signer** (or however many). Agents can't send in this mode.
4. **DocuSeal emails the signers**: the first signer, or everyone at once.
5. **When everyone has signed**, the signed PDF and audit log are ready, and filed
in Google Drive if you asked for that.
To change anything (a name, an email, the wording of the document), your agent
cancels the draft and makes a new one. A draft keeps the exact PDF it was made
from, so later edits to the document don't change it.
You can also review drafts yourself in either mode. The **Signature requests**
list on the Integrations page shows the latest 50 in the workspace; drafts are
marked **Waiting for confirmation**. Open one to read the PDF (**Open PDF**), then
send it or click **Discard draft**.
## Signing order
| Order | What signers get | Ask for it |
| --- | --- | --- |
| One after another (default) | Each signer is emailed after the previous one has signed, in the order you named them. | "John first, then Dana." |
| All at once | Everyone is emailed at the same time and can sign in any order. | "Send it to both at the same time." |
## Status, expiry and reminders
Ask your agent where a request stands ("Has John signed yet?"). It checks DocuSeal
and tells you who has signed.
| Request status | In the dashboard | Meaning |
| --- | --- | --- |
| `draft` | Waiting for confirmation | Prepared, not sent. |
| `pending` | Out for signature | Sent; waiting for at least one signer. |
| `completed` | Signed | Everyone has signed. |
| `declined` | Declined | A signer declined. Their reason is shown with their name. |
| `expired` | Expired | The expiry date passed before everyone signed. |
| `cancelled` | Cancelled | Cancelled in OpenDocs; signers can no longer open it. |
Each signer also has a status: not sent, waiting for earlier signers, email sent,
opened, signed (with the time), or declined.
If sending fails, the request stays a draft and shows why ("The last attempt to send
failed: …"). Fix the cause and confirm again.
- **Expiry:** ask for a date ("it should expire on November 30"). The request
expires at the end of that day (UTC); the date must be at least an hour away.
Without one, the request has no expiry date.
- **Reminders:** OpenDocs doesn't send reminder emails. If you want them, look at
your DocuSeal account's settings.
- **Cancelling:** "Cancel the signature request for the consulting agreement."
Your agent checks with you first. A request that was already sent is archived in
DocuSeal, so signers can no longer open it. A completed request can't be
cancelled.
## Signed PDF and audit log
> **Ask your agent**
>
> "Download the signed consulting agreement and its audit log."
When everyone has signed, your agent can download the signed PDF, with every
signature in it, and DocuSeal's audit log, the record of who signed and when. In the
dashboard, open the request and click **Signed PDF** or **Audit log**.
They're named after the document and version, like
`Consulting agreement (v2) – signed.pdf` and
`Consulting agreement (v2) – audit log.pdf`. OpenDocs fetches them from DocuSeal
each time; after sending, it keeps only the SHA-256 of the PDF that was sent, not
the file.
## File signed copies in Google Drive
With [Google Drive](./google-drive.md) connected, the signed PDF and the audit log
can go into one of your named Drive folders:
- **Automatically:** ask when you send ("…and file the signed copy in Signed
Agreements"). Both files are saved there once everyone has signed: right away with
the webhook, otherwise the next time someone checks the request.
- **Later:** "File the signed consulting agreement in Signed Agreements."
Both files are marked read-only in Drive ("Signed – final" and "Audit log –
final"), and the signed PDF's description records the SHA-256 of the original PDF
that was sent. Read-only in Drive is a signal, not an access control; for real
retention, set Google Vault rules on the shared drive.
## Who can use it
| Who | Can |
| --- | --- |
| Owners and admins | Connect and disconnect DocuSeal, set up the webhook, change the settings below. |
| Anyone who can use integrations | Request signatures, and see, send, cancel and download every signature request in the workspace. |
Two workspace settings, under **Settings** on the Integrations page:
- **Who can use integrations:** **Every member** (default) or **Owners and admins
only**.
- **Confirming signature requests:** **In chat** (default: "Your agent shows the
document, names and emails, and sends once you say yes") or **In the browser**
("Agents prepare requests; a person reviews and sends each one here in
OpenDocs").
To send a document for signing, you also need to be able to read it, the same rule
as for exports.
## Under the hood
Signing is always two commands: `sign request` makes a draft, `sign send` sends it.
Agents never run them in the same step, and never pass `--yes` to `sign send`
without the user's explicit yes.
```bash
# 1. Draft. Nothing is emailed.
opendocs sign request consulting-agreement.md \
--signer "Consultant=John Adams " \
--signer "Halvard=Dana " \
--subject "Please sign: consulting agreement" \
--expires 2026-11-30 --file-to "Signed Agreements" --json
# Optional: the exact PDF signers will get (drafts only)
opendocs sign download --kind draft
# 2. Send, after the user said yes to the summary
opendocs sign send --yes --json
# Afterwards
opendocs sign status --json
opendocs sign list --doc consulting-agreement.md --status pending --json
opendocs sign download # signed PDF
opendocs sign download --audit # audit log
opendocs sign save --folder "Signed Agreements" --json
opendocs sign cancel --yes --json # only when the user asks
```
Without `--json`, `sign request` prints the summary your agent reads back to you:
```text
✔ Draft signature request created. Nothing has been sent yet.
Document: Consulting agreement (v2, SHA-256 3b9f0c2a71de)
Request: 5b0e2c9a-7d14-4f3b-9a61-3c8e0d2f7b45
Signers (sequential: each signer is emailed after the previous one has signed):
1. John Adams — Signer 1
Email: the standard DocuSeal invitation (no custom subject or message)
Expires: no expiry date
File to: not filed automatically
⚠ adams@company.example is outside your workspace's email domains.
Next step: Read these signers back to the user and get an explicit yes, then run:
opendocs sign send 5b0e2c9a-7d14-4f3b-9a61-3c8e0d2f7b45 --yes
Offer the user the exact PDF signers will get first: opendocs sign download 5b0e2c9a-7d14-4f3b-9a61-3c8e0d2f7b45 --kind draft
```
### `opendocs sign request `
`` is a post ID, a slug, or a local `.md` file this folder published.
| Flag | Default | Notes |
| --- | --- | --- |
| `--signer ` | Required, repeatable | `"Name "` or `"Role=Name "`, one per signer, in signing order. 1 to 10 signers. A signer without a name or with a malformed email is refused before anything is sent to the server. |
| `--parallel` | Off | Email every signer at once. Without it, one after another. |
| `--subject ` | DocuSeal's invitation | Email subject, up to 200 characters. |
| `--message ` | DocuSeal's invitation | Email message, up to 4,000 characters. A longer one is refused with `invalid_request`. |
| `--expires ` | No expiry | `YYYY-MM-DD`. Expires at the end of that day (UTC), at least an hour from now. |
| `--file-to ` | Not filed | A Drive folder name from `opendocs integrations`. The signed PDF and audit log are saved there once everyone has signed. |
| `--version ` | Latest | Send an earlier version (`3` or `v3`). |
Without a signature block, signers without a role get `Signer 1`, `Signer 2`, and
so on. With one, see [Mark where people sign](#mark-where-people-sign).
### The other `sign` commands
| Command | Flags | Notes |
| --- | --- | --- |
| `opendocs sign send ` | `-y`, `--yes` | Sends a draft. `--yes` is required outside a terminal and with `--json`; in a terminal without it, the CLI shows the summary and asks. In browser mode it fails with `approval_required` and the `approveUrl`. |
| `opendocs sign status ` | | Refreshed from DocuSeal (at most every 30 seconds). |
| `opendocs sign list` (`ls`) | `--doc `, `--status ` | Newest first, up to 50. Shows the last known status without refreshing. `--status`: `draft`, `pending`, `completed`, `declined`, `expired`, `cancelled`, `failed`. |
| `opendocs sign cancel ` | `-y`, `--yes` | Cancels a draft or a pending request. `--yes` is required outside a terminal. |
| `opendocs sign download ` | `--kind ` (default `signed`), `--draft`, `--audit`, `-o`, `--output ` | `--kind` is `signed`, `audit` or `draft`; `--draft` and `--audit` are shortcuts, use only one. The draft PDF exists only until the request is sent. Default output: the server's file name in the current folder. |
| `opendocs sign save ` | `--folder ` (required) | Saves the signed PDF and audit log of a completed request to a Drive folder. |
A signature request in JSON (from `sign request`, `send`, `status`, `cancel`, and
in `sign list` as `requests[]`):
```json
{
"id": "5b0e2c9a-7d14-4f3b-9a61-3c8e0d2f7b45",
"workspaceId": "…",
"status": "draft",
"provider": "docuseal",
"document": {
"postId": "…",
"slug": "consulting-agreement",
"title": "Consulting agreement",
"versionNumber": 2,
"sha256": "3b9f0c2a71de…",
"fileName": "Consulting agreement (v2).pdf"
},
"signers": [
{ "name": "John Adams", "email": "adams@company.example", "role": "Signer 1", "order": 1, "status": "draft" }
],
"order": "sequential",
"message": null,
"expiresAt": null,
"fileTo": null,
"confirmation": {
"mode": "chat",
"approveUrl": "https://opendocs.cc/dashboard/integrations/signatures/5b0e2c9a-7d14-4f3b-9a61-3c8e0d2f7b45"
},
"sentAt": null,
"confirmedVia": null,
"completedAt": null,
"filed": null,
"lastError": null,
"createdAt": "2026-10-24T10:02:11.000Z",
"warnings": ["adams@company.example is outside your workspace's email domains."]
}
```
`warnings` comes only with a new draft. Signer `status` is `draft`, `awaiting`,
`sent`, `opened`, `completed` or `declined`; a signer can also carry `completedAt`
and `declineReason`. `confirmedVia` is `chat` or `browser` once sent. With
parallel signing, every signer has `order: 1`.
The API endpoints:
| Endpoint | What it does |
| --- | --- |
| `POST /api/v1/posts/{postIdOrSlug}/signature-requests` | Create a draft. |
| `POST /api/v1/signature-requests/{id}/send` | Send a draft. Needs `{ "confirm": true }`, or answers `400 confirmation_required`. |
| `GET /api/v1/signature-requests?workspaceId=…` | List (optional `post`, `status`). |
| `GET /api/v1/signature-requests/{id}` | One request, refreshed from DocuSeal. |
| `DELETE /api/v1/signature-requests/{id}` | Cancel. |
| `GET /api/v1/signature-requests/{id}/documents/{kind}` | `draft`, `signed` or `audit` PDF. |
| `POST /api/v1/signature-requests/{id}/storage` | File the signed PDF and audit log to `{ "destination" }`. |
Creating a draft, downloading and filing count against the export rate limit (120 a
minute). Details in the [Integrations API](../api-reference/integrations.md).
## Troubleshooting
| What you see | What to do |
| --- | --- |
| `plan_required` | Upgrade the workspace at [opendocs.cc/dashboard/billing](https://opendocs.cc/dashboard/billing). |
| `integration_not_connected` | DocuSeal isn't connected to this workspace. An owner or admin connects it on the Integrations page. |
| "DocuSeal didn't accept that key on docuseal.com" (or .eu) | Check the key, and that the region matches where your DocuSeal account is. |
| `signer_roles_mismatch` | The document's signature block has roles that don't match the signers. The error lists the roles; tell your agent who signs for each. |
| `invalid_signers` | A signer is missing a name, has an invalid email, or a role is repeated. Your agent asks you for the missing details rather than guessing. |
| `confirm_required` | Your agent tried to send or cancel without your confirmation, and the CLI stopped it. Nothing was sent. |
| `approval_required` | The workspace confirms signature requests in the browser. Open the link your agent gives you and click **Send**. |
| `already_sent` | The request isn't a draft any more. Ask your agent for its status. |
| `not_completed` | Not everyone has signed, so there's no signed PDF yet. |
| `not_available` | The draft PDF is only kept until the request is sent, or DocuSeal doesn't have the document yet. |
| `reconnect_required`, or **Needs reconnecting** | DocuSeal rejected the API key (revoked or rotated). An owner or admin pastes a new key on the DocuSeal card. |
| `send_failed` | DocuSeal didn't accept the request; the message has its reason. The request stays a draft, so you can try again. |
| `invalid_expiry` | Use a date like `2026-11-30`, at least an hour from now. |
| `export_failed` or `export_timeout` | The draft PDF couldn't be rendered. Try again in a minute. |
| The status hasn't changed | Without the webhook, statuses update when someone checks the request. Ask your agent for the status, or add the webhook. |
| The signature block shows as code | The block breaks a rule: check that every entry starts with `- ` and has a unique `role`. |
## Related pages
- [Google Drive](./google-drive.md)
- [Branded PDF and Word exports](../publishing/branded-exports.md)
- [Plans and limits](../getting-started/plans-and-limits.md)
- [CLI reference](../cli/reference.md)
- [Integrations API](../api-reference/integrations.md)
---
URL: https://docs.opendocs.cc/cli/reference
# CLI reference
Most people never type these commands: you ask your agent in plain language and it
runs them for you. This page is for agents, and for anyone who wants the detail.
Agents should pass `--json` on every command and read the JSON instead of the
terminal text. This page matches CLI version 0.4.7.
## Install
```bash
npm install -g @opendocs.cc/cli # Node.js 20 or later
opendocs login --email dana@halvard.example
opendocs login --email dana@halvard.example --code 123456
```
No Node.js? `curl -fsSL https://opendocs.cc/install.sh | bash` installs the agent
skill with a bash client (`scripts/opendocs.sh` in the skill folder, using `curl`
and `jq`) that covers `login`, `whoami`, `publish`, `list`, `pull`, `history`,
`share`, `export`, `claim`, `team` and `theme`.
## Global flags
These work on every command, before or after the subcommand
(`opendocs list --json`).
| Flag | Default | Notes |
| --- | --- | --- |
| `--json` | Off | One JSON object on stdout; errors as JSON on stderr. Spinners, colors and hints are off. |
| `--api-url ` | Saved URL, else `https://api.opendocs.cc` | API for this command. `opendocs login` saves the URL it used. |
| `--client ` | Detected | The agent shown on published versions, sent as the `X-OpenDocs-Client` header. Detected: `claude-code`, `cursor`, `codex`, `gemini`, `opencode`; otherwise `opendocs-cli`. |
| `-h`, `--help` | | Help for any command or subcommand. |
| `-V`, `--version` | | Print the CLI version. After a subcommand, `--version ` is a document version instead (`pull`, `save`, `sign request`). |
## Environment variables
| Variable | Used by | Notes |
| --- | --- | --- |
| `OPENDOCS_API_KEY` | `opendocs login` | Used when `--key` isn't given: the key is checked and saved to the config. Other commands read the saved config, not this variable, so in CI run `opendocs login --json` first. |
| `OPENDOCS_API_URL` | `opendocs login`, `publish --anonymous` | API URL when there's no `--api-url`. `login` saves it to the config; after that the saved URL is used. |
| `OPENDOCS_WEB_URL` | `opendocs login --browser` | Web app to open. Defaults to the one matching the API URL (`https://opendocs.cc`). |
| `OPENDOCS_CLIENT` | Every command | Same as `--client`. |
| `XDG_CONFIG_HOME` | Every command | Moves the config file to `$XDG_CONFIG_HOME/opendocs/config.json`. |
```bash
# CI with an existing key
OPENDOCS_API_KEY=od_live_xxxxx opendocs login --json
opendocs publish docs/ --json
```
## Files
| File | What it holds |
| --- | --- |
| `~/.config/opendocs/config.json` | API key, API URL, user, active workspace and project, and the `organize` preference. Written by `login` and by commands that switch the active workspace or project or change a preference; removed by `logout`. Readable only by you (mode 600). |
| `.opendocs/state.json` | Per folder: which local file is which document and version, the folder's project link, and claim tokens for anonymous documents. Written by `publish`, `clone`, `project link`, and `pull` when the file exists. Commands look for it in the current folder and its parents, up to your home folder. The CLI writes a `.gitignore` next to it so it stays out of git. |
## Output and exit codes
With `--json`, a successful command prints one JSON object to stdout. A failure
prints one JSON object to stderr and exits 1:
```json
{ "error": "destination_not_found", "message": "No folder named \"Minutes\". This workspace's folders: \"Board Minutes\", \"HR Policies\".", "destinations": ["Board Minutes", "HR Policies"] }
```
Some errors carry extra fields an agent can act on: `destinations`, `roles`,
`approveUrl`, `status`, `provider`.
| Exit code | Meaning |
| --- | --- |
| `0` | Success. |
| `1` | The command failed, or a usage error such as a missing required flag. `invite` and `team invite` also exit 1 when any address failed. `publish` also does when it stopped part-way (`aborted: true`), or when some updates of already-published files or some anonymous files failed. |
| `130` | Interrupted with Ctrl-C at the hidden API key prompt. |
A multi-file `publish` or `export` in which some files failed can still exit 0.
Check `failed` (and each `results[].success`) in the JSON.
Command-line usage errors (an unknown flag, a missing required option) print
plain text even with `--json`. Everything else, including `not_logged_in`, is JSON.
When the API rejects the saved key (`401`), the CLI deletes the saved config and
returns `auth_expired`. Sign in again.
## Rate limits and retries
When the API answers `429` with a `Retry-After` of 90 seconds or less, the CLI waits
that long and sends the request again, up to five times, so a big publish or export
slows down instead of failing part-way (CLI 0.4.6 and later). In a terminal the
spinner shows "rate limited, retrying in 12s"; with `--json` it waits silently.
Longer waits, such as the hourly anonymous publish limit, come back as an error
straight away. The limits are on [Plans and limits](../getting-started/plans-and-limits.md#rate-limits).
## Document arguments
Commands that take `` or `` accept a post ID (UUID), a slug in the
active workspace, or a local `.md` file this folder published or cloned (looked up
in `.opendocs/state.json`).
## Account
### `opendocs login`
Sign in or create an account. Alias: `opendocs signup`.
```bash
opendocs login --email dana@halvard.example # emails a 6-digit code
opendocs login --email dana@halvard.example --code 123456 # verifies it, saves a key
opendocs login --browser
opendocs login --key od_live_xxxxx
OPENDOCS_API_KEY=od_live_xxxxx opendocs login
```
| Flag | Default | Notes |
| --- | --- | --- |
| `--email ` | | Email a sign-in code. Works for new and existing accounts. |
| `--code ` | | The 6-digit code from the email. Needs `--email`. |
| `--key-name ` | The detected agent, e.g. `claude-code` | Name of the API key an `--email` login creates. |
| `--key ` | `OPENDOCS_API_KEY` | An existing API key (`od_live_…`) to check and save. |
| `--browser` | | Approve the CLI in your browser; creates an API key. |
| `--web-url ` | `OPENDOCS_WEB_URL`, else matched to the API URL | Web app for `--browser`. |
- `--email` without `--code` sends the code. Without a terminal (agents, CI) or
with `--json`, it stops there and prints the next command.
- With `--code`, a new email gets an account, a username, a workspace at
`opendocs.cc/`, a Default project and an API key. Anonymous documents
published from this folder are claimed into the new workspace.
- With none of `--email`, `--key`, `--browser` or `OPENDOCS_API_KEY`, it waits for
a key at a hidden prompt. Never run bare `opendocs login` from an agent.
- After any login, pending workspace invitations are listed
(`pendingInvitations`); join with `opendocs team join`.
`--email` without `--code`, with `--json`:
```json
{
"status": "code_sent",
"email": "dana@halvard.example",
"accountExists": false,
"expiresInSeconds": 600,
"next": "opendocs login --email dana@halvard.example --code <6-digit code from the email>"
}
```
`--email` with `--code`:
```json
{
"success": true,
"accountCreated": true,
"email": "dana@halvard.example",
"username": "dana",
"workspaceId": "…",
"workspaceSlug": "dana",
"projectId": "…",
"keyName": "claude-code",
"claimed": [],
"pendingInvitations": []
}
```
`--key`, `--browser` or `OPENDOCS_API_KEY`:
```json
{ "success": true, "username": "dana", "workspaceId": "…", "projectId": "…", "pendingInvitations": [] }
```
### `opendocs logout`
Delete the saved config (API key, workspace and project).
```bash
opendocs logout --json # {"success": true}
```
### `opendocs whoami`
Check the saved key and show the account, active workspace, active project, API
URL and document quota.
```bash
opendocs whoami --json
```
```json
{
"userId": "…",
"onboarding": {
"username": "dana",
"workspace": { "id": "…", "name": "Halvard", "slug": "halvard" }
},
"quota": { "documents": { "plan": "pro", "limit": null, "used": 42, "remaining": null } },
"project": { "id": "…", "name": "Default", "slug": "default" },
"folderProject": null,
"organize": "ask"
}
```
`onboarding.workspace` is the CLI's active workspace. `folderProject` is this
folder's [project link](#opendocs-project), if any.
## Publishing
### `opendocs publish `
Publish Markdown files or folders. Files this folder already published are updated
in place, not duplicated.
```bash
opendocs publish q3-investor-update.md --json
opendocs publish docs/*.md --tags api-docs --json
opendocs publish ./vault --project "Board" --json
opendocs publish q3-investor-update.md --export pdf --json
opendocs publish notes.md --anonymous --json
```
| Flag | Default | Notes |
| --- | --- | --- |
| `--title ` | First `# Heading` | Single file only. |
| `--slug ` | From the title | Single file only. |
| `--visibility ` | `workspace` | `private`, `workspace` or `public`. On an update, the current visibility is kept unless you pass this flag. |
| `--confirm-public` | | Required with `--visibility public`. |
| `--tags ` | | Comma-separated, applied to every file. At most 20 per document. |
| `--project ` | See below | Project name, slug or ID. A new name creates the project. |
| `--export ` | | `pdf` or `docx`. After publishing, writes the export next to each source file (`report.md` → `report.pdf`). Exports every file the run published or updated, including unchanged ones. |
| `--anonymous` | | Publish without an account: anyone with the link can read it for 24 hours. Returns a claim URL. Up to 10 files. Ignores `--visibility`, `--tags`, `--project` and `--export`. |
| `--new` | | Always create new documents, even for files this folder already published. |
| `--force` | | Overwrite the live version even if someone published a newer one since your last sync. Without it, that file reports `version_conflict` and is left alone. |
New files go to: `--project`, else the project named by the file's
`projects//` path inside a cloned workspace, else the folder's
`project link`, else the active project. `projectSource` in the result says which
(`flag`, `path`, `folder`, `active`).
Folders are scanned recursively for `.md` files, skipping `.git`, `.hg`,
`.obsidian`, `.opendocs`, `.trash` and `node_modules`. Local images next to the
Markdown are uploaded and their links rewritten.
| Limit | Value |
| --- | --- |
| Markdown per file | 1 MB |
| Files per command | 500 |
| Documents per API batch | 25 (the CLI splits larger runs) |
| Local images per document | 30, up to 10 MB each (JPEG, PNG, WebP, GIF, SVG) |
| Anonymous files per command | 10 |
One new file:
```json
{
"postId": "…",
"slug": "q3-investor-update",
"url": "/halvard/projects/investors/q3-investor-update",
"title": "Q3 investor update",
"versionNumber": 1,
"projectId": "…",
"projectSlug": "investors",
"projectName": "Investors",
"isDefaultProject": false,
"projectSource": "flag"
}
```
With `--export`, the result also has
`"export": { "format": "pdf", "path": "q3-investor-update.pdf", "bytes": 48213, "success": true }`.
Several files, or files this folder already published:
```json
{
"total": 2,
"succeeded": 2,
"failed": 0,
"results": [
{ "success": true, "file": "docs/intro.md", "postId": "…", "slug": "intro", "url": "/halvard/intro", "title": "Intro" }
],
"updated": [
{ "file": "docs/guide.md", "success": true, "action": "updated", "postId": "…", "url": "/halvard/guide", "versionNumber": 4 }
]
}
```
`updated[].action` is `updated`, `unchanged`, `conflict` or `failed`. With
`--export`, an `export` block lists each file's `path`.
### `opendocs update `
Publish a file as a new version of a specific document. The URL stays the same.
```bash
opendocs update revised.md --post-id q3-investor-update --json
```
| Flag | Default | Notes |
| --- | --- | --- |
| `--post-id ` | Required | The document to update. |
| `--title ` | First `# Heading` | |
| `--visibility ` | Current | `private`, `workspace` or `public`. |
| `--confirm-public` | | Required when changing to public. |
| `--tags ` | Current | Replaces the tags with this comma-separated list. |
```json
{
"postId": "…",
"versionId": "…",
"versionNumber": 4,
"slug": "q3-investor-update",
"url": "/halvard/projects/investors/q3-investor-update",
"title": "Q3 investor update",
"visibility": "workspace",
"projectSlug": "investors"
}
```
`unchanged: true` means the content was identical and no new version was made.
### `opendocs visibility `
Change who can read a document without uploading anything. `` is
`private`, `workspace` or `public`.
```bash
opendocs visibility q3-investor-update private --json
opendocs visibility q3-investor-update public --confirm-public --json
```
| Flag | Notes |
| --- | --- |
| `--confirm-public` | Required for `public`. Without it: `confirm_public_required`. |
### `opendocs unpublish `
Take a document offline, keeping its content, version history and slug. It can't
be republished: to bring it back, publish the file as a new document (`--new`).
Unpublished documents don't count toward the Free plan's 50.
```bash
opendocs unpublish q3-investor-update --json
```
### `opendocs delete `
Permanently delete a document and its history. Can't be undone; the slug becomes
free to reuse.
```bash
opendocs delete q3-investor-update --yes --json
```
| Flag | Notes |
| --- | --- |
| `-y`, `--yes` | Skip the confirmation prompt. Required outside a terminal, or it fails with `confirm_required` before any request is made. |
## Reading and exporting
### `opendocs list`
List documents in the active project, newest first. Alias: `opendocs ls`.
```bash
opendocs list --json
opendocs list --all-projects --limit 100 --json
opendocs list --project investors --tag q3 --json
opendocs list --all --json
```
| Flag | Default | Notes |
| --- | --- | --- |
| `--page ` | `1` | |
| `--limit ` | `20` | At most 100. |
| `--tag ` | | Only documents with this tag. |
| `--project ` | Active project | One project, by slug, ID or name. |
| `--all-projects` | | Every project in the active workspace. |
| `--all` | | Every workspace you belong to. |
```json
{
"posts": [
{
"id": "…",
"title": "Q3 investor update",
"slug": "q3-investor-update",
"visibility": "workspace",
"isPublished": true,
"workspaceSlug": "halvard",
"tags": ["investors"],
"updatedAt": "2026-10-24T12:00:00.000Z"
}
],
"pagination": { "page": 1, "limit": 20, "total": 1, "totalPages": 1 },
"scope": "workspace",
"workspaceSlug": "halvard",
"projectSlug": "default",
"otherProjects": [{ "name": "Investors", "slug": "investors", "postCount": 6 }]
}
```
`scope` is `all` with `--all`. `otherProjects` (only when the list is scoped to one
project) shows which other projects have documents, so a short list isn't mistaken
for the whole workspace.
### `opendocs get `
Show one document: URL, ID, slug, project, visibility, published state, version and
tags.
```bash
opendocs get q3-investor-update --json
```
```json
{
"post": {
"id": "…",
"slug": "q3-investor-update",
"title": "Q3 investor update",
"url": "/halvard/projects/investors/q3-investor-update",
"projectSlug": "investors",
"visibility": "workspace",
"isPublished": true,
"versionNumber": 4,
"tags": ["investors"]
}
}
```
### `opendocs pull [idOrSlug]`
Download Markdown for one document, a project, or the whole workspace.
```bash
opendocs pull q3-investor-update # writes q3-investor-update.md
opendocs pull q3-investor-update --stdout
opendocs pull q3-investor-update --version 2 --stdout
opendocs pull --project investors --output ./investors
opendocs pull --workspace --output ./halvard --dry-run
```
| Flag | Default | Notes |
| --- | --- | --- |
| `-o`, `--output ` | `.md` / current folder | A file for one document, a folder for bulk pulls. |
| `--stdout` | | Print one document's Markdown to stdout. |
| `--version ` | Latest | An earlier version of one document (see `opendocs history`). |
| `--project [slugOrId]` | | Bulk: the active project, or the one named. |
| `--workspace` | | Bulk: every project. Default-project documents go at the top, others under `projects//`. |
| `--tag ` | | Bulk: only documents with this tag. |
| `--overwrite` | | Bulk: replace existing files (otherwise it refuses). |
| `--dry-run` | | Bulk: show what would be written. |
Pass a document or bulk flags, not both. Pulling the latest version into a tracked
file brings it back in sync.
### `opendocs export [idsOrSlugs...]`
Export documents to Word or PDF files.
```bash
opendocs export q3-investor-update --format pdf
opendocs export intro guide faq --format pdf --output ./exports
opendocs export --project investors --format pdf
opendocs export q3-investor-update --format pdf --stdout > update.pdf
```
| Flag | Default | Notes |
| --- | --- | --- |
| `-f`, `--format ` | `pdf` | `pdf` or `docx`. Word export needs Pro or Team (`docx_requires_pro` on Free). Before 0.4.7 the default was `docx`. |
| `-o`, `--output ` | `.` / current folder | A file for one document, a folder for several. |
| `--project ` | | Export every document in a project, into `-o` (default `./-`). Not with document arguments or `--stdout`. |
| `--stdout` | | Write the file to stdout. One document only. |
| `--landscape` | | Landscape A4. |
| `--accent-color ` | Workspace theme | Override the accent color for this export, e.g. `#B91C1C`. |
Up to 10 documents per command (`too_many_posts` above that); `--project` exports
in batches of 10. One document:
```json
{ "postId": "…", "format": "pdf", "filename": "q3-investor-update.pdf", "bytes": 48213 }
```
`filename` is the path written. Several documents:
`{ format, total, succeeded, failed, results }`.
## Sync and history
### `opendocs clone [dir]`
Download a workspace, or one project, into a folder linked for re-publishing:
`opendocs publish .` there updates the same documents.
```bash
opendocs clone ./halvard --json
opendocs clone --project investors --json
```
| Flag | Default | Notes |
| --- | --- | --- |
| `[dir]` | The workspace or project slug | Target folder. |
| `--project ` | | Clone one project and link the folder to it. |
| `--tag ` | | Only documents with this tag. |
| `--overwrite` | | Replace files that already exist (otherwise `file_exists`). |
### `opendocs status`
Show what changed locally or online since the last publish, pull or clone, for every
`.md` file under the folder that holds `.opendocs/state.json`.
```bash
opendocs status --json
```
Each file is `up-to-date`, `modified` (changed locally), `behind` (newer version
online), `conflict` (changed on both sides), `missing-locally`, `gone-remotely`,
`untracked` (not published) or `anonymous`. JSON:
`{ root, workspaceSlug, files, summary }`. Without a state file: `no_state`.
### `opendocs history `
List every version of a document, newest first, with who published it and through
which agent.
```bash
opendocs history q3-investor-update.md --json
```
### `opendocs rollback `
Publish an earlier version again as a new version, so it can be undone too. Alias:
`opendocs restore`. Your local file isn't changed; pull to get the restored content.
```bash
opendocs rollback q3-investor-update 3 --json
```
## Organizing
### `opendocs project`
Projects group documents inside a workspace, like branches in a repo. Default-project
URLs are `//`; others are `//projects//`.
```bash
opendocs project list --json
opendocs project current --json
opendocs project create "Investors" --slug investors --use --json
opendocs project use investors --json
opendocs project rename investors --name "Investor relations" --json
opendocs project delete investors --yes --json
opendocs project link "Board" --json
opendocs project unlink --json
```
| Subcommand | Flags | Notes |
| --- | --- | --- |
| `list` (`ls`) | | Projects with document counts. JSON: `{ projects, activeProjectId, folderProject }`. |
| `current` | | The project this folder publishes to: its link, else the active project. JSON `source` is `folder` or `active`. |
| `create ` | `--slug `, `--use` | `--use` makes it the active project. |
| `use ` (`switch`) | | Set the CLI's active project. Local only. |
| `rename ` | `--name ` (required), `--slug ` | Changing the slug changes the project's URLs. |
| `delete ` | `-y`, `--yes` | Only empty, non-default projects. Asks first in a terminal; elsewhere fails with `confirm_required` without `--yes`. |
| `link ` | | Link the current folder to a project (created if the name is new). New documents published from this folder go there. |
| `unlink` | | Remove this folder's link. Publishing falls back to the active project. |
### `opendocs move `
Move a document to another project. Its URL changes; its content doesn't. If the
slug is taken in the target project, the document gets a new one.
```bash
opendocs move q3-investor-update --project investors --json
```
| Flag | Notes |
| --- | --- |
| `--project ` | Required. Project name, slug or ID; a new name creates the project. |
### `opendocs config`
Preferences agents follow across sessions. Today there's one, `organize`: how
readily an agent sorts documents into projects.
```bash
opendocs config get --json # {"organize": "ask"}
opendocs config set organize auto --json
```
| Value | Meaning |
| --- | --- |
| `ask` (default) | Agents suggest a new project when the topic changes, and ask first. |
| `auto` | Agents create and pick projects on their own, and say where things went. |
| `off` | Agents publish to the active project only. |
## Sharing and teams
### `opendocs share [people...]`
Share a document with people outside the workspace, by email or a whole `@domain`.
They verify their email with a code and see only that document. With no people,
lists who it's shared with.
```bash
opendocs share q3-investor-update sam@northwind.example @northwind.example --json
opendocs share q3-investor-update --json
opendocs share q3-investor-update sam@northwind.example --remove --json
```
| Flag | Default | Notes |
| --- | --- | --- |
| `--remove` | | Stop sharing with these people or domains. |
| `--no-notify` | Emails are sent | Don't email the people you add. |
### `opendocs claim [claimUrlOrToken]`
Keep anonymous documents by moving them into the active workspace (and active
project). With no argument, claims everything this folder published anonymously.
```bash
opendocs claim --json
opendocs claim https://opendocs.cc/claim/abc123 --visibility private --json
```
| Flag | Default | Notes |
| --- | --- | --- |
| `--visibility ` | `workspace` | `private` or `workspace`. Applies when you pass a claim URL or token. |
Claimed files from this folder become tracked, so publishing them again updates the
claimed documents.
### `opendocs workspace`
```bash
opendocs workspace list --json
opendocs workspace use halvard --json
opendocs workspace create "Halvard Research" --slug halvard-research --json
opendocs workspace members --json
```
| Subcommand | Flags | Notes |
| --- | --- | --- |
| `list` (`ls`) | | Workspaces you belong to, with your role. JSON: `{ workspaces, activeSlug }`. |
| `use ` (`switch`) | | Set the CLI's active workspace and its Default project. Local only; the dashboard isn't affected. |
| `create ` | `--slug `, `--no-switch` | Create a workspace and switch to it, unless `--no-switch`. |
| `members` | | Members of the active workspace. |
### `opendocs team`
Members, invitations and auto-join for the active workspace, and invitations sent to
you. With no subcommand, same as `team list`.
```bash
opendocs team list --json
opendocs team invite sam@halvard.example --role admin --json
opendocs team invitations --json
opendocs team join halvard --json
opendocs team auto-join add halvard.example --json
```
| Subcommand | Flags | Notes |
| --- | --- | --- |
| `list` (`ls`) | | Members, pending invitations and auto-join domains. |
| `invite ` | `--role ` (default `member`) | `member` or `admin`. People get an email and must accept. |
| `revoke ` | | Cancel a pending invitation. |
| `resend ` | | Email a pending invitation again. |
| `role ` | | Change a member's role to `admin` or `member`. |
| `remove ` | `-y`, `--yes` | Remove a member. `--yes` is required outside a terminal. |
| `leave` | `-y`, `--yes` | Leave the active workspace. `--yes` is required outside a terminal. |
| `invitations` | | Invitations sent to you, and workspaces you can join through your email domain. |
| `join [workspace]` | `--no-switch` | Accept an invitation (or join through your domain) and switch to it. The slug is optional when there's only one. |
| `decline ` | | Decline an invitation. |
| `auto-join [add\|remove] [domain]` | | Let anyone with a verified email at a domain join. No arguments lists the domains. Admins. |
### `opendocs invite `
Invite people to the active workspace. Same as `team invite`; addresses can also be
comma-separated.
```bash
opendocs invite sam@halvard.example dana@halvard.example --role member --json
```
| Flag | Default | Notes |
| --- | --- | --- |
| `--role ` | `member` | `member` or `admin`. |
## Export theme
### `opendocs theme`
The brand color, font, logo and footer of PDF and Word exports in the active
workspace. Reading is open to everyone; changes need Pro or Team and an owner or
admin. Agents ask before changing the theme. With no subcommand, same as
`theme show`. See [Branded PDF and Word exports](../publishing/branded-exports.md).
```bash
opendocs theme --json
opendocs theme presets --json
opendocs theme check "#13294B"
opendocs theme set --preset boardroom --yes --json
opendocs theme set --color "#13294B" --font "IBM Plex Sans" --yes --json
opendocs theme footer --company "Halvard" --tagline "Field research, done carefully" --on --yes --json
opendocs theme logo ./halvard-logo.png --yes --json
```
| Subcommand | Flags | Notes |
| --- | --- | --- |
| `show` | | The current theme, and whether you can change it and its footer. |
| `presets` | | The curated color and font presets. |
| `fonts` | | Fonts available in exports. |
| `check ` | | A color's contrast on white, without changing anything. |
| `set` | `--preset `, `--color `, `--font `, `--logo-in-exports `, `--allow-low-contrast`, `-y`, `--yes` | Change the theme. The brand color must be dark (4.5:1 on white or more), or it's refused with `low_contrast` unless you pass `--allow-low-contrast`. |
| `footer` | `--company `, `--tagline `, `--link-url `, `--link-label `, `--on`, `--off`, `-y`, `--yes` | The footer at the end of every export. Pro and Team; Free exports keep "Made with OpenDocs". `--company` defaults to the workspace name. |
| `logo [file]` | `--remove`, `-y`, `--yes` | Upload the workspace logo (PNG, JPEG or WebP, under 2 MB) or remove it. |
`set`, `footer` and `logo` need `--yes` outside a terminal (`confirm_required`
otherwise).
## Integrations
Google Drive and DocuSeal, on Pro and Team. Owners and admins connect them in the
dashboard; these commands use them. See [Google Drive](../integrations/google-drive.md)
and [E-signatures with DocuSeal](../integrations/docuseal.md).
### `opendocs integrations`
What the active workspace has connected, its named Drive folders, who may use
integrations, and how signature requests are confirmed. Read-only.
```bash
opendocs integrations --json
```
JSON:
`{ workspace, tier, role, canManage, canUse, settings, dashboardUrl, integrations }`,
where `settings` is `{ usableBy, signatureConfirmation }`. Drive folder names are in
`integrations[].destinations[].name`. The full shape is on
[Google Drive](../integrations/google-drive.md#under-the-hood).
### `opendocs save `
Save a document to a named Google Drive folder. Only when the user asks.
```bash
opendocs save board-minutes.md --folder "Board Minutes" --json
opendocs save halvard-onboarding-guide --folder "HR Policies" --format docx --version 3 --filename "Onboarding guide 2026" --json
```
| Flag | Default | Notes |
| --- | --- | --- |
| `--folder ` | Required | A folder name from `opendocs integrations`. |
| `--format ` | `pdf` | `pdf`, `docx` or `md`. |
| `--version ` | Latest | An earlier version. |
| `--filename ` | The document title | File name in Drive; the format's extension is added. |
### `opendocs sign`
E-signatures through the workspace's DocuSeal account. `request` makes a draft and
sends nothing; `send` sends it, only after the user confirmed every signer.
```bash
opendocs sign request consulting-agreement.md --signer "John Adams " --json
opendocs sign send --yes --json
opendocs sign status --json
```
| Subcommand | Flags | Notes |
| --- | --- | --- |
| `request ` | `--signer ` (repeat, required), `--parallel`, `--subject `, `--message `, `--expires `, `--file-to `, `--version ` | Create a draft. `--signer` is `"Name "` or `"Role=Name "`, in signing order, 1 to 10. Sequential unless `--parallel`. `--expires` is `YYYY-MM-DD`. `--file-to` files the signed PDF and audit log in a Drive folder once everyone has signed. |
| `send ` | `-y`, `--yes` | Send a draft. `--yes` is required outside a terminal and with `--json` (`confirm_required` otherwise, before any request). In browser-confirmation workspaces: `approval_required` with `approveUrl`. |
| `status ` | | Where it stands, refreshed from DocuSeal. |
| `list` (`ls`) | `--doc `, `--status ` | Newest first, up to 50. `--status`: `draft`, `pending`, `completed`, `declined`, `expired`, `cancelled`, `failed`. |
| `cancel ` | `-y`, `--yes` | Cancel a draft or pending request. `--yes` is required outside a terminal. |
| `download ` | `--kind ` (default `signed`), `--draft`, `--audit`, `-o`, `--output ` | `signed`, `audit` (the audit log) or `draft` (the exact PDF signers will get, until it's sent). |
| `save ` | `--folder ` (required) | Save a completed request's signed PDF and audit log to a Drive folder. |
The full flag reference and JSON are on
[E-signatures with DocuSeal](../integrations/docuseal.md#under-the-hood).
## Agents
### `opendocs agent`
Print the instructions bundled with this CLI version for AI agents, or install them
as a skill. Needs no login and fetches nothing.
```bash
opendocs agent # short reference
opendocs agent --full # the full SKILL.md
opendocs agent --cli # CLI-only reference
opendocs agent --api # API-only reference
opendocs agent --install # every agent found on this machine
opendocs agent --install --agent codex cursor # just these, even if not found
opendocs agent --install --list # supported agents and where they read skills
opendocs agent --install ./.claude/skills/opendocs # one folder, e.g. in a repository
```
| Flag | Default | Notes |
| --- | --- | --- |
| `--full` | | The full bundled `SKILL.md`. |
| `--cli` | | CLI-only reference. |
| `--api` | | API-only reference. |
| `--install [dir]` | Every detected agent | Write `SKILL.md` and `scripts/opendocs.sh` into each agent's skills folder, or into the folder you name. |
| `--agent ` | | With `--install`: only these agents, creating their folders if needed. |
| `--list` | | With `--install`: show the supported agents, their folders and whether they're detected, without installing. |
Installing for every agent, `--agent` and `--list` need CLI 0.5.0 or later
(older versions write `~/.claude/skills/opendocs` only). `--install` finds an
agent by its config folder (`~/.codex`, `~/.cursor`…) and
writes the skill where that agent reads it. Agents that read the shared
`~/.agents/skills` folder get one copy there:
| Agent (`--agent` id) | Skills folder |
| --- | --- |
| Claude Code (`claude-code`) | `~/.claude/skills` |
| Cline (`cline`) | `~/.cline/skills` |
| Hermes Agent (`hermes-agent`) | `~/.hermes/skills` |
| Kiro CLI (`kiro-cli`) | `~/.kiro/skills` |
| Codex (`codex`), Cursor (`cursor`), GitHub Copilot (`github-copilot`), Gemini CLI (`gemini-cli`), opencode (`opencode`), OpenClaw (`openclaw`), Windsurf (`windsurf`), Amp (`amp`), Goose (`goose`), Grok (`grok`) | `~/.agents/skills` |
It never deletes anything, leaves identical files alone, and skips skill
folders that are links (such as the ones `npx skills add` makes). Use one of
`--full`, `--cli` and `--api`. With `--json`:
`{ "variant": "concise", "version": "…", "content": "…" }`, or for `--install`
`{ "installed": [{ "agent", "path", "status" }], "skipped": [{ "agent", "reason" }], "version": "…" }`.
## Common errors
| Error | What to do |
| --- | --- |
| `not_logged_in` | No saved login. Run `opendocs login --email `. |
| `auth_expired` | The key was revoked; the CLI removed it. Sign in again. |
| `no_workspace` | The config has no active workspace. Run `opendocs login` again. |
| `document_limit` | The Free plan's 50 documents are used. Upgrade, unpublish old documents, or publish fewer. |
| `doc_too_large` | Split the Markdown file (1 MB limit). |
| `too_many_files` | More than 500 files (10 anonymously). Publish in smaller groups. |
| `too_many_posts` | More than 10 documents in one export. Split it. |
| `version_conflict` | Someone published a newer version. Pull it, or re-run with `--force` only if the user agrees. |
| `confirm_public_required` | Re-run with `--confirm-public`, only after the user said yes to a public link. |
| `confirm_required` | A command that needs confirmation ran without `--yes` outside a terminal. Nothing was done. Ask the user first. |
| `not_a_member` | Not a member of that workspace. Run `opendocs workspace list --json` and pick one. |
| `image_upload_failed` | Fix or remove the local image reference and retry. |
| `rate_limited` | The API asked for a wait longer than 90 seconds, or five retries ran out. Wait for `Retry-After`, then retry. |
| `plan_required` | The feature needs Pro or Team (the export footer, integrations). Word export on Free returns `docx_requires_pro`. |
| `forbidden` | Your role can't do this (changing the theme, or integrations set to admins only). |
| `integration_not_connected` | Google Drive or DocuSeal isn't connected. An owner or admin connects it; `opendocs integrations` has the link. |
| `destination_not_found` | No Drive folder by that name; `destinations` lists them. Never guess one. |
| `approval_required` | The workspace confirms signature requests in the browser. Give the user `approveUrl`. |
| `signer_roles_mismatch` | The signers don't match the document's signature block; `roles` lists the roles. |
All API error codes are in [Error codes](../errors.md).
---
URL: https://docs.opendocs.cc/reference/mcp-tools
# MCP tools reference
The OpenDocs MCP server (`https://mcp.opendocs.cc/mcp`) offers 41 tools. An app only sees the tools for the permissions you approved when you connected it. You don't call these yourself: you ask in plain words and the app picks the tool. See [Connect OpenDocs over MCP](../integrations/mcp.md) to set it up.
**Behaviour:** *Read only* tools never change anything. *Asks you first* tools change or remove things; apps like Claude ask before running them, and OpenDocs also requires an explicit confirmation for deleting, going public and sending for signature. *Visible to others* tools publish, share or email.
## Account and defaults
Who you are, your workspaces and where new documents go.
| Tool | What it does | Permission | Behaviour | Parameters |
|---|---|---|---|---|
| `get_account` | Who the user is in OpenDocs: their workspaces (with role), the plan and document quota of the default workspace, where new documents go by default (workspace, project, organise mode), pending invitations, connected integrations (Google Drive folder names, e-signature) and what this app is allowed to do. | Read | Read only | none |
| `set_defaults` | Change where new documents go for this connection: the default workspace, the default project (or null to use the workspace's Default project) and the organise mode (ask: ask before creating projects for new topics; auto: create them and say so; off: always use the default project). | Read | Changes your data | `workspace`, `project`, `organize` |
## Reading documents
Find, open and look back through documents.
| Tool | What it does | Permission | Behaviour | Parameters |
|---|---|---|---|---|
| `list_documents` | List the user's documents, newest first, or search them by words in the title or summary (query). | Read | Read only | `query`, `project`, `tag`, `workspace`, `page`, `limit` |
| `get_document` | Open a document: its title, link, project, who can open it, who it's shared with, current version number, and its Markdown (or an older version's). | Read | Read only | `document`, `version`, `include_markdown`, `offset` |
| `get_document_history` | Every published version of a document, newest first, with when and from which app it was published. | Read | Read only | `document` |
| `list_projects` | The projects in a workspace with how many documents each has and their recent titles. | Read | Read only | `workspace` |
## Writing documents
Publish, change, share and remove documents.
| Tool | What it does | Permission | Behaviour | Parameters |
|---|---|---|---|---|
| `publish_document` | Publish Markdown as a new OpenDocs document and get its link. | Create and change | Visible to others | `markdown`, `title`, `slug`, `project`, `workspace`, `visibility`, `confirm_public`, `tags` |
| `publish_documents` | Publish up to 25 related documents in one call (one call, never a loop of publish_document). | Create and change | Visible to others | `documents`, `project`, `workspace`, `visibility`, `confirm_public`, `tags` |
| `edit_document` | Make targeted changes to a document without resending all of it: each edit replaces exact text (find) with new text (replace). | Create and change | Asks you first | `document`, `edits`, `base_version` |
| `update_document` | Replace a document's Markdown, title or tags, creating a new version at the same link (older versions are kept). | Create and change | Asks you first | `document`, `markdown`, `title`, `tags`, `base_version`, `force` |
| `restore_document_version` | Bring back an older version of a document by publishing its content as a new version at the same link. | Create and change | Visible to others | `document`, `version` |
| `move_document` | Move a document to another project in the same workspace (by project name, slug or ID; a new name creates the project). | Create and change | Asks you first | `document`, `project` |
| `set_document_visibility` | Change a document's visibility: private (only the user), workspace (workspace members) or public (anyone with the link). | Create and change | Asks you first | `document`, `visibility`, `confirm_public` |
| `share_document` | Give specific people outside the workspace access to one document, or take it away. | Create and change | Asks you first | `document`, `add`, `remove`, `notify` |
| `unpublish_document` | Take a document offline: its link stops working but the content, history and link are kept, and it no longer counts toward the workspace's document limit. | Create and change | Asks you first | `document` |
| `delete_document` | Permanently delete a document with every version. | Create and change | Asks you first | `document`, `confirm` |
| `claim_anonymous_document` | Move a document that was published without an account (a 24-hour link) into the user's workspace so it stays. | Create and change | Changes your data | `claim`, `project`, `workspace`, `visibility` |
| `upload_image` | Store an image in OpenDocs and get a permanent link to put in a document as ``. | Create and change | Changes your data | `data_base64`, `file`, `filename`, `workspace` |
## Files
PDF and Word exports, as download links.
| Tool | What it does | Permission | Behaviour | Parameters |
|---|---|---|---|---|
| `export_document` | Turn one or more documents (up to 10) into PDF or Word files with the workspace's branding, and get a download link for each. | Read | Read only | `documents`, `format`, `landscape`, `accent_color` |
## Projects
Group related documents.
| Tool | What it does | Permission | Behaviour | Parameters |
|---|---|---|---|---|
| `create_project` | Create a project in a workspace. | Create and change | Changes your data | `name`, `slug`, `workspace` |
| `rename_project` | Rename a project, and optionally change its slug. | Create and change | Asks you first | `project`, `name`, `slug`, `workspace` |
| `delete_project` | Delete a project. | Create and change | Asks you first | `project`, `confirm`, `workspace` |
## Team and workspaces
Needs the "Manage team members, workspaces and export branding" permission, except reading the team and answering your own invitations.
| Tool | What it does | Permission | Behaviour | Parameters |
|---|---|---|---|---|
| `list_team` | Who is in a workspace: members with their name, email and role, plus pending invitations and auto-join email domains. | Read | Read only | `workspace` |
| `invite_people` | Invite people to a workspace by email. | Team and workspace admin | Visible to others | `emails`, `role`, `workspace` |
| `change_member_role` | Make a workspace member an admin, or an admin a member again. | Team and workspace admin | Asks you first | `email`, `role`, `workspace` |
| `resend_invitation` | Email a pending workspace invitation to the person again, for example when they can't find it. | Team and workspace admin | Visible to others | `email`, `workspace` |
| `revoke_invitation` | Cancel a workspace invitation that wasn't accepted yet: the link in the person's email stops working. | Team and workspace admin | Asks you first | `email`, `workspace` |
| `remove_team_member` | Remove a member from a workspace. | Team and workspace admin | Asks you first | `email`, `confirm`, `workspace` |
| `respond_to_invitation` | Accept an invitation to a workspace, join a workspace that's open to the user's email domain, or decline an invitation. | Create and change | Changes your data | `workspace`, `accept` |
| `leave_workspace` | Leave a workspace the user belongs to. | Create and change | Asks you first | `workspace`, `confirm` |
| `create_workspace` | Create a new workspace, with the user as owner. | Team and workspace admin | Changes your data | `name`, `slug` |
| `set_auto_join_domains` | Let anyone who signs in with a verified email at the company's domain join a workspace as a member without an invitation (add), or stop that (remove). | Team and workspace admin | Changes your data | `add`, `remove`, `workspace` |
## Export theme
The colour, font, logo and footer of every PDF and Word export in a workspace.
| Tool | What it does | Permission | Behaviour | Parameters |
|---|---|---|---|---|
| `get_export_theme` | The look of the workspace's PDF and Word exports: brand colour, font, preset, logo and footer, whether the user may change them, plus the curated presets (with what each suits), the available fonts and the contrast rules. | Read | Read only | `workspace` |
| `update_export_theme` | Change the brand colour, font, preset, logo or footer used in every PDF and Word export in the workspace. | Team and workspace admin | Changes your data | `preset`, `color`, `font`, `logo_in_exports`, `footer`, `logo_url`, `allow_low_contrast`, `confirm`, `workspace` |
## Google Drive and e-signature
Needs the "Google Drive and e-signatures" permission, and a Pro or Team workspace with Drive or DocuSeal connected in Dashboard → Integrations.
| Tool | What it does | Permission | Behaviour | Parameters |
|---|---|---|---|---|
| `save_to_drive` | Save a document as a PDF (default), Word or Markdown file in one of the workspace's Google Drive folders. | Drive and e-signatures | Visible to others | `document`, `folder`, `format`, `version`, `filename` |
| `create_signature_draft` | Create a draft signature request with DocuSeal. | Drive and e-signatures | Changes your data | `document`, `signers`, `order`, `subject`, `message`, `expires`, `file_to`, `version` |
| `send_signature_request` | Send a draft signature request (made with create_signature_draft): DocuSeal emails each signer a link to sign, in the draft's order. | Drive and e-signatures | Asks you first | `request_id`, `confirm` |
| `list_signature_requests` | The workspace's signature requests, newest first (up to 50), with status and how many have signed. | Drive and e-signatures | Read only | `document`, `status`, `workspace` |
| `get_signature_request` | Where a signature request stands: its status, each signer's status (not sent, email sent, opened, signed, declined) and the details read back before sending. | Drive and e-signatures | Read only | `request_id` |
| `cancel_signature_request` | Cancel a draft or pending signature request; signers can no longer sign it. | Drive and e-signatures | Asks you first | `request_id`, `confirm` |
| `file_signed_documents` | Save a completed signature request's signed PDF and audit log (signing certificate) in one of the workspace's Google Drive folders. | Drive and e-signatures | Visible to others | `request_id`, `folder` |
---
URL: https://docs.opendocs.cc/getting-started/cli-quickstart
# Use the CLI yourself
If you'd rather type the commands than ask an agent, the `opendocs` CLI does
everything your agent does: publish Markdown to a link, update it, export PDF
and Word files, and share it. These are the same commands your agent runs.
This page covers the handful you'll use most; the
[CLI reference](../cli/reference.md) has the rest.
## Install
```bash
npm install -g @opendocs.cc/cli # Node.js 20+
opendocs --version # 0.4.7 or later
```
## Sign in
```bash
opendocs login --email dana@halvard.example # emails you a 6-digit code
opendocs login --email dana@halvard.example --code 482913
```
If the email is new, this creates your account, a workspace at
`opendocs.cc/` and a Default project, and saves an API key in your
local config. Existing accounts sign in. Codes expire after 10 minutes. No
browser needed.
Other ways in:
```bash
opendocs login --browser # approve the CLI from a signed-in browser
opendocs login --key od_live_xxxxx # an API key from the dashboard
opendocs login # paste a key at the prompt
```
Check where you are:
```bash
opendocs whoami
```
It shows your username, the active workspace and project, and the API URL.
`opendocs whoami --json` adds your document quota.
## Publish
```bash
opendocs publish q3-investor-update.md
```
The first `# Heading` becomes the title, and you get a link like:
```text
opendocs.cc/halvard/q3-investor-update
```
The first part is your workspace's slug, not your username (see
[Usernames and workspace slugs](../api-reference/usernames.md)). Only members
of your workspace can open it until you change that.
Edit the file and publish it again from the same folder: the link stays the
same and you get a new version. The CLI remembers what each folder published in
`.opendocs/state.json`.
```bash
opendocs publish q3-investor-update.md # again: version 2, same link
```
A more explicit first publish:
```bash
opendocs publish q3-investor-update.md \
--title "Q3 investor update" \
--slug q3-investor-update \
--project investors \
--tags investors,q3-2026
```
## Export
Publish and get a file in one step. The PDF lands next to the Markdown:
```bash
opendocs publish q3-investor-update.md --export pdf
```
Or export something already published:
```bash
opendocs export q3-investor-update --format pdf
opendocs export q3-investor-update --format docx -o ~/Desktop/q3-update.docx
```
`export` writes a PDF unless you pass `--format docx`. PDF works
on every plan with your workspace's export theme; Free PDFs have a "Made with
OpenDocs" footer. Word export and your own footer need Pro or Team. See
[PDF, Word and branding](../publishing/branded-exports.md).
## The commands that matter
| Command | What it does |
| --- | --- |
| `opendocs publish ` | Publish; files this folder published before are updated. |
| `opendocs list` | Documents in the active project (`--all-projects`, `--all`, `--tag `). |
| `opendocs get ` | Details of one document, including its URL and version. |
| `opendocs pull ` | Download the Markdown (`--stdout` to print it, `--version ` for an old one). |
| `opendocs status` | What changed locally or online since the last sync. |
| `opendocs history ` | Every version, who published it and through which agent. |
| `opendocs rollback