Skip to content

Use from your shell

Two different tools share the name marrow — pick by what you’re doing:

  • marrow-setup (run via npx, nothing installed) wires Marrow into an AI agent over MCP. See Use with AI agents.
  • @marrowdev/cli (installed on your PATH) is for using Marrow straight from your shell — terminals, scripts, CI, and bash-style agents.

This page is the second one.

Terminal window
npm i -g @marrowdev/cli # or: bun add -g @marrowdev/cli
marrow --help

Authentication — you probably already have it

Section titled “Authentication — you probably already have it”

If you’ve ever set Marrow up in an agent with marrow-setup, your key is already in ~/.config/marrow/config.json — and the CLI reads the same file. There’s nothing to log in to. Just check:

Terminal window
marrow usage

No key yet? Get a free one (no card, idempotent) — this also wires up any agents you have:

Terminal window
npx -y marrow-setup --email you@example.com

Already have a key but it isn’t saved? Either of these:

Terminal window
marrow login --api-key mrw_xxx # writes ~/.config/marrow/config.json
export MARROW_API_KEY=mrw_xxx # or just this, per shell

Resolution order: --api-key flag → MARROW_API_KEY → saved config.

Terminal window
marrow https://astro.build # shortcut for: marrow read
marrow read <url> --md # clean markdown
marrow read <url> --change-tracking # section-level diff vs your last read
marrow scout <url> # links + structure (cheap; scout→read saves tokens)
marrow search "rust async runtime" --limit 5
marrow crawl <url> --limit 10 --max-depth 2 # site → pages
marrow screenshot <url> -o shot.png # full-page PNG (writes a file)
marrow usage --md # plan, credits, daily rate, monitors

Monitoring is the same flat-rate watch you get in the agent — frequency is free:

Terminal window
marrow monitor create <url> --interval 30 --webhook https://you/hook
marrow monitor list
marrow monitor run <id>
marrow monitor delete <id>

Every command goes through the same billed API as the MCP server — there’s no separate path. Failed requests cost nothing; a cache hit costs ~0.1 credit.

By default the CLI emits Flux NDJSON — one compact JSON object per line ({v, source, type, event, …}) — so it pipes cleanly into jq and other tools. Add --md for markdown, or -o FILE to write to a file.

Terminal window
marrow usage
# {"v":1,"source":"marrow","type":"usage","event":"reported","plan":"free",...}
marrow scout https://astro.build | jq -r 'select(.type=="link") | .url'
commandsignal
read, crawldoc:fetched
scoutlink:found
searchresult:found
read --change-tracking, monitor runchunk:{added,modified,moved,removed} + diff:completed
usageusage:reported

screenshot returns a binary PNG, so it writes a file (-o, or an auto-named marrow-shot-<host>-<ts>.png) instead of NDJSON.

Working through a shell-first agent (Claude Code, hsh-bash)? Add a skill so it reaches for marrow on its own — the CLI counterpart of the scout → read → watch skill that marrow-setup installs for MCP. A one-command installer will come later; for now, drop the file in by hand. For Claude Code, save it as ~/.claude/skills/marrow-cli/SKILL.md:

---
name: marrow-cli
description: Efficient web research, change tracking and monitoring from the shell via the `marrow` CLI — scout before reading to save tokens, get section-level diffs on re-read, and watch pages flat-rate. Use when the marrow CLI is on PATH and you're working through bash.
---
# Marrow CLI: scout → read → watch (from the shell)
Use the `marrow` CLI for web work when you're running shell commands. It prints Flux NDJSON
by default (pipe into `jq`); add `--md` for markdown. Auth comes from
`~/.config/marrow/config.json` or `MARROW_API_KEY` — if `marrow usage` works, you're set.
## 1. scout, then read
- `marrow scout <url>` — links + structure, cheap. List URLs:
`marrow scout <url> | jq -r 'select(.type=="link") | .url'`
- `marrow read <url> --md` — clean markdown. Let scout narrow first; don't dump whole sites.
- Re-reads are cache-hits (~free).
## 2. "What changed?"
`marrow read <url> --change-tracking` — section-level diff vs your last read (`chunk:*` +
`diff:completed`), not the whole body. The diff rides free.
## 3. "Watch this"
`marrow monitor create <url> [--interval N] [--webhook URL]` · `list` · `run <id>` · `delete <id>`.
Billed flat — frequency is free.
Other: `marrow search "<q>" --limit N` · `marrow crawl <url> --limit N` ·
`marrow screenshot <url> -o shot.png` · `marrow usage --md`.
Why: scouting saves tokens, change tracking returns just the delta, monitoring is flat-rate.
Failed requests cost nothing; cache hits ~0.1 credit.

Same capabilities, different door. If you’re inside an AI agent with the MCP server, just talk to it — see Use with AI agents. If you live in a shell, a CI pipeline, or a Flux-native shell, reach for the CLI. Use whichever fits; they read the same key.