roam-cli is a command-line tool for working with your Roam Research graph.
It supports:
- page/block retrieval
- full-text block search
- raw datalog queries
- markdown import as pages or under daily pages
- daily journal extraction
- low-level block and batch write operations
- automatic batch chunking and rate-limit retry
gh release list -R Leechael/roamresearch-skills
TAG="vX.Y.Z"
./scripts/print-release-download.sh "$TAG"
# Example output:
# gh release download "$TAG" --pattern "roam-cli-*.tar.gz"Extract the archive for your platform and place roam-cli in your PATH.
git clone git@github.com:Leechael/roamresearch-skills.git
cd roamresearch-skills
go build -o roam-cli ./cmd/roam-cliSet credentials via environment variables:
export ROAM_API_TOKEN="<token>"
export ROAM_API_GRAPH="<graph>"Optional:
export ROAM_API_BASE_URL="https://api.roamresearch.com/api/graph"
export ROAM_TIMEOUT_SECONDS="10"
export TOPIC_NODE="<topic>"Validate setup before use:
roam-cli status
roam-cli status --json
roam-cli status --json --jq '.ok'status— check credentials and API connectivityget— read page by title or block by uidsearch— search blocks by termsq— run raw datalog querysave— save markdown as a page (--title), daily page (--to-daily-page/--today), or under a parent block (--parent);--underfinds-or-creates a child block by textjournal— read daily journaling blockshelp— show help or categorized examples (help read,help write,help workflow,help all)
block create|update|delete|move|get|findbatch run(native actions;create-blocksupports children andattach-to)
--json— parseable JSON output--plain— human-readable plain text--jsonand--plainare mutually exclusive--jq— filter JSON (supported onstatusandq, requires--json)
Commands that accept input (save, block create, batch run) read from stdin by default when --file is not given. No --stdin flag needed.
ISO dates (YYYY-MM-DD) are auto-resolved to Roam daily page titles wherever a page reference is expected:
save --to-daily-page 2026-03-14/save --today→ saves to "March 14th, 2026" / today's daily pagesearch --page 2026-03-14→ searches in "March 14th, 2026"block find --page 2026-03-14→ finds in "March 14th, 2026"
# status
roam-cli status --plain
roam-cli status --json --jq '.ok'
# read
roam-cli get "Page Title"
roam-cli get "((block-uid))" --json
# search
roam-cli search term1 term2 --limit 20
roam-cli search keyword --page 2026-03-14
# query
roam-cli q '[:find ?title :where [?e :node/title ?title]]' --json
# save markdown to a new page
cat note.md | roam-cli save --title "New Page"
# save to today's daily page
echo "- entry" | roam-cli save --today
# save to a specific daily page
cat note.md | roam-cli save --to-daily-page 2026-03-14
# save under a section in today's daily page (find-or-create)
echo "- journal entry" | roam-cli save --today --under '[[📽 Journaling]]'
# save under a section in a named page
cat note.md | roam-cli save --title "Project Notes" --under '[[Tasks]]'
# save under an existing parent block
roam-cli save --parent <uid> --file ./note.md
# journal
roam-cli journal --date 2026-02-12
roam-cli journal --date 2026-02-12 --topic "Work Log" --json
# find block on a daily page
roam-cli block find --text "[[📖 Daily Reading]]" --daily 2026-02-15
roam-cli block find --text "[[📖 Daily Reading]]" --page 2026-02-15
# create blocks (single, nested tree, attach-to)
roam-cli block create --parent <uid> --text "hello"
echo '{"text":"headline","children":[{"text":"child"}]}' \
| roam-cli block create --parent <uid>
roam-cli block create --parent <uid> --file ./tree.json
roam-cli block create --parent <page-uid> --attach-to "[[Section]]" --text "item"
roam-cli block update --uid <uid> --text "updated"
roam-cli block move --uid <uid> --parent <target-uid> --order last
roam-cli block delete --uid <uid>
# batch operations
roam-cli batch run --file ./examples/actions.create-page-and-block.json
echo '[...]' | roam-cli batch run
# categorized help
roam-cli help write
roam-cli help workflow
roam-cli help allThis repository also ships an Agent Skill package under skills/roamresearch.
Install with:
npx skills add Leechael/roamresearch-skillsAfter installation, your agent can load and use the roamresearch skill instructions.
Use 1Password CLI to inject credentials at runtime:
Example:
op run --env-file=.env -- roam-cli status
op run --env-file=.env -- roam-cli get "Page Title"