All guides

Command line tool

Search, read and add to your library from Terminal or a script with the resurf command.

Install
Settings → MCP → Advanced
Command
resurf
On
Mac

Install it

  1. Open Settings → MCP and expand Advanced.

  2. On Terminal command, click Copy.

  3. Paste it in Terminal and press Return.

  4. If it says ~/.local/bin isn't on your PATH, add the line it prints to your shell file. If it says your shell still runs a different resurf, remove that one as it tells you.

  5. Open a new Terminal window and run resurf --version.

The copied command runs /Applications/Resurf.app/Contents/Helpers/resurf install cli, which links that program into ~/.local/bin. Add --dry-run to see what it would change first.

How it works

resurf reads and writes the same library as the app, on this Mac, and the app picks up what it saves. It finds your library on its own. If it finds more than one, pass --vault with a vault ID or path, or set RESURF_VAULT; resurf vault list shows them.

In Terminal it prints readable text. Add --json for a versioned result a script can read, or --md for compact Markdown.

resurf --help lists the commands, and resurf help find, or resurf capture update --help, shows one command's flags. resurf capabilities --json describes every command, type and error code.

Commands

CommandWhat it does
resurf findSearch, filter and read captures. Start here.
resurf noteSave a Markdown note.
resurf linkSave a web address, with page details fetched.
resurf fileSave a file: an image, PDF, video, audio or any document.
resurf openOpen a capture in Resurf.
resurf readPrint a resurf:// link as Markdown.
resurf capture listList captures with filters, newest first.
resurf capture getRead one or more captures by ID.
resurf capture searchPlain ranked search.
resurf capture updateChange the title, description, source, pin, triage, tags and spaces.
resurf capture pin, unpinPin or unpin a capture.
resurf capture submitSave up to 100 items from a JSON request.
resurf capture revealShow a capture's folder, or its file, in Finder.
resurf comment addAdd a comment to a capture.
resurf space list, space createList spaces, or create one.
resurf tag listList tags.
resurf vault list, current, statsShow the libraries resurf can see, the one it uses, and counts.
resurf index status, rebuildCheck or rebuild the command line's search cache.
resurf install cli, completionsPut resurf on your PATH, or add tab completion.
resurf mcp serveRun the MCP server for agents.
resurf capabilitiesDescribe every command, for scripts and agents.

Short forms: list, get, search, edit (for capture update), spaces, tags, stats and vaults.

Search and filter

resurf find takes optional words and any of these flags.

FlagWhat it does
--typeA capture type. Repeat it to match any of several: note, quote, color, link, product, pdf, image, video, audio, voiceNote, file.
--tagAn exact tag name. Repeat it; every tag must match unless you add --tag-match any.
--spaceA space name or ID. Repeat it; any space matches unless you add --space-match all.
--triageinbox or later.
--pinned, --not-pinnedOnly pinned, or only unpinned.
--deleted, --all-statesOnly the Trash, or everything.
--sortrelevance, created, updated or opened. Relevance is the default with words, created without.
--orderasc or desc.
--limitResults per page: 20 by default, up to 200, or 50 with context.
--cursorThe next page, from page.nextCursor.
--include contextAdds every capture's details and text.
--pathsPrints one file path per line.
--words-onlyMatches words only, without meaning search.
--compactLeaves out heavy fields.
Terminal
resurf find "pricing pages"
resurf find --space Research --tag todo --pinned
resurf find "onboarding" --type link --type article --sort created --limit 50 --json
resurf find --triage inbox --sort opened --order asc

Save and change

  • note, link and file all take --title, --description, --tag and --space, each repeatable where it makes sense.
  • note takes its text from --body or, for more than a line, from --stdin, plus --source-url and --source-app. Its --space must already exist.
  • link and file can make missing spaces with --create-spaces, and --no-enrich saves without fetching page details. Saving a link you already have reuses that capture instead of making a second one.
Terminal
resurf note --title "Idea" --body "Try a weekly digest"
resurf link https://example.com --space Reading --tag later
resurf file ~/Desktop/shot.png --tag design --create-spaces --space "Mood boards"
  • capture update changes what's around a capture, never its text: --title, --description, --source-url, --source-app, --quote-attribution, --pin and --no-pin, --triage inbox|later|archived, --add-tag, --remove-tag, --add-space and --remove-space. An empty value clears a field. Later means tomorrow morning; archived puts it away with no date.
  • comment add takes --text. space create takes --color and --icon, and returns the existing space when the name is taken.
Terminal
resurf capture update cap_… --add-tag todo --add-space Projects
resurf capture update cap_… --triage later
resurf capture update cap_… --title "A better title"
resurf capture pin cap_…
resurf comment add cap_… --text "Check the pricing table"
resurf space create Reading --color "#7a63ff" --icon "📚"

Output for scripts

With --json, every command prints one JSON object. ok says whether it worked, data holds the result, and page, on lists, has total, returned, hasMore and nextCursor.

resurf find example --limit 1 --json, shortened
{
  "ok" : true,
  "command" : "capture.find",
  "data" : {
    "items" : [
      {
        "capture" : {
          "id" : "cap_348F70C565F749ACAFF1",
          "type" : "link",
          "title" : "example.org",
          "tags" : [ "todo" ],
          "uri" : "resurf://open/cap_348F70C565F749ACAFF1",
          …
        },
        "rank" : 1
      }
    ],
    "refinements" : { … }
  },
  "page" : { "hasMore" : true, "nextCursor" : "eyJvZmZzZXQi…", "returned" : 1, "total" : 3 },
  "warnings" : [ ],
  "meta" : { "cliVersion" : "2.0.0", "durationMs" : 4 },
  "schemaVersion" : "resurf.cli/v1"
}

When ok is false, error has a code, a message, whether it's worth retrying, and sometimes suggestions.

resurf get cap_nope --json, shortened
{
  "ok" : false,
  "command" : "capture.get",
  "error" : {
    "code" : "not_found",
    "message" : "No capture with the ID “cap_nope” exists in this vault.",
    "retryable" : false
  },
  …
}

Other flags every command takes: --md, --compact, --no-color (also applied when the output is piped or NO_COLOR is set), --non-interactive to forbid prompts and windows, --request-id to tag a call in the result, and --verbose for detail on stderr.

Exit codeMeans
0It worked.
1An internal error, or the library or content isn't readable.
2The command or a value is wrong.
3Not found, or a name or ID matches more than one.
4Not allowed, or it needs you to confirm.
5A conflict, such as a request ID used before for different content.
6Some items failed.
7The network, a timeout, or the library being busy or unavailable.
130Cancelled.

Recipes

These use jq to read JSON. It comes with recent versions of macOS; on older ones, install it with Homebrew.

Save every web address in a text file, one per line. Blank lines and lines starting with # are skipped, and links you already have are reused, so it's safe to run again.

Terminal
while IFS= read -r url; do
  case "$url" in ""|\#*) continue ;; esac
  resurf link "$url" --space Reading --tag imported --json --compact |
    jq -r 'if .ok then "saved   \(.data.capture.title)" else "failed  \(.error.message)" end'
done < urls.txt

Dump a space to a JSON file, a page of 200 at a time.

Terminal
space="Reading"
cursor=""
: > reading.jsonl
while true; do
  if [ -n "$cursor" ]; then
    page=$(resurf find --space "$space" --limit 200 --json --cursor "$cursor")
  else
    page=$(resurf find --space "$space" --limit 200 --json)
  fi
  printf '%s\n' "$page" | jq -c '.data.items[].capture' >> reading.jsonl
  cursor=$(printf '%s\n' "$page" | jq -r '.page.nextCursor // empty')
  [ -z "$cursor" ] && break
done
jq -s '.' reading.jsonl > reading.json

Save a note from the clipboard or a file.

Terminal
pbpaste | resurf note --title "From the clipboard" --stdin --tag inbox
cat meeting.md | resurf note --title "Design sync" --stdin --space Projects

File everything with a tag into a space.

Terminal
resurf find --tag todo --limit 200 --json |
  jq -r '.data.items[].capture.id' |
  while IFS= read -r id; do
    resurf capture update "$id" --add-space Projects
  done

Copy the files behind a search into a folder.

Terminal
mkdir -p ~/Desktop/design
resurf find --type image --tag design --paths |
  while IFS= read -r file; do cp "$file" ~/Desktop/design/; done

Save many things in one go with capture submit. Write a request with up to 100 items. Each item has an id and content: a link with a url, text with "intent": "quote" for a quote or "format": "markdown" for a note, or an asset whose file you list in a separate attachments file. Optional metadata and organization carry the title, quote attribution, tags, space IDs from resurf space list --json, and your Note.

request.json
{
  "requestID": "import-2026-10-19",
  "items": [
    { "id": "1", "content": { "kind": "link", "url": "https://example.com" } },
    {
      "id": "2",
      "intent": "quote",
      "content": { "kind": "text", "text": "Simplicity is prerequisite for reliability." },
      "metadata": { "quoteAttribution": "Edsger W. Dijkstra" },
      "organization": { "tags": ["quotes"] }
    },
    {
      "id": "3",
      "content": { "kind": "text", "text": "# Reading list\n\n- Finish chapter 3", "format": "markdown" },
      "organization": { "spaceIDs": ["space_reading_f4a149"], "userNote": "From my old notes app" }
    },
    {
      "id": "4",
      "content": { "kind": "asset", "asset": { "attachmentID": "shot", "filename": "shot.png", "mimeType": "image/png" } }
    }
  ]
}
Terminal
echo '{ "shot": "/Users/you/Desktop/shot.png" }' > attachments.json
resurf capture submit --request request.json --attachment-paths attachments.json --json | jq '.data.counts'

The result reports saved, reused or failed for each item. Submitting the same request again adds nothing; reusing its requestID with different items is refused.

Completions and the search cache

resurf install completions adds tab completion for zsh, bash or fish, for your current shell unless you pass --shell. For zsh it writes ~/.zsh/completions/_resurf and, if your .zshrc doesn't load that folder yet, prints the fpath line to add before compinit. bash needs the bash-completion@2 package from Homebrew.

The command line keeps its own search cache, separate from the app's. If results look out of date, resurf index status compares it with your library, and resurf index rebuild builds it again. Rebuilding only rereads your library.

What it doesn't do

The Access switches in Settings → MCP don't apply to it. Anything that can run resurf can add, organize and comment whatever the switches say.

It can't move captures to the Trash, edit a note's text, edit or delete comments, or export your library.

If something goes wrong

You seeWhat to do
Something you saved or changed doesn't show in ResurfQuit and reopen Resurf. The app doesn't always notice changes made from Terminal while it's open.
resurf: command not foundRun the Terminal command from Settings → MCP → Advanced, add ~/.local/bin to your PATH as it says, and open a new Terminal window.
More than one vault is available. Select one explicitly.Pass --vault with an ID or path from resurf vault list, or set RESURF_VAULT.
No Space named “…” exists in this vault.Check the name with resurf space list, or, for link and file, add --create-spaces.
This request ID was already used for different content.Give the changed request a new requestID.
jq: command not foundInstall jq with Homebrew, or leave out the jq part.
An old resurf still runsRun the Terminal command again. It names the old resurf and the command that removes it, such as npm uninstall -g resurf.

Questions

resurf says command not found.

Copy the Terminal command from Settings → MCP → Advanced and run it, then add ~/.local/bin to your PATH as it tells you. Open a new Terminal window afterwards.

Can I export my library with it?

Not as an export. resurf find --json gives you every capture's details as JSON, a page at a time; Export to CSV in Settings → Data writes the whole library with its files.

Can I set a capture's date from the command line?

No. Captures saved with resurf are dated when you save them. To keep old dates, use a CSV import with a created_at column.