> ## Documentation Index
> Fetch the complete documentation index at: https://docs.buildbetter.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Install the BuildBetter CLI

> Install bb, sign in, and connect supported local agent providers

## Install

Your BuildBetter team will give you the current approved install command for the CLI preview. The direct installer uses BuildBetter's release endpoint and installs `bb` into `~/.local/bin` by default.

```bash theme={null}
curl -fsSL https://api.buildbetter.app/v3/rest/cli/bb/install.sh | sh
```

If `~/.local/bin` is not already on your `PATH`, add it in your shell profile:

```bash theme={null}
export PATH="$HOME/.local/bin:$PATH"
```

Verify the install:

```bash theme={null}
command -v bb
bb --version
bb --help
```

<Warning>
  Homebrew and npm install commands are not customer-ready yet. Use the direct installer only when BuildBetter has enabled CLI access for your workspace.
</Warning>

## Sign In

```bash theme={null}
bb auth login
```

The CLI opens a browser sign-in flow and stores local auth configuration under `~/.bb/config.json`.
On Unix systems, new auth writes keep that file private to your user account.

Check your signed-in account:

```bash theme={null}
bb auth status
```

Sign out:

```bash theme={null}
bb auth logout
```

## Install Provider Hooks

Run the hook install command inside the git repository where you use your AI coding provider.

For Codex:

```bash theme={null}
bb agent-sessions hooks install --codex
```

For Claude Code:

```bash theme={null}
bb agent-sessions hooks install --claude
```

The command writes provider hook configuration under the current repository by default. The hook calls BuildBetter quietly at the end of each provider turn and uploads the current agent session when you are signed in.

Use user-global provider config instead of repo-local config:

```bash theme={null}
bb agent-sessions hooks install --codex --global
```

Global installs include a repo-root guard so the hook only runs for the repository where you installed it. Use the default repo-local config when you want the hook definition checked into or shared with the project.

The default hook command fetches BuildBetter's remote bootstrap script. If `bb` is already installed everywhere the provider runs, install a direct local command instead:

```bash theme={null}
bb agent-sessions hooks install --codex --direct-bb
```

Inspect, repair, or remove a managed hook:

```bash theme={null}
bb agent-sessions hooks doctor --codex
bb agent-sessions hooks repair --codex
bb agent-sessions hooks uninstall --codex
```

Use `--claude` instead of `--codex` for Claude Code.

## Resume Sessions

From the same repository and branch:

```bash theme={null}
bb agent-sessions resume
```

The CLI shows uploaded sessions that match the current repository context. Select one to restore the provider-native session locally and launch the matching provider resume command.
