Commands Reference

The roam binary exposes all SDK operations as CLI subcommands. No subcommand launches the TUI.

roam                    # launch TUI
roam journal            # view today's daily note
roam search "meeting"   # search pages by title
roam get page "Books"   # get a page with all blocks

Output is JSON for structured data (pages, blocks, queries) and plain text for status messages.

Commands

journal (alias: j)

View or add to your daily note.

# View today's daily note
roam journal
roam j

# View a specific date
roam journal view --date 2026-03-10

# Add a block to today's note
roam journal add "Meeting with [[John]]"

# Add to a specific date, at the top
roam journal add "First block" --date 2026-03-10 --order first

# Add with children blocks
roam journal add "Parent block" --children '["child 1", "child 2"]'
Flag
Description

--date

Date in YYYY-MM-DD format (default: today)

--order

Position: first, last, or numeric index

--children

JSON array of child block strings

Search pages by title or blocks by content.

Flag
Description

-b, --blocks

Search block content instead of page titles

-l, --limit

Maximum number of results

get

Read pages, blocks, daily notes, backlinks, refs, and stats.

query

Run raw Datalog queries against your graph.

Flag
Description

--args

JSON array of query arguments

export

Export daily notes or pages to Markdown or JSON.

Flag
Description

--date

Date in YYYY-MM-DD format (default: today)

--page

Page title (exports page instead of daily note)

--format

Output format: md or json (default: md)

-o, --output

Output file path (default: stdout)

create

Create pages and blocks.

update

Update block content.

delete

Delete blocks or pages.

move

Move a block to a new parent.

Flag
Description

--parent

New parent block/page UID

--order

Position: first, last, or numeric index

batch

Execute multiple write operations from a JSON file or stdin.

The input is a JSON array of WriteAction objects.

sync

Bidirectional sync between Roam and local markdown files. See Sync for full documentation.

Flag
Default
Description

--direction

pull

pull, push, or both

-d, --dir

config sync.dir

Output directory

--daily

false

Include daily notes

--dry-run

false

Preview mode

--concurrency

5

Parallel fetches

--filter

none

Page title prefix filter

--history

none

Show history for a page UID

mcp

Start the MCP server over stdio (used by AI assistants).

See MCP Server docs for configuration details.

Composing with other tools

The CLI outputs JSON, making it easy to pipe into jq, scripts, or other tools:

Last updated

Was this helpful?