# rebon

An agent CLI for coding and more — a terminal harness that drives an LLM through
a real agent loop with tools, sessions, permissions, and a full TUI.

## Install

```bash
npm install -g @boninall/rebon
```

Upgrade later:

```bash
npm install -g @boninall/rebon@latest
```

`@boninall/rebon` is a thin launcher that pulls the matching native binary as
an optional dependency. Supported platforms: `win32-x64`, `darwin-x64`,
`darwin-arm64`, `linux-x64`, `linux-arm64`.

> If install fails with "missing optional platform package", you likely passed
> `--omit=optional` or `--no-optional`. Reinstall without that flag.

## Quick start

```bash
# Local TUI in the current directory
rebon

# Resume a previous session
rebon --resume sess-0-1712937600000

# Override the active provider / model
rebon --provider openrouter --model gpt-5.5

# Run as an ACP JSON-RPC server on stdio (for editor / IDE integrations)
rebon --acp
```

The first run drops you into onboarding: pick a provider, sign in (OAuth +
PKCE for Claude / OpenAI, or paste an API key), and you're in.

## CLI flags

| Flag                | Purpose                                                      |
| ------------------- | ------------------------------------------------------------ |
| `--acp`             | Run as an ACP JSON-RPC server on stdio.                      |
| `--provider <name>` | Override `activeCustomProvider` from `~/.rebon/config.json`. |
| `--model <id>`      | Override the resolved provider's default model.              |
| `--resume <id>`     | Load an on-disk transcript and replay it into the TUI.       |

## Config & data

- `~/.rebon/config.json` — providers, models, credentials, defaults.
- `~/.rebon/sessions/` — saved transcripts.
- `~/.rebon/skills/`, `~/.rebon/agents/`, `~/.rebon/memory/` — user assets.
- `$REBON_LOG_DIR/rebon.log` — TUI log file (defaults to
  `%TEMP%/rebon/logs/rebon.log` on Windows, `$TMPDIR/rebon/logs/rebon.log`
  elsewhere). `--acp` mode logs to stderr instead.

Project-level overrides live under `.rebon/` and `.claude/` in your working
directory.

## What you get

- **Local TUI** — prompt input with history, paste, image paste, `@`-mention
  and slash-command pickers, queued submissions, mode cycling; streaming
  transcript with markdown, tool grouping, thinking blocks, plan approval,
  permission modal; full dialog stack for onboarding, settings, resume,
  rewind, quick-open, history search, global search, tasks, background
  tasks, teams, agents.
- **Agentic tool loop** — Bash / PowerShell, Read / Write / Edit, Glob /
  Grep, Sleep, TaskCreate / TaskUpdate / TaskList / TaskGet / TaskStop,
  Agent, SkillTool, AskUserQuestion, SendMessage, EnterPlanMode /
  ExitPlanMode, ToolSearch, Team{Create,Delete,Files,Mailbox,Manager},
  Worktree, plus MCP tools (stdio, Streamable HTTP, legacy SSE).
- **Providers** — Anthropic, OpenAI, and OpenAI-Responses, with streaming,
  compact / context-prune passes, and automatic session titles.
- **Permissions, hooks, sandbox** — fine-grained allow / deny for shell,
  filesystem, web-fetch, and skill invocations; user-defined hooks; sandbox
  config with violation reporting.
- **Skills, agents, memory** — bundled and user skills; spawnable
  worker agents and a coordinator for background tasks; a persistent memory
  layer with recall and surfacing.
- **ACP server** — drive Rebon from an editor over stdio JSON-RPC:
  `initialize`, `session/new`, `session/load`, `session/list`,
  `session/prompt`, `session/cancel`, reverse-RPC permission prompts,
  streamed tool output.

## Common tasks

```bash
# Start a fresh session in the current repo
rebon

# Resume the last session you worked on (use Tab in the TUI to browse)
rebon --resume <session-id>

# Plug Rebon into an editor over ACP (the editor manages stdio for you)
rebon --acp

# Override provider/model without editing config
rebon --provider anthropic --model claude-opus-4-7
```

Inside the TUI:

- `?` — keyboard help
- `/` — slash-command picker
- `@` — file / symbol mention
- `Tab` — switch panel / list
- `Esc` — cancel current step or dismiss a dialog

## Updating

`rebon` ships with a built-in updater that checks for new releases on launch.
You can also just rerun:

```bash
npm install -g @boninall/rebon@latest
```

## Troubleshooting

- **"missing optional platform package"** — reinstall without
  `--omit=optional` / `--no-optional` / `--ignore-optional`.
- **"unsupported platform"** — your `process.platform`/`process.arch` is not
  one of the five supported targets.
- **TUI looks scrambled** — make sure your terminal supports truecolor and
  Unicode width tables (modern Windows Terminal, iTerm2, Alacritty, WezTerm,
  Kitty all work). The legacy `cmd.exe` and `conhost` are not supported.
- **Logs** — check `$REBON_LOG_DIR/rebon.log` (TUI) or stderr (`--acp`).
