CLI reference
Every rf command, with what it sends and what it prints. rf <command> --help shows the same from the terminal.
Flags every command takes
| Flag | Meaning |
|---|---|
--json | Print the API's answer as JSON instead of text. Progress lines go to stderr, so stdout is one object. |
--api-url <url> | Which API to talk to. Otherwise RF_API_URL, then the address stored at login, then production. |
--profile <name> | Which stored login to use. Default default. |
--help, --version, --completions <shell> | Help for any command, the version, and a completion script for bash, zsh, fish, or PowerShell. |
Output and exit codes
Text output is written for a model to read: short, aligned, no decoration. A failure is one line on stderr and exit code 1, never a stack trace. Exit codes: 0 success, 1 any failure including a usage error, 130 interrupted.
Which key and address a command uses
- The key:
RF_API_KEYif set; else, when an agent is runningrf, the key of the agent the project'srf.jsonnames, when one is stored; else the login in~/.config/rf/credentials.json. An agent is runningrfwhen Claude Code does, which setsCLAUDECODEfor every command it starts, in a hook (rf hooks run), or whenRF_AGENT=1is set, for any other agent. So in your own terminal you keep your login inside the project, account commands included, while Claude Code acts as the agent and stays within what it may do. - The address:
--api-url; elseRF_API_URL; else what the login stored; elsehttps://api.rentfree.dev.
rf config show prints the result and where each part came from.
Which collection a command uses
Commands that work in one collection take --collection; otherwise they use the collectionId in the project's rf.json, then the default the login recorded, then the account's default as the API reports it, which covers a key given in RF_API_KEY. rf search is the exception: without --collection it searches every collection the key may read.
rf init [--force]Opens the browser to approve a code; a first login is a sign-up. Stores the key as the profile, with the API address it was made against and the account's default collection. Denied or expired logins, and keys the API does not accept, store nothing and exit 1. On a machine with no browser, set RF_API_KEY instead.
In a terminal it opens with a banner and asks how to sign in, with a menu: through the browser, the default, or with a key typed or pasted at a prompt that shows only its prefix, as rf whoami does, and an asterisk for each character after it. The arrow keys, j and k, or tab move; enter or a line's number chooses. Ctrl-C at the menu or the key prompt stores nothing and exits 130. A pipe and --json get no banner and no menu, and go straight to the browser. NO_COLOR turns the colour off. rf login is the same command.
When the profile, default or the one --profile names, already holds a login, it says whose and shows the key's prefix, then asks before overwriting it; no is the default, and keeps the login. Where nobody can answer, a pipe or --json, it refuses and exits 1 instead. --force replaces the login without asking. The replaced key is forgotten here but not revoked; rf logout first revokes it.
rf logoutRevokes the stored key through the API, then forgets it. If the API cannot be reached, the local copy still goes and the message says the key may be live.
rf whoamiThe user, the key in use and whether it is user-level or an agent's, the API address, the embedding model, the collections the key can see, and, for a user-level key, the agents.
Recall
rf context [<query>] [--budget <n>] [--collection <id>]The one call an agent makes per turn. Prints the context pack's text and nothing else, so it goes straight into a prompt: the collection's profile, then the memories and passages that bear on the query, trimmed to the budget, 2000 tokens by default and 16000 at most. Without a query, the profile and the most important memories. An empty collection prints nothing at all. --json prints the whole pack, with its token count and what went into it.
rf search <query> [--kind memory|chunk] [--type <types>] [--tier <tiers>] [--limit <n>] [--collection <ids>]Memories and document passages by meaning and by words, one line each: kind, id, score, and the text on one line. Every collection the key may read unless --collection names some. Types and tiers are comma-separated. When the question could not be embedded, the output says it matched by words only.
rf profile [--collection <id>]The collection's profile, as recap last wrote it. A collection recap has not read yet has none, which is a note on stderr, not a failure.
Memories
rf remember <content | -> [--type fact] [--tier long|working] [--subject <s>] [--importance <0..1>] [--expires <iso>] [--collection <id>]Writes a memory and prints its id. A long memory lasts and fades slowly; a working one expires, in a day unless --expires says otherwise, and within 30 days at most. --type is free text; recap writes fact, preference, decision, and plan. - reads the content from stdin.
rf memories list [--status active|archived|expired] [--limit <n>] [--collection <id>]Newest first, with each memory's importance today, after fading.
rf memories show <id>One memory in full, with its version, origin, and expiry.
rf memories edit <id> [--content <text | ->] [--subject <s>] [--importance <0..1>]Corrects a memory. New content is a new version, embedded again; the old one stays in its history.
rf memories archive <id> | rf memories restore <id>Retires a memory, or brings it back. An archived memory keeps its history and sources; an expired one cannot be restored.
rf memories history <id> | rf memories sources <id>Every change to a memory and who made it; and where it came from, the session event or the document passage, with the quote that supports it.
Sessions and events
rf session start [--title <t>] [--external-id <id>] [--collection <id>]Starts a session and prints only its id, so SESSION=$(rf session start) works. The same --external-id always finds the same session.
rf session end <session> [--title <t>]Ends a session. A recap of anything not yet read starts on its own.
rf session show <session> | rf session list | rf session events <session>One session; a collection's sessions; a session's events.
rf log <session> --type <type> [--content <text>] [--meta key=value]...Logs one event: message.user, message.assistant, tool.call, tool.result, or note. The content comes from --content or stdin.
rf log <session> --batchMany events from stdin, one JSON object a line, such as {"type":"note","content":"…"}, sent 100 to a request. Each request is all or none. A line that cannot be read is named, and nothing is sent.
Sources
rf sources add <path | url | -> [--title <t>] [--external-id <id>] [--wait] [--collection <id>]Adds a document, deciding by the argument: - is text from stdin; an http or https address is fetched by the API; a markdown or text file under 1 MB is sent as text; a PDF, or larger text, is uploaded. A file is named by its full path and a URL by itself, so adding the same one again updates it: an unchanged text file is a no-op, a changed one its next version, and a URL or PDF is read again. Text that another source in the collection already holds is added all the same, with a note naming that source. --wait waits until it is ready or failed, and exits 1 on failed.
rf sources list | show <id> | content <id> | remove <id> | refresh <id> [--wait]A collection's sources; one source with its ingest status; its text; removing it and its passages; fetching a URL source again.
Recap
rf recap run [--wait]Recaps the events not yet read. Runs also start on their own, when a session ends, when enough events pile up, and daily. --wait waits for the run and prints what it decided and what it cost.
rf recap runs [--limit <n>] | rf recap show <id>Recent runs with their outcome and cost; one run, with its models and token counts.
Claude Code
rf hooks install [--scope project|local|user] [--tools] [--recall] [--budget <n>]Wires capture and memory into Claude Code's hooks, so the model spends no tokens on either. See Claude Code hooks for what each hook does.
rf hooks uninstall [--scope …] | rf hooks statusRemoves rentfree's hooks and only those; shows which are installed, and where.
Keys
rf keys list [--revoked]Live keys by default: id, prefix, name, whose they are, last use.
rf keys create --name <name> [--agent <id>] [--use]Mints a key and prints the secret once; it is not stored anywhere else. Without --agent the key is user-level. With --use, which needs --agent, the key is stored beside your login and rf.json is written, so an agent running rf in this project acts as that agent.
rf keys revoke <id | prefix>Revokes a live key, found by its id or its prefix as listed. Revoking the key you are using is allowed.
Agents
rf agents list [--revoked]Live agents by default, with read and write permission and collections.
rf agents create <name> [--read-only] [--collections <ids>] [--use]Creates an agent. By default it may read and write the account's default collection. --read-only drops writing; --collections takes a comma-separated list of collection ids instead of the default. --use also mints a key, stores it, and writes rf.json, so from then on Claude Code and its hooks act as the agent in this project, while you keep your login.
rf agents edit <id> [--name <name>] [--read-only | --read-write] [--collections <ids>]Changes an agent. The write list follows the write permission: a read-only agent given --collections may read them and nothing more.
rf agents revoke <id>Revokes the agent and every key it holds, and says how many.
Collections
rf collections list [--archived]Active collections by default, the default first.
rf collections create <name>Names are unique among active collections.
rf collections rename <id> <name>Renames, with the same rule.
rf collections set-default <id>Makes a collection the default. An archived one cannot be.
rf collections archive <id>Archives. It can still be read and searched; nothing new goes in. The default cannot be archived.
Settings
rf config set embed-model <model>[@<size>]Chooses the embedding model, optionally at a size the model offers. Allowed until the account has any source or memory.
rf config set collection <id>Writes the collection into the project's rf.json, after checking it exists, so commands here use it by default.
rf config set agent <id>Writes the agent into rf.json, after checking it exists, for an agent running rf here to act as. Says if no key is stored for it yet, in which case even an agent here uses your login until one is.
rf config showWhat commands here run with, and where each setting came from: the key says (profile), (env), or (agent, as Claude Code ran it), and the agent line says whether it is in use or only used when an agent runs rf here. A refusal of the agent's key says which agent and why it was used.
The account
rf account delete --confirm <email>Deletes the account and everything in it. Without --confirm matching the account's email, it prints what would be lost and the exact command to run, and exits 1, so a script or an agent can never do it by accident.