# bpw CLI reference

Source: https://botpassword.com/docs/cli

`bpw` is a human-friendly command-line tool and the shell surface of the agent catalog. It holds no keys; it talks to the desktop daemon `botpasswordd`. Values are never printed by agent-class subcommands.

## What are the commands?

Some commands below exist today and some are planned. Anything marked planned is not built yet; the page says what to do instead.

| Command | Status | Purpose |
|---|---|---|
| `bpw status` | Available | Show account, device, lock and sync state; no values |
| `bpw intents` | Available | List the agent intents this build understands |
| `bpw mcp` | Available | Start the stdio MCP server |
| `bpw agent <intent>` | Available | Call one agent intent on the daemon's agent endpoint; never returns a value |
| `bpw agent run -- <harness>` | Available | Start an agent session and run a harness inside it |
| `bpw grant`, `bpw session` | Available | List, add and revoke grants; list and end agent sessions (human commands; they ask for the master password) |
| `bpw run --with <cred> -- <cmd>` | Planned | A CLI form of `run_with`. Today an agent calls `run_with` through MCP or `bpw agent run_with` |
| `bpw login <tool>` | Available | Prints the grant command and the setup for git, Docker, AWS and kubectl; for `gh`, `wrangler` and `npm` it prints the `run_with` route. `bpw login git --host H --apply` writes the repository's git config after a y/N answer |
| `bpw git-credential`, `docker-credential-bpw` | Available | The git and Docker credential helpers; both are the `bpw` binary under another name |
| `bpw aws-creds`, `bpw kube-creds` | Available | The AWS `credential_process` helper and the kubectl exec credential plugin |
| `bpw agent install <harness>`, `bpw agent uninstall <harness>` | Available | Set up Claude Code, Codex or a generic project (`.mcp.json` and `AGENTS.md`) in one step, and undo it. Configuration only: no grant, no session, no secret. `--dry-run` shows what would change. Other harnesses are planned; add their `bpw mcp` entry by hand |
| `bpw agent enroll`, `bpw agent clients`, `bpw agent unenroll <id>` | Available | Enroll a harness so a grant can name it (`bpw grant add --client ID`). `enroll claude-code` and `enroll codex` recognize the program by its macOS code signature. `--name N --path P` recognizes a program by its path, on macOS or Linux. Enrolling and removing ask for the master password. `bpw agent clients --reset` discards a stored list that cannot be read, with the master password |
| `bpw daemon install`, `uninstall`, `status`, `restart` | Available (macOS) | Run `botpasswordd` as a per-user launchd agent that starts at login. `install --enable-extension` also turns on the browser-extension endpoint. `restart` starts the loaded daemon again so it runs an updated binary, and locks the vault. Other platforms print "not supported yet" |
| `bpw proxy` | Planned | A standalone egress proxy for harnesses. Sealed `run_with` already runs its own proxy for each run (`bpw agent run_with --sealed VAR=ITEM`, Linux and macOS) |
| `bpw-native-host` | Available | A separate binary, the browser native-messaging host (fill only); registered by the extension, not run by hand |
| `bpw reveal` | Planned | Human-only reveal behind human-endpoint authentication |

This page describes the forms shown here; run `bpw <command> --help` for the full flag list of an available command.

## How do I check state?

```sh
bpw status
bpw intents
```

`bpw status` shows account, device, lock and sync state, metadata only. `bpw intents` lists the intents this build understands; the catalog is in [Intent catalog](/docs/intents).

`bpw agent <intent>` and `bpw status` take `--json`: one JSON object on stdout and nothing else there. No secret value is in it. A command line that cannot be parsed prints a `usage_error` object and exits 2. `bpw item list`, `bpw item search` and `bpw session list` also take `--json`; they ask for the master password, so they are for a person's own scripts, not for an agent.

## What do the exit statuses mean?

| Status | Meaning |
|---|---|
| 0 | Done |
| 1 | Failed: no daemon (`daemon_unavailable`), a daemon this `bpw` cannot read (`daemon_incompatible`), or bad arguments or an internal error (`failed`, with a `message`) |
| 2 | The command line could not be parsed (`usage_error` with `--json`) |
| 3 | Refused: `bpw agent` reached the daemon and it said no (`vault_locked`, `scope_denied`, `session_required` and the like). The output has the outcome, `message` and `next_step` |
| 4 | Not finished: a person must act. `approval_required` or `partially_rotated`. Do not treat it as done |

`bpw agent run` exits with the status of the command it ran, so a 3 or a 4 there is that command's own. The credential helpers keep the exit status their own tool defines.

## How do I start the MCP server?

```sh
bpw mcp
```

You normally do not run this yourself. A harness launches it over stdio. See [MCP server](/docs/mcp-server) and the [Claude Code](/docs/guides/claude-code) and [Codex](/docs/guides/codex) guides.

## How do I set up a harness?

```sh
bpw agent install claude-code    # or: codex, generic
bpw agent run -- claude          # start the harness inside a session
```

`bpw agent install <harness>` registers `bpw mcp --agent <harness>` with the harness and installs the standing instructions between marker lines; `bpw agent uninstall <harness>` removes exactly that. It makes no grant and no session, and writes no secret. The [Claude Code](/docs/guides/claude-code) and [Codex](/docs/guides/codex) guides cover it, and the by-hand steps. Cursor, VS Code, Windsurf and Gemini CLI are planned: add their entry by hand. See [Harness setup](/docs/harness-setup).

## How do I run a command with a credential?

Planned: `bpw run --with <cred> -- <cmd>` is not built yet. Today an agent asks for `run_with` through the MCP server, against a grant you made with `bpw grant add`. With `--env` or `--file` the child process holds the secret while it runs, which is why such a grant must say so (`--allow-disclosure`). With `--sealed` on Linux and macOS, the child gets a placeholder instead, and the grant names the hosts it may be used on (`bpw grant add ITEM --intent run_with --argv '...' --host api.example.com`); see [Security model](/docs/security-model).

## How do I log a tool in?

```sh
bpw login git --host github.com
```

`bpw login <tool>` prints the `bpw grant add --intent cli_login` command and the setup for git, Docker, AWS and kubectl, so the tool fetches its token from a credential helper at the moment of use. It asks the daemon for nothing. The agent form is `bpw agent cli_login --tool T --site HOST [--credential ID]`, which returns setup lines and never a value. The helpers work only inside an agent session, and every `cli_login` grant is disclosing: the tool, and code the agent runs, can read the value it receives. For `gh`, `wrangler` and `npm` there is no helper; use `run_with`. See [Credential helpers](/docs/credential-helpers).

## How does the multi-call binary work?

The credential helpers are one binary. `bpw git-credential` also runs as `git-credential-bpw`, and `docker-credential-bpw` is a link to `bpw` that you put on your `PATH`. `bpw aws-creds` and `bpw kube-creds` are subcommands. See [Credential helpers](/docs/credential-helpers).

## How does the CLI relate to MCP?

Same daemon, same policy, same outcomes. A `bpw` subcommand and an MCP tool call for the same intent get the same decision. For agents with only a shell, the CLI plus an AGENTS.md section is the planned integration path; today the `bpw agent` commands cover it. Outcomes are listed in [Typed outcomes](/docs/typed-outcomes).

## What does the CLI never do?

Agent-class subcommands never print values. Reveal, export, grant editing, enrollment and recovery are human-only and are not reachable from the agent endpoint. For provider-specific context see [/keys](/keys).
