Get started
From nothing to an agent with its own key, in a few minutes.
1. Install the CLI
npm install -g @rentfree/cliThat installs one command, rf. It is a single file with no native dependencies, so it works on any machine with Node 20 or newer. Check it with rf --version.
The CLI used to be published as rentfree. If you have it, remove it first with npm uninstall -g rentfree: both install rf, and npm will not install one over the other.
2. Log in, which is also how you sign up
$ rf init
◆ Welcome! Let's set up rf.
How would you like to authenticate?
❯ Login with email (recommended)
Enter API key manually
↑/↓ to move, enter to chooseIt opens with a banner, then asks how to sign in: move with the arrow keys and press enter. The first way, the default, sends you to the browser:
How would you like to authenticate? Login with email
◆ Opening https://rentfree.dev/cli?code=HJKD-MPQR in your browser.
If it did not open, visit that address and enter HJKD-MPQR.
Waiting for approval...
✓ Logged in as eddie@example.com
✓ API key rf_7Hq2x9Lm… saved in ~/.config/rf/credentials.json
✓ Default collection: default (col_1)The browser asks you to sign in with your email. If you have no account yet, the same page offers to sign you up; there is no separate step, and your first login creates the rentfree account with a collection called default. Approve the code the terminal is showing, and the terminal receives a key. The code is useless on its own and expires in ten minutes.
The second way takes a key you already have, typed or pasted at a prompt that shows its prefix and an asterisk for each of the rest, such as rf_7Hq2x9Lm*******, and checks it with the API before storing it.
A machine without a browser or a person, such as a server or a CI runner, skips the login: every command honours RF_API_KEY in the environment. Mint a key on a machine that is logged in and store it as the runner's secret:
rf keys create --name ci3. See what you have
$ rf whoami
user user_1 eddie@example.com
key CLI on eddie-macbook rf_7Hq2x9Lm user-level (profile)
api https://api.rentfree.dev
model openai/text-embedding-3-small
collections
id name default
col_1 default defaultThe key you logged in with is a user-level key: it can do everything, including manage the account. Agents should not hold one.
4. Give your agent its own key
In the project the agent works in, run:
rf agents create claude-code --useThat creates an agent allowed to read and write your default collection, mints a key for it, stores the key beside your login, and writes an rf.json in the current directory naming the agent. From then on, every rf command Claude Code runs in that project, and each of its hooks, sends the agent's key, so everything the agent writes is attributed to it, and the agent can never mint keys or widen its own permissions. You, in your own terminal, keep your login there, so account commands still work. Another agent acts as it with RF_AGENT=1 in its environment. Commit rf.json; it names things and holds no secret.
Prefer a read-only agent, or one scoped to particular collections?
rf agents create reviewer --read-only --collections col_1,col_2 --use5. Check which key a command would use
$ rf config show
api https://api.rentfree.dev
key rf_7Hq2x9Lm… (profile)
profile default
collection -
agent agent_7 (when an agent runs rf here)The key is RF_API_KEY if set; else, when an agent runs rf, the agent the project's rf.json names; else your login. Run by Claude Code, the same command shows (agent, as Claude Code ran it). The address is --api-url, else RF_API_URL, else the one stored at login, else production.
6. Give Claude Code a memory
rf hooks installFrom the next Claude Code session in this project on, each session starts with what rentfree remembers, logs its turns, and is recapped when it ends, without the model spending a token on it. Claude Code hooks explains each hook and its options.
7. Use it by hand
$ rf remember "Deploys need a green CI run first."
Remembered mem_8KfQ2.
$ rf sources add docs/runbook.md
Added src_Lm2xP: runbook.md, version 1, ready.
$ rf context "how do I deploy?"
## Memories
- Deploys need a green CI run first.
## From your documents
### runbook.md · Deploying
Run the release workflow from main once CI is green.Adding the same file again updates it rather than making a copy. rf search finds memories and passages, and rf memories lists, corrects, and retires them.
Choosing an embedding model
New accounts embed with openai/text-embedding-3-small. You can choose another supported model, at a size it offers, until the account has any content. After that the model is fixed, because what was embedded would no longer match.
rf config set embed-model openai/text-embedding-3-large@1024Where things live
| What | Where |
|---|---|
| Your login and any agent keys | ~/.config/rf/credentials.json, or under $XDG_CONFIG_HOME. Readable only by you. |
| A project's collection and agent | rf.json in the project or an ancestor directory. Committed. |
| A key for a script or CI | RF_API_KEY in the environment, which wins over both. |
Next: the CLI reference for every command, or Concepts for what keys, agents, and collections are.