# Agents: add, remove, refresh

Wire repowise into Claude Code, Codex, Cursor, VS Code, OpenCode, Hermes, GitHub Copilot CLI or Kiro, or drop the config snippet for anything else.

`repowise init` wires up detected agents as part of a first run. This group
is for everything that comes after: adding an agent you installed later,
removing one, refreshing configs after an upgrade, or printing a snippet for
a host repowise doesn't write files for. What an agent gets once it is wired
up is on [MCP tools](https://docs.repowise.dev/mcp/overview), and the Claude Code and Codex
bundles are on [Agent plugins](https://docs.repowise.dev/getting-started/plugins). For the setup
story per agent, see
[For AI agents](https://docs.repowise.dev/getting-started/for-agents).

## `repowise agents`

With no subcommand, lists every known agent for the current repo: its
support tier, whether it looks installed, and everywhere it's currently
wired to repowise.

```bash
repowise agents [OPTIONS]
```

| Name | Type | Default | Description |
|---|---|---|---|
| `--format` | string | `table` | Output format. json reports the full per-agent detection payload. |

---

## `repowise agents add`

Wire one or more agents up to this repo.

```bash
repowise agents add [PATH] [OPTIONS]
```

| Name | Type | Default | Description |
|---|---|---|---|
| `--target` | string |  | Comma-separated agent ids, or one of: auto, all, none. Prompts when omitted. |
| `--scope` | string | `both` | Where to write: project, user, or both. |
| `--yes / -y` | boolean | `false` | Never prompt. |
| `--format` | string | `table` | Output format. json reports every file and what happened to it. |

```bash
repowise agents add                            # checklist, installed agents pre-ticked
repowise agents add --target=claude-code
repowise agents add --target=claude-code,cursor --scope project
repowise agents add --target=auto --yes        # everything already detected, non-interactive
```

The known agent ids: `claude-code`, `codex`, `cursor`, `vscode`, `opencode`,
`hermes`, `copilot`, `kiro`. `--target=auto` picks everything already
detected.

| Target | What it writes |
|---|---|
| `copilot` | The GitHub Copilot CLI MCP config |
| `kiro` | The Kiro MCP config and a steering file |
| `vscode` | `.vscode/mcp.json`, plus Copilot instructions in `.github/copilot-instructions.md` |
| `cursor` | The MCP entry, and with `--scope user` the `afterFileEdit` hook used for opt-in [attribution capture](https://docs.repowise.dev/cli/components#repowise-attribution) and a `preToolUse` hook that rewrites command families set to `allow` through distill | With no
`--target` on a terminal you get a checklist with installed agents
pre-ticked.

---

## `repowise agents remove`

Remove repowise from one or more agents. `--target` is required, there's no
default for a destructive verb.

```bash
repowise agents remove [PATH] --target TARGET [OPTIONS]
```

| Name | Type | Default | Description |
|---|---|---|---|
| `--target` | string |  | Required. Comma-separated agent ids, or one of: auto, all, none. Required. |
| `--scope` | string | `both` | Where to remove from: project, user, or both. |
| `--format` | string | `table` | Output format. json reports every file and what happened to it. |

```bash
repowise agents remove --target=cursor
repowise agents remove --target=all --scope user
```

---

## `repowise agents refresh`

Rewrite the configs of agents that are already wired up. Never adds an
agent, this is what to run after [upgrading](https://docs.repowise.dev/upgrading) repowise or moving the repo: it
repoints what exists and leaves everything else alone.

```bash
repowise agents refresh [PATH] [OPTIONS]
```

| Name | Type | Default | Description |
|---|---|---|---|
| `--scope` | string | `both` | Which scope to refresh: project, user, or both. |
| `--format` | string | `table` | Output format. json reports every file and what happened to it. |

```bash
repowise agents refresh
```

> **Note**
>
> This is what [`repowise doctor --repair`](https://docs.repowise.dev/cli/other#repowise-doctor) calls to fix agent config drift, so
> it's safe to add nothing.

---

## `repowise agents print-config`

Print the config snippet for an agent, writing nothing. This is the whole
of the paste-config tier: an agent nobody has wired up support for is still
served by a snippet and a docs link.

```bash
repowise agents print-config TARGET_ID [PATH] [OPTIONS]
```

| Name | Type | Default | Description |
|---|---|---|---|
| `--scope` | string | `project` | Which scope's snippet to print: project or user. |
| `--format` | string | `table` | Output format. table prints the bare snippet, ready to paste. |

```bash
repowise agents print-config claude-code
repowise agents print-config cursor --scope user > cursor-mcp.json
```
