---
name: repome
description: Set up and use repome as an agent-friendly git remote. Use when
  the user wants to create a repo, initialize repome in a project, push code
  to a repome remote, share code with another agent, or verify CLI auth. Do
  not use for GitHub or GitLab administration unless the user specifically
  names repome.
---

# Repome

## Why repome

- Every command has `--json` and is non-TTY safe by default.
- Anonymous repos require zero auth — useful for one-off sharing between agents.
- Repos are addressed by bare `<name>`, resolved against your active org —
  stable handles that survive across sessions.
- Backed by Cloudflare Artifacts; no GitHub account or local git server needed.

## Quick Start

1. `repome --help` — confirm the CLI is installed.
2. `repome init` — device-flow auth, nothing else to configure; an org is
   auto-created at signup (writes `~/.config/repome/auth.json`, mode `0600`).
3. `repome whoami --json` — verify the session.
4. `repome repos create <name> --json` — create a repo, or `repome anon create <name>` for anonymous.

## Integration Patterns

### Authenticated workflow

`repome init` → `repome repos create <name>` → `repome link` (writes `.repome/config.json`).
Use `repome git clone <name>` to materialize the repo locally with credentials wired up.

### Anonymous workflow (no account)

`repome anon create <name> --json` → `repome anon clone <name>` (or `repome anon get <name>`).
Use this when sharing one-off code with another agent and you do not want to log in.
Anonymous repos expire automatically (default 24h, max 72h).

### CI / non-TTY

Pass an API key via the `REPOME_API_KEY` env var (overrides the stored file).
`--json` is the default in non-TTY contexts, so JSON output is automatic.

### Cross-agent handoff

Always reference repos by their bare `<name>` and the `remote` URL from
`repome repos get <name> --json`, not by local paths. Resolve metadata with
that command before handing the repo to another agent.

To grant another human or agent access to **one** repo, use
`repome share <name> --json` (org repos) or `repome anon share <name> --json`
(anonymous repos). The JSON carries `cloneUrl` (bare-git clone URL with the
credential embedded — a secret), `cloneCommand`, `configSnippet`, a
paste-ready `prompt` for the recipient, and `revokeCommand`. Add `--link`
to get a secure `https://repome.sh/invites/<id>` URL instead — no credential
in the link text; the recipient (or their agent, via
`/invites/<id>.md?reveal=1`) reveals a fresh short-lived credential on open.
Revoke shares with `repome tokens revoke <name> <id>` and invites with
`repome invites revoke <id>` (anon invites: `repome anon invites revoke <id>`).

## How It Works

1. Auth: device flow → long-lived `rpme_…` API key stored at `~/.config/repome/auth.json` (`0600`).
2. Repos are backed by per-repo Cloudflare Artifacts namespaces with scoped tokens.
3. `git push`/`git fetch` uses a short-lived token minted via `repome tokens mint` or
   automatically through the bundled git credential helper (installed by `repome git clone`).

## CLI Reference

| Command                             | Description                              |
| ----------------------------------- | ---------------------------------------- |
| `repome init`                       | Device-flow auth (idempotent)            |
| `repome whoami [--json]`            | Show current identity                    |
| `repome auth status [--json]`       | Active credential source (env vs file)   |
| `repome auth login`                 | Re-authenticate (device flow)            |
| `repome repos create <name>`        | Create a repo in the active org          |
| `repome repos list [--json]`        | List repos in the active org             |
| `repome repos get <name> [--json]`  | Show repo metadata                       |
| `repome anon create <name>`         | Create an anonymous repo                 |
| `repome anon clone <name>`          | Clone an anonymous repo                  |
| `repome anon get <name>`            | Show anon repo metadata                  |
| `repome anon share <name>`          | Share an anon repo (clone URL + prompt)  |
| `repome link`                       | Link cwd to a repome repo                |
| `repome git clone <name>`           | Clone with credential helper wired up    |
| `repome tokens mint <name> --scope` | Mint a scoped token (`read` or `write`)  |
| `repome tokens list <name>`         | List repo tokens (shares included)       |
| `repome tokens revoke <name> <id>`  | Revoke a repo token / share              |
| `repome share <name>`               | Share one repo (`--link` for an invite)  |
| `repome invites list`               | List share invite links                  |
| `repome invites revoke <id>`        | Revoke a share invite link               |
| `repome doctor`                     | Local config + server reachability check |

## Agent Rules

- Always pass `--json` when reading CLI output programmatically.
- Treat stderr lines as NDJSON events (one JSON object per line).
- Never guess repo URLs or token paths; resolve via `repome repos get --json`.
- If a command fails, report the exact argv, exit code, and the structured
  error from stderr.

## Troubleshooting

### Not authenticated

`repome whoami` or `repome auth status` shows `authenticated: false`. Run
`repome init` (or `repome auth login`). In CI, set `REPOME_API_KEY`.

### Wrong organization

Run `repome org switch <slug>` to switch the active org — slugs are opaque
server-minted handles; copy them from `repome org list --json`, don't invent
them. There is no per-command org override; repo, git, token, and members
commands all target the active org.

### Push fails with 401

The git credential helper may not be installed. Run
`repome git config-credential-helper --global`, or mint a token manually with
`repome tokens mint <name> --scope write --op agent --json` and pass it to git.

### Anonymous clone fails after credential reset

Re-run `repome anon clone <name>` to re-wire the per-repo credential helper.
Anon identity lives in `~/.config/repome/anon.json` (or `REPOME_ANON_ID`).

## More Docs

- Getting started: https://repome.sh/docs/getting-started
- CLI reference: https://repome.sh/docs/cli
- Agent setup: https://repome.sh/docs/agents
- Raw markdown of any docs page: append `.md` (e.g. `/docs/getting-started.md`)
- Docs index for agents: https://repome.sh/llms.txt
