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

# bt profiles

> List, diagnose, repair, rename, and delete saved Braintrust login profiles from the CLI.

`bt profiles` manages saved Braintrust login profiles and diagnoses orphaned credentials. A profile stores local login metadata and credentials for one Braintrust app URL. Organization and project context are selected separately with [`bt switch`](https://docs.braintrust.dev/reference/cli/switch).

Use [`bt status --all`](https://docs.braintrust.dev/reference/cli/status) when you need to verify whether saved profiles still have valid credentials.

Deleting a profile removes local profile metadata and stored credentials. It does not revoke API keys or sign you out of the Braintrust web app.

When you rename a profile, `bt` updates references to it in the global `~/.config/bt/config.json` file (or `$XDG_CONFIG_HOME/bt/config.json`) and the active local `.bt/config.json` file for the current directory. Deleting a profile clears those references.

## Subcommands

| Subcommand | Description |
| - | - |
| `bt profiles` | List saved profiles |
| `bt profiles list` | List saved profiles |
| `bt profiles doctor` | Find orphaned credentials in the plaintext fallback store, or on Windows, the encrypted credentials file |
| `bt profiles repair [name...]` | Remove orphaned credentials. Pass deleted profile names to also clean the system credential store |
| `bt profiles delete [name]` | Delete a saved profile and its credentials. Omit the name to choose a profile interactively |
| `bt profiles rename <name> <new-name>` | Rename a saved profile and move its stored credentials |

## Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
bt profiles
bt profiles list --json
bt profiles doctor
bt profiles repair --force
bt profiles repair deleted-profile --force
bt profiles delete test-profile
bt profiles rename test-profile renamed-profile
```

## Diagnose and repair orphaned credentials

Normally, `bt profiles delete` and `bt logout` remove both a saved profile's metadata and its local credentials. If credential cleanup fails or is interrupted, or if `auth.json` is edited or deleted manually, credentials can remain after the profile is gone. `bt` can no longer use them through the deleted profile, but the secrets remain on the machine.

Choose a cleanup method based on what you know:

* **Find and remove leftovers from the plaintext fallback store:** Run [`bt profiles doctor`](#subcommands) to list entries in `secrets.json` that do not match a saved profile. On Windows, `bt` v0.22.2 or later checks the encrypted credentials file instead. Then run `bt profiles repair` without a profile name to remove them. These commands do not inspect or change the OS credential store.

  ```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  bt profiles doctor
  bt profiles repair
  ```

* **Remove credentials for a known deleted profile:** Pass one or more deleted profile names to `bt profiles repair`. This form attempts to remove any API key, OAuth access token, and OAuth refresh token stored for each name from both the OS credential store and `secrets.json`.

  ```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  bt profiles repair <deleted-profile>
  ```

> [!WARNING]
>
> `bt profiles repair` deletes local credentials. Before repairing the plaintext fallback store, run `bt profiles doctor` to list the affected entries. When repairing by name, verify each deleted profile name carefully. The repair prompt reports only a count.

## Flags

| Command | Flag | Description |
| - | - | - |
| `bt profiles delete` | `--force`, `-f` | Skip confirmation. Requires a positional profile name or an explicit `--profile` |
| `bt profiles repair` | `--force`, `-f` | Skip confirmation |

`bt profiles` accepts shared [global flags](https://docs.braintrust.dev/reference/cli/overview.md#global-flags), including `--json` and `--profile`. `--json` works with every subcommand.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.