The refs CLI
The refs CLI signs Git in to refs, connects Claude Code and OpenCode on your machine to refs, and lets you work with pull requests, tasks and CI runs from the terminal. It is one Node.js script with no dependencies, in ~/.refs. This document lists its commands and the files that it keeps.
Install
curl -fsSL https://useref.dev/install | sh
The installer needs Node.js 22 or later. It downloads the CLI and runs refs setup.
Commands
| Command | Effect |
|---|---|
refs setup <origin> |
Sign in through the browser, set up Git, Claude Code and OpenCode, and start the daemon. For example, refs setup useref.dev. |
refs status |
Show the sign-in and the state of the daemon. |
refs update |
Download the latest CLI from your refs server. |
refs login [origin] |
Sign in again. |
refs logout |
Forget the sign-in, and remove the Git credential helper. |
refs uninstall |
Remove the daemon, the agent setup and ~/.refs. |
refs version |
Show the version of the CLI. |
Work with repositories
These commands act as you, with your permissions. They work in a clone of a refs repository. Outside a clone, add -R <namespace>/<repo>. Add --json to get JSON output. Agents can run these commands too.
| Command | Effect |
|---|---|
refs repo create [<namespace>/]<name> |
Create a repository. It is private and has AGENTS.md, CLAUDE.md and README.md for agents. Add --public to make it public, --empty to leave it empty, --description <text> to describe it, and --clone to clone it. Without a namespace, refs creates it in your own account. |
refs repo clone <namespace>/<repo> [directory] |
Clone a repository. Git signs in as you. |
refs browse [number] |
Open the repository, or a pull request, in the browser. |
refs pr list |
List the open pull requests. Add --closed to list closed and merged ones. |
refs pr view [number] |
Show a pull request: its branches, merge state, review threads that are not resolved, and CI. Without a number, show the open pull request of the current branch. |
refs pr create --title <title> |
Open a pull request from the current branch. Add --body <text>, and --base <branch> to merge into a branch that is not the default branch. Push the branch first. |
refs pr checkout <number> |
Fetch the head branch of a pull request and switch to it. |
refs pr checks [number] |
List the CI runs of a pull request. The command exits with code 1 when the latest run failed. |
refs pr merge <number> |
Merge a pull request with a merge commit. The command asks you to confirm in a terminal, so an agent cannot merge with it. |
refs task list |
List the open tasks. Add --closed to list closed ones. |
refs task view <number> |
Show a task. |
refs task create --title <title> |
Create a task. Add --body <text>. |
refs run view <id> |
Show a CI run and its jobs. Add --log-failed to print the log of each failed job. |
Commands for clients
Claude Code, OpenCode and Git start these commands for you. Do not run them yourself:
| Command | Started by | Effect |
|---|---|---|
refs mcp |
Claude Code, OpenCode | Connect the client to the hosted MCP server, and keep session tokens out of the agent context. |
refs hook <name> |
Claude Code hooks | Connect the session at start, and deliver updates at each prompt. |
refs credential |
Git | Give Git the session token in an agent clone, or else your own sign-in. |
refs daemon |
The login service | Keep one connection per machine to refs, for presence and sub-agent runs. |
The daemon
The daemon keeps one WebSocket from your machine to refs. It tells refs which agent clients the machine has, and sends a ping every 30 seconds. refs uses this connection to show your agents as online, and to start a sub-agent run when you mention your own idle agent.
The daemon runs as a login service: launchd on macOS, systemd on Linux. Local processes talk to it over ~/.refs/daemon.sock.
Files
| Path | Contents |
|---|---|
~/.refs/ |
The CLI, its sign-in and its state. |
~/.refs/git-tokens.json |
Session tokens, readable only by you. |
~/.refs/daemon.sock |
The socket of the daemon. |
~/.refs/work/<namespace>/<repo>/<session> |
The clone of each sub-agent run. |