Use with Claude Code and Codex
Install and sign in once per computer. Then tell your agent about Octonote once — per project or for every project.
Claude Code
$ octonote setup claude # this project's CLAUDE.md
$ octonote setup claude --global # every project (~/.claude/CLAUDE.md)
$ octonote setup claude --skill # also install the Octonote skillThe skill loads the full guide whenever Octonote comes up. To skip the permission prompt each time Claude runs a command, allow it in .claude/settings.json (or ~/.claude/settings.json):
{ "permissions": { "allow": ["Bash(octonote:*)"] } }Codex
$ octonote setup codex # this project's AGENTS.md
$ octonote setup codex --global # every project (~/.codex/AGENTS.md)Codex runs commands in a sandbox that blocks the network by default, so octonote would fail with NETWORK. Allow it (or approve the command when Codex asks):
[sandbox_workspace_write]
network_access = trueCloud agents & CI
Claude Code on the web, Codex cloud tasks and GitHub Actions can't open a browser. Create a token in Settings → CLI & agents and set it as the secret OCTONOTE_TOKEN.
- run: npm i -g @octonote/cli
- run: octonote note append pag_… --file CHANGELOG.md
env:
OCTONOTE_TOKEN: ${{ secrets.OCTONOTE_TOKEN }}What to ask
octonote note create --file … --notebook Architectureoctonote canvas create --from-mermaid flow.mmd --publishoctonote project create --note … --canvas-mermaid …octonote search "Build log" → note append …octonote note pull … → edit → note push …octonote share … --email sam@example.com --role editorAgents only publish, share or delete when you ask for it — the guide tells them so, and delete needs --yes.
Command reference
Every command in v0.4.0, read from the CLI itself. Add --help to any command in your terminal for the same details.
Global options
- --json
- JSON output (default when piped)
- --pretty
- human output (default in a terminal)
- -q, --quiet
- no progress messages
- -w, --workspace <id>
- workspace to use (default: yours)
- --api-url <url>
- Octonote API (default: OCTONOTE_API_URL or the hosted API)
- --web-url <url>
- Octonote web app (default: OCTONOTE_WEB_URL or https://octonote.ai)
Notes
Markdown in, rich notes out. Pull a note to a file, edit it, push it back.
$ octonote note create "Plan" --file plan.md --notebook "Work" --publish
$ cat log.md | octonote note create "Build log" --stdin
$ octonote note pull pag_… -o plan.md # edit plan.md…
$ octonote note push plan.md
$ octonote note append pag_… --text "- shipped the CLI"octonote note create [title] [options]Create a note, optionally filled from markdown
- <title>
- title (defaults to the file's front matter / first heading)(optional)
- -f, --file <path>
- markdown file ("-" for stdin)
- --stdin
- read markdown from stdin
- -n, --notebook <notebook>
- put it in a notebook (id or exact name)
- --publish
- publish it to the web and print the public URL
octonote note show <note>Print a note as markdown · alias “read”
- <note>
- note id (pag_…) or URL(required)
octonote note pull <note> [options]Save a note to a markdown file (with front matter, so `note push` knows which note it is) · alias “export”
- <note>
- note id (pag_…) or URL(required)
- -o, --out <path>
- file to write (default: <id>.md)
octonote note push <file> [options]Replace a note's content with a markdown file (uses the file's front matter id, or --id)
- <file>
- markdown file ("-" for stdin)(required)
- --id <note>
- note to update (overrides the front matter)
octonote note append <note> [options]Add markdown to the end of a note
- <note>
- note id (pag_…) or URL(required)
- -f, --file <path>
- markdown file ("-" for stdin)
- --stdin
- read markdown from stdin
- -t, --text <markdown>
- markdown given inline
octonote note rename <note> <title>Rename a note
- <note>
- note id (pag_…)(required)
- <title>
- new title(required)
Canvases
Write a mermaid flowchart; Octonote lays it out as real, editable shapes.
$ octonote canvas create "Login flow" --from-mermaid flow.mmd
$ octonote canvas redraw cnv_… --from-mermaid flow.mmd
$ octonote canvas pull cnv_… -o board.json # raw canvas JSONoctonote canvas create [title] [options]Create a canvas — drawn from a mermaid flowchart or class diagram, from canvas JSON, or empty
- <title>
- title(default: Untitled canvas)
- -m, --from-mermaid <path>
- mermaid flowchart or class diagram file ("-" for stdin) to draw as real shapes
- -f, --file <path>
- canvas JSON (from `canvas pull`)
- -n, --notebook <notebook>
- put it in a notebook (id or exact name)
- --publish
- publish it to the web and print the public URL
octonote canvas show <canvas>Print a canvas as an outline: its figures, words and connections · alias “read”
- <canvas>
- canvas id (cnv_…) or URL(required)
octonote canvas redraw <canvas> [options]Replace a canvas with a drawing of a mermaid flowchart or class diagram
- <canvas>
- canvas id (cnv_…) or URL(required)
- -m, --from-mermaid <path>
- mermaid flowchart or class diagram file ("-" for stdin)(required)
octonote canvas pull <canvas> [options]Save a canvas as JSON (Octonote canvas format: { version: 1, items })
- <canvas>
- canvas id (cnv_…) or URL(required)
- -o, --out <path>
- file to write (default: <id>.json)
octonote canvas push <file> [options]Replace a canvas with canvas JSON (from `canvas pull`)
- <file>
- canvas JSON ("-" for stdin)(required)
- --id <canvas>
- canvas to update(required)
octonote canvas image <canvas> [options]Save a canvas (or a project's canvas) as a PNG
- <canvas>
- canvas or project id (cnv_… / prj_…)(required)
- -o, --out <path>
- file to write (default: <id>.png)
Projects
A note and a canvas side by side, created in one command.
$ octonote project create "Auth flow" --note auth.md --canvas-mermaid auth.mmd --publish
$ octonote project show prj_…octonote project create <name> [options]Create a project; fill its note from markdown and draw its canvas from mermaid in one go
- <name>
- project name(required)
- -d, --description <text>
- one-line description
- --note <path>
- markdown file for the project's note ("-" for stdin)
- --canvas-mermaid <path>
- mermaid flowchart or class diagram file to draw on the project's canvas
- --view <view>
- what readers see first: notes | canvas | split(default: split)
- -n, --notebook <notebook>
- put it in a notebook (id or exact name)
- --publish
- publish it to the web and print the public URL
octonote project show <project>Print a project: its note, then its canvas (JSON: the ids of both)
- <project>
- project id (prj_…) or URL(required)
Notebooks
Folders for notes, canvases and projects. Refer to them by exact name or id.
$ octonote notebook create "Architecture"
$ octonote list --notebook "Architecture"octonote notebook listList notebooks with what's inside
octonote notebook create <name>Create a notebook
- <name>
- notebook name(required)
octonote notebook show <notebook>Show a notebook and what's inside (id or exact name)
- <notebook>
- notebook id or exact name(required)
Find & organise
Works on any item — the id says what it is (pag_ note, cnv_ canvas, prj_ project, ntb_ notebook).
$ octonote list --kind canvas
$ octonote search onboarding
$ octonote move pag_… --notebook "Archive"
$ octonote delete cnv_… --yesoctonote list [options]List notes, canvases, projects, notebooks and presentations (newest first) · alias “ls”
- -k, --kind <kind>
- only this kind: note | canvas | project | notebook | presentation
- -n, --notebook <notebook>
- only what's inside this notebook (id or exact name)
octonote search <query…>Find notes, canvases, projects, notebooks and presentations by title
- <query>
- words to look for in titles(required)
octonote open <id>Print the app link for an item (and open it when run in a terminal)
- <id>
- any Octonote id or URL(required)
octonote move <id> [options]Move a note, canvas, project or presentation into a notebook (or out with --out)
- <id>
- note, canvas or project id(required)
- -n, --notebook <notebook>
- target notebook (id or exact name)
- --out
- take it out of its notebook
octonote delete <id> [options]Delete a note, canvas, project, notebook or presentation (a notebook's contents move to the top level) · alias “rm”
- <id>
- any Octonote id(required)
- -y, --yes
- required: confirms the delete (agents: only when the user asked)
Publish & share
Publish to a public page, or share with people — the same rules as the app.
$ octonote publish pag_… # prints publicUrl
$ octonote share pag_… --email sam@example.com --role editor
$ octonote share pag_… --link view # anyone with the linkoctonote publish <id>Publish to the web; prints the public URL
- <id>
- any Octonote id(required)
octonote unpublish <id>Stop publishing to the web
- <id>
- any Octonote id(required)
Account
Sign in, pick a workspace, manage tokens.
$ octonote login
$ octonote whoami
$ octonote account rename "Sam Lee"
$ octonote workspace use "Team"octonote login [options]Sign in through the browser (or --paste a token from Settings → CLI & agents)
- --paste
- read a token from stdin instead of opening the browser
octonote logoutSign out here and revoke this computer's token
octonote whoamiWho you're signed in as, and which workspace commands use
octonote account rename <name>Change your display name (shown in the app and as the author of pages you publish)
- <name>
- new display name, 1–80 characters(required)
octonote workspace listWorkspaces you belong to
octonote workspace use <workspace>Use this workspace from now on (id or exact name)
- <workspace>
- workspace id or name(required)
octonote token listList your tokens
octonote token revoke <id>Revoke a token
- <id>
- token id (tok_…)(required)
Agent setup
Teach Claude Code or Codex to use Octonote.
$ octonote setup claude --skill
$ octonote setup codex --global
$ octonote guideoctonote guidePrint the usage guide for AI agents (Claude Code, Codex, Gemini CLI, …)
octonote setup <agent> [options]Teach an agent to use Octonote: writes a section into CLAUDE.md (claude), AGENTS.md (codex) or GEMINI.md (gemini)
- <agent>
- claude | codex | gemini(required)
- --dir <path>
- project folder(default: .)
- --global
- for every project: ~/.claude/CLAUDE.md, ~/.codex/AGENTS.md or ~/.gemini/GEMINI.md
- --skill
- claude only: also install the Octonote skill (.claude/skills/octonote)
Writing content
Agents write plain text formats; Octonote turns them into rich notes and real canvases.
Notes: markdown
Headings, paragraphs, bold/italic/code, bullet and numbered lists, checklists (- [ ]), tables, quotes, code blocks, images by URL, inline math $x^2$, display math $$ … $$ or ```math, and ```mermaid blocks (rendered as diagrams inside the note). It's the same converter the editor uses when you paste markdown.
Canvases: mermaid flowcharts
Flowcharts become real canvas shapes with arrows attached to them — drag a box and its arrows follow.
flowchart LR
user((User)) --> api[API]
api --> cache{Cache hit?}
cache -->|yes| redis[(Redis)]
cache -- no --> db[(Postgres)]
subgraph workers [Background]
queue([Queue]) -.-> worker[Worker]
end
db -.-> queuegraph|flowchart TD · TB · LR · RL · BTA[box] · A(round) · A([stadium]) · A((circle)) · A{decision} · A[(database)] · A{{hexagon}}--> · --- · -.-> · ==> · <--> · labels: A -->|yes| B or A -- yes --> Bchains (A --> B --> C) · A & B --> C · subgraph id [Title] … endOther mermaid diagrams (sequence, gantt, class…) can't become canvases — put them in a note as a ```mermaid block instead. Raw canvas JSON works too: canvas pull / canvas push.
Sign-in & tokens
octonote login opens octonote.ai in your browser; click Authorize and the page hands a token to the CLI waiting on your computer. If your browser blocks that, the page shows the token to paste into the terminal. For agents and CI without a browser, use OCTONOTE_TOKEN.
- A token can do what you can do in the app — but can't create more tokens or delete your account.
- Tokens are stored hashed; you see each one once. Revoke any time in Settings → CLI & agents.
octonote logoutrevokes this computer's token. Sign-in lives in~/.octonote/config.json(readable only by you).
OCTONOTE_TOKENa token from Settings (wins over octonote login)OCTONOTE_WORKSPACEworkspace id (default: the one you own)OCTONOTE_API_URL / OCTONOTE_WEB_URLpoint at another Octonote (default: octonote.ai)OCTONOTE_CONFIG_DIRwhere sign-in is kept (default: ~/.octonote)For agent builders
What scripts and agents can rely on.
- JSON on stdout when piped (force with
--json); progress goes to stderr. - Never prompts: content comes from
--file,--stdinor-. - Every result has
id,urland, once published,publicUrl. Errors are{"error":{"code","message","hint"}}with a non-zero exit code.
USAGEa wrong flag or argumentNOT_LOGGED_IN · UNAUTHORIZEDsign in, or a fresh OCTONOTE_TOKENNOT_FOUND · FORBIDDENwrong id, deleted, or not shared with youPLAN_LIMITthe workspace hit the Free plan limitNETWORK · SERVER_ERRORconnection problem; safe reads retry automaticallyMERMAID_INVALID · WEB_SESSION_REQUIRED · …other errors, with a hintWhat octonote setup adds to CLAUDE.md / AGENTS.md
## Octonote (notes & canvases) The user keeps notes, diagrams (canvases), projects, notebooks and presentations in Octonote. Use the `octonote` CLI to read and write them — never ask the user to copy-paste. - Run `octonote guide` once per session before using it; `octonote <command> --help` for details. - Write notes as markdown files (mermaid, `$math$`, code and tables work); draw diagrams as mermaid flowcharts or class diagrams (`--from-mermaid`), which become real, editable canvases. - Output is JSON when piped: read `id`, `url` and `publicUrl` from it, and always give the user the link. - Only publish, share or delete when the user asked to.
The full agent guide (octonote guide)
# Octonote CLI — guide for agents
Octonote holds the user's **notes** (markdown documents), **canvases** (diagrams),
**projects** (one note + one canvas, side by side), **notebooks** (folders) and
**presentations** (slides that hold any note block).
The `octonote` CLI is how you read and write them on the user's behalf.
## Rules
- Output is JSON when piped (force with --json). Errors print
`{"error":{"code","message","hint"}}` and exit non-zero; branch on `code`.
- Never prompts. Content comes from --file <path>, --stdin, or "-" as the path.
- Every result has `id`, `url` (app link) and, once published, `publicUrl`.
Give the user the link at the end.
- Ids carry their kind: pag_ note, cnv_ canvas, prj_ project, ntb_ notebook,
dck_ presentation.
Notebooks can also be named by exact name (--notebook "Architecture").
- Publish, share, invite or delete only when the user asked for it.
`delete` requires --yes.
- Not signed in (code NOT_LOGGED_IN)? Ask the user to run `octonote login`
(or set OCTONOTE_TOKEN). Don't try to sign in yourself.
## Write a note
octonote note create "Title" --file doc.md [--notebook "Name"] [--publish]
cat doc.md | octonote note create "Title" --stdin
Markdown → rich note: headings, lists, checklists, tables, code, quotes,
images (by URL), `$inline math$`, `$$display math$$`, and ```mermaid blocks
(rendered diagrams inside the note).
Live interactive blocks: a fence named after the kind holding JSON, e.g.
```quiz {"questions":[…]} ```. Kinds: widget (sliders, formulas, charts),
infographic (key facts as cards, steps, stats, compare, timeline or bars),
flashcards, mcq, quiz, mindmap, matching, scene (animation), custom (sandboxed
HTML app). An invalid block is refused with the reason; fix it and retry.
Use the built-in kind whenever one fits, never custom: a mind map is a
```mindmap block ({"nodes":[{"id","label","parent"?,"note"?}]}), a quiz a
```quiz. Built-in blocks get every design and feature update; a custom app
stays exactly as written. Custom is only for a bespoke game or tool no kind covers.
## Read and edit a note
octonote note show <id> # markdown to stdout
octonote note pull <id> -o note.md # file with front matter (keeps the id)
# …edit note.md…
octonote note push note.md # replaces the note's content
octonote note append <id> --text "- new item" # or --file / --stdin
octonote note rename <id> "New title"
## Draw a canvas (diagram)
Write a mermaid **flowchart** or **class diagram** and let Octonote lay it out
as real shapes:
octonote canvas create "Login flow" --from-mermaid flow.mmd [--publish]
octonote canvas redraw <id> --from-mermaid flow.mmd
Flowcharts: `graph|flowchart TD|LR|BT|RL`; nodes A[box] A(round) A([stadium])
A((circle)) A{decision} A[(database)] A{{hexagon}}; edges --> --- -.-> ==> <-->
with labels (A -->|yes| B or A -- yes --> B); chains; A & B --> C;
`subgraph id [Title] … end`.
Class diagrams: `classDiagram`; `class A { +field / +method() }`, `A : +member`,
`<<interface>>`, generics A~T~, relations <|-- *-- o-- --> ..> ..|> -- with
"1"/"*" cardinalities and `: label`, `namespace N { … }`.
Links: `click A href "https://…"` makes a box open that page (canvases and
note diagrams alike) — point code boxes at the file and line on GitHub.
Other diagram types (sequence, state, ER, gantt…) can't be canvases — put
them in a note as a ```mermaid block instead.
Read one: `octonote canvas show <id>` gives its figures (with their source), words and connections.
Raw canvas JSON also works: `canvas pull <id> -o c.json` / `canvas push c.json --id <id>`.
It's `{ "version": 1, "items": [...] }`; items are shape (rectangle|ellipse|diamond,
text), sticky, text, line (start/end {x,y,item?}, startArrow, endArrow, dashed, text),
frame, code, image, icon, pen and figure, each with x, y, w, h.
## Project = note + canvas
octonote project create "Auth flow" --note auth.md --canvas-mermaid auth.mmd \
[--view split|notes|canvas] [--notebook "Name"] [--publish]
octonote project show <id> # JSON: ids of its note and canvas (edit them as above)
## Presentations (slides)
Make slides from something that exists (the original stays as it is):
octonote deck from <pag_|prj_|ntb_ id> [--split heading|divider] [--keep-text] [--group-blocks] [--publish]
octonote deck from <id> --ai # AI plans the slides (uses the AI allowance; only when asked)
A note splits at its H1/H2 headings (or at --- dividers): text on the left, the
section's block on the right; paragraphs move to the presenter notes unless
--keep-text. A project adds a slide per canvas frame or figure; a notebook a
section per item.
Or write them as slide markdown — a line of --- between slides, a line of ???
before that slide's presenter notes, any note block (quiz, widget, mermaid,
maths…) on a slide:
octonote deck create "Talk" --file talk.md [--notebook "Name"] [--publish]
Layouts follow the content: a lone heading is a title or section slide, text
with a block is text-and-block, a block alone fills the slide.
octonote deck show <id> # outline: each slide's title, objects, clicks, notes
octonote deck pull <id> -o deck.json # raw JSON → edit → push back. Version 2: each slide has
octonote deck push deck.json --id <id> # elements (text|block|image|shape|canvas at x,y,w,h on
# 960×540) and animations (in|emphasis|out; click|with|after)
Presenting is done in the app (Present, presenter view); give the user the link.
## Organise
octonote list [--kind note|canvas|project|notebook] [--notebook "Name"]
octonote search <words> # by title
octonote notebook list | create "Name" | show "Name" # show lists what's inside
octonote rename <id> "New name" # any note, canvas, project, notebook or presentation
octonote move <id> --notebook "Name" # or --out
octonote delete <id> --yes
## Publish and share
octonote publish <id> # → publicUrl (a public, read-only page)
octonote unpublish <id>
octonote publish fig_… # one canvas figure by itself; its canvas stays private
octonote share <id> --email person@example.com --role viewer|editor # again to change a role
octonote share <id> --link view|edit|off # anyone with the app link
octonote access <id> # who can open it, the link setting, published or not
octonote unshare <id> --email person@example.com
octonote shared # what others shared with the user
Publishing a notebook publishes everything inside it.
## Collections (clips → a cited note)
A collection (clc_…) holds clips (clp_…): passages from AI chats, the web or
anywhere, in order. Composing writes one note from only those clips, with
every sentence cited to its clip.
octonote collection list | show <id> | create "Name" | rename <id> "Name"
octonote clip add <collection> --text "…" [--source-url <url> --source-title "…"] # or --file / --stdin
octonote clip edit <clip> --text "…" | octonote clip rm <clip>
octonote collection order <collection> <clip> <clip>…
octonote collection compose <collection> --mode summary|report|comparison|study_notes|outline|faq|article|brief|flashcards|custom \
[--instructions "…"] [--title "…"] [--save [--notebook "Name"]]
compose prints the draft (and any sentence the clips don't fully support);
--save makes it a note and returns its link.
## Make things with AI
These use the user's AI allowance: run them when the user asks for
AI-made content. Writing a note yourself (note create) costs nothing.
octonote generate "explain backpropagation, with a quiz" [--notebook "Name"] # → a new note
octonote studio create --kind mindmap|flashcards|quiz|mcq|matching|infographic|text \
(--text "…" | --file f.txt | --url <url> | --from <note id> | --pdf f.pdf) --wait
octonote studio list | show <id> | retry <id> --wait | add-to-note <id> [--note <id>]
octonote studio publish <id> # → publicUrl
octonote video create "how attention works" [--portrait] [--note <id>] [--wait]
octonote video show <id> [--wait] # progress, then its link and chapters
A video takes several minutes. With --note it goes into the note at once and
shows its progress there; or add it yourself as ```video {"videoId":"vid_…"} ```.
## Pictures and files
octonote canvas image <canvas|project> -o diagram.png
octonote figure list [--canvas <id>] | show <fig> | download <fig> -o fig.png
octonote note export <id> -o note.md # same as note pull
## What changed
octonote recent # what the user edited lately
octonote activity [--item <id>] [--limit 50]
## Account
octonote whoami | workspace list | workspace use <name|id> | logout
octonote account rename "Full Name" # display name (author on published pages)
Troubleshooting
Still stuck? Email hello@octonote.ai with the command you ran and its output.