Skip to main content
Docs commands require a Personal Access Token (cp_pat_...).

Browse the Document Tree

copera docs tree
Output:
[
  {
    "_id": "66e3f4a5b6c7d8e9f0a1b2c3",
    "title": "Product Roadmap",
    "owner": "64f1a2b3c4d5e6f7a8b9c0d1",
    "hasChildren": true,
    "children": [
      {
        "_id": "66e3f4a5b6c7d8e9f0a1b2d4",
        "title": "Q2 Planning",
        "parent": "66e3f4a5b6c7d8e9f0a1b2c3",
        "owner": "64f1a2b3c4d5e6f7a8b9c0d1",
        "hasChildren": false,
        "starred": false,
        "createdAt": "2026-01-20T10:35:48.220Z",
        "updatedAt": "2026-01-20T10:35:48.220Z"
      }
    ],
    "starred": false,
    "createdAt": "2026-01-20T10:35:48.105Z",
    "updatedAt": "2026-01-20T10:35:48.105Z"
  }
]
Browse a subtree starting from a specific document:
copera docs tree --parent <doc-id>

Read a Document

Get metadata

copera docs get <doc-id>
Returns document metadata including title, owner, dates, icon, and cover.

Get content as Markdown

copera docs content <doc-id>
The CLI caches document content locally for faster subsequent reads. To bypass the cache:
copera docs content <doc-id> --no-cache

Search Documents

copera docs search "keyword"
Returns matching documents with highlighted results. Search covers both titles and body content.

Create a Document

copera docs create --title "My New Document"
Output:
{
  "_id": "67a4b5c6d7e8f9a0b1c2d3e4",
  "title": "My New Document",
  "owner": "64f1a2b3c4d5e6f7a8b9c0d1",
  "hasChildren": false,
  "starred": false,
  "createdAt": "2026-03-12T09:22:15.430Z",
  "updatedAt": "2026-03-12T09:22:15.430Z"
}

Update a Document

Replace content (default)

copera docs update <doc-id> --content "# New Title\n\nFresh content here."

Append content

copera docs update <doc-id> --operation append --content "\n## Added Section\n\nAppended via CLI."

Prepend content

copera docs update <doc-id> --operation prepend --content "# Important Note\n\n"

Update from stdin

cat content.md | copera docs update <doc-id>
Content updates are processed asynchronously — the API returns HTTP 202 and the content is updated shortly after.

Delete a Document

copera docs delete <doc-id> --force
Only the document owner can delete. This is a soft-delete.

Common Workflows

Create and populate a document

1

Create the document

copera docs create --title "Meeting Notes - Q1 Review"
Copy the _id from the output.
2

Add initial content

copera docs update <doc-id> --content "# Q1 Review\n\n## Attendees\n\n- Alice\n- Bob"
3

Append more content later

copera docs update <doc-id> --operation append \
  --content "\n## Action Items\n\n- Follow up with marketing"

Pipe content from a file

cat ./report.md | copera docs update <doc-id>

Script: export all docs to files

# Get all root doc IDs and save content locally
for id in $(copera docs tree --json | jq -r '.[].\_id'); do
  copera docs content "$id" > "${id}.md"
done