Octonote CLI · v0.1.3

Let your AI agents write into Octonote

octonote is a command-line tool for Claude Code, Codex and your scripts. Agents write notes from markdown, draw canvases from mermaid flowcharts, organise them in notebooks, and publish — with your permissions, through the same API as the app.

  1. 1Install

    npm i -g https://octonote.ai/cli/octonote-cli.tgz && octonote
  2. 2Sign in

    octonote login
  3. 3Teach your agent

    octonote setup claude

Then just ask: “Write up the auth flow in my Architecture notebook, with a diagram, and publish it.” Running octonote on its own prints a getting-started screen with all of this, so you never need this page in the terminal. No PATH setup needed. Node 20+, on macOS, Linux and Windows.

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 skill

The 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):

.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):

~/.codex/config.toml
[sandbox_workspace_write]
network_access = true

Cloud 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.

GitHub Actions
- run: npm i -g https://octonote.ai/cli/octonote-cli.tgz
- run: octonote note append pag_… --file CHANGELOG.md
  env:
    OCTONOTE_TOKEN: ${{ secrets.OCTONOTE_TOKEN }}

What to ask

“Write up this decision as a note in my Architecture notebook.”octonote note create --file … --notebook Architecture
“Draw this flow as a canvas and publish it.”octonote canvas create --from-mermaid flow.mmd --publish
“Document the auth flow with a diagram, side by side.”octonote project create --note … --canvas-mermaid …
“Add today's progress to my Build log note.”octonote search "Build log" → note append …
“Update my Onboarding note with these changes.”octonote note pull … → edit → note push …
“Share it with sam@example.com as an editor.”octonote share … --email sam@example.com --role editor

Agents 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.1.3, 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)

<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 tldraw JSON
octonote canvas create [title] [options]

Create a canvas — drawn from a mermaid flowchart, from tldraw JSON, or empty

<title>
title(default: Untitled canvas)
-m, --from-mermaid <path>
mermaid flowchart file ("-" for stdin) to draw as real shapes
-f, --file <path>
tldraw snapshot 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 redraw <canvas> [options]

Replace a canvas with a drawing of a mermaid flowchart

<canvas>
canvas id (cnv_…) or URL(required)
-m, --from-mermaid <path>
mermaid flowchart file ("-" for stdin)(required)
octonote canvas pull <canvas> [options]

Save a canvas as tldraw JSON

<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 tldraw JSON (from `canvas pull`)

<file>
tldraw snapshot JSON ("-" for stdin)(required)
--id <canvas>
canvas to update(required)

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 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>

Show a project and the ids of its note and canvas

<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 list

List notebooks with what's inside

octonote notebook create <name>

Create a notebook

<name>
notebook name(required)
octonote notebook show <notebook>

Show a notebook (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_… --yes
octonote list [options]

List notes, canvases, projects and notebooks (newest first) · alias “ls”

-k, --kind <kind>
only this kind: note | canvas | project | notebook
-n, --notebook <notebook>
only what's inside this notebook (id or exact name)
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 or project 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 or notebook (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 link
octonote 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)
octonote share <id> [options]

Share with a person by email, or set who can open the link

<id>
any Octonote id(required)
-e, --email <email>
invite this person (they get an email; non-users join on sign-up)
-r, --role <role>
viewer | editor(default: viewer)
--link <access>
anyone with the link: off | view | edit

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 logout

Sign out here and revoke this computer's token

octonote whoami

Who 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 list

Workspaces 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 list

List 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 guide
octonote guide

Print the usage guide for AI agents (Claude Code, Codex, …)

octonote setup <agent> [options]

Teach an agent to use Octonote: writes a section into CLAUDE.md (claude) or AGENTS.md (codex)

<agent>
claude | codex(required)
--dir <path>
project folder(default: .)
--global
for every project: ~/.claude/CLAUDE.md or ~/.codex/AGENTS.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 tldraw shapes with arrows bound to them — drag a box and its arrows follow.

flow.mmd
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 -.-> queue
Directionsgraph|flowchart TD · TB · LR · RL · BT
ShapesA[box] · A(round) · A([stadium]) · A((circle)) · A{decision} · A[(database)] · A{{hexagon}}
Arrows--> · --- · -.-> · ==> · <--> · labels: A -->|yes| B or A -- yes --> B
Alsochains (A --> B --> C) · A & B --> C · subgraph id [Title] … end

Other mermaid diagrams (sequence, gantt, class…) can't become canvases — put them in a note as a ```mermaid block instead. Raw tldraw 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 logout revokes 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, --stdin or -.
  • Every result has id, url and, once published, publicUrl. Errors are {"error":{"code","message","hint"}} with a non-zero exit code.
exit 2USAGEa wrong flag or argument
exit 3NOT_LOGGED_IN · UNAUTHORIZEDsign in, or a fresh OCTONOTE_TOKEN
exit 4NOT_FOUND · FORBIDDENwrong id, deleted, or not shared with you
exit 5PLAN_LIMITthe workspace hit the Free plan limit
exit 6NETWORK · SERVER_ERRORconnection problem; safe reads retry automatically
exit 1MERMAID_INVALID · WEB_SESSION_REQUIRED · …other errors, with a hint
What octonote setup adds to CLAUDE.md / AGENTS.md
## Octonote (notes & canvases)

The user keeps notes, diagrams (canvases), projects and notebooks 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 (`--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) and **notebooks** (folders).
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.
  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).

## 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** 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
Supported: `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`. Other diagram types (sequence, gantt…) can't be
canvases — put them in a note as a ```mermaid block instead.
Raw tldraw JSON also works: `canvas pull <id> -o c.json` / `canvas push c.json --id <id>`.

## 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>     # ids of its note and canvas (edit them as above)

## Organise
  octonote list [--kind note|canvas|project|notebook] [--notebook "Name"]
  octonote search <words>                 # by title
  octonote notebook list | create "Name" | show "Name"
  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 share <id> --email person@example.com --role viewer|editor
  octonote share <id> --link view|edit|off   # anyone with the app link
Publishing a notebook publishes everything inside it.

## Account
  octonote whoami | workspace list | workspace use <name|id> | logout
  octonote account rename "Full Name"     # display name (author on published pages)

Troubleshooting

“octonote: command not found”npm's global folder isn't on your PATH (rare: npm and nvm normally set it up). Add export PATH="$(npm prefix -g)/bin:$PATH" to ~/.zshrc or ~/.bashrc and open a new terminal. With nvm, install again after switching Node versions.
“You're not signed in”Run octonote login — or set OCTONOTE_TOKEN for agents and CI.
Authorize page says “One more step”Your browser blocked the page from reaching the CLI. Copy the token and paste it into the terminal where octonote login is waiting.
NETWORK errors inside CodexCodex's sandbox blocks the network by default — see the Codex section above.
Claude asks permission every timeAllow Bash(octonote:*) in .claude/settings.json.
MERMAID_INVALIDOnly flowcharts become canvases; the error names the line. Put other diagrams in a note as a ```mermaid block.
PLAN_LIMITThe workspace has 10 of that kind on the Free plan. Upgrade in Settings → Plan & billing, or delete something.
A token stopped workingIt was revoked or expired. Run octonote login again, or create a new one in Settings.

Still stuck? Email support@octonote.ai with the command you ran and its output.