> ## Documentation Index
> Fetch the complete documentation index at: https://copilot-api.nick3.top/llms.txt
> Use this file to discover all available pages before exploring further.

# copilot-api debug — show diagnostic information

> Display version, runtime details, file paths, and authentication status to diagnose configuration problems and gather information for support.

The `debug` command prints diagnostic information about your Copilot API installation. It shows the installed version, the Bun runtime version, the paths used for data storage and configuration, and the authentication status of registered accounts. No server is started and no requests are sent to Copilot.

## Usage

```bash theme={null}
npx @nick3/copilot-api@latest debug
```

## Options

| Option   | Default | Description                                                               |
| -------- | ------- | ------------------------------------------------------------------------- |
| `--json` | `false` | Output all diagnostic information as JSON instead of human-readable text. |

The global options (`--api-home`, `--oauth-app`, `--enterprise-url`) also apply.

## What debug outputs

Running `debug` displays information in the following categories:

* **Version** — The installed `@nick3/copilot-api` package version.
* **Runtime** — The Bun version used to execute the CLI.
* **Paths** — The resolved paths for the data directory (tokens, registry, config) and log files. These paths change when you set `--api-home` or `COPILOT_API_HOME`.
* **Authentication status** — Whether each registered account has a valid stored token and whether it has been refreshed recently.

## Examples

<CodeGroup>
  ```bash Human-readable output theme={null}
  npx @nick3/copilot-api@latest debug
  ```

  ```bash JSON output theme={null}
  npx @nick3/copilot-api@latest debug --json
  ```

  ```bash Debug with custom data directory theme={null}
  npx @nick3/copilot-api@latest --api-home=/path/to/dir debug
  ```
</CodeGroup>

## When to use debug

Use `debug` in the following situations:

* **Before opening a support issue.** Share the `--json` output to give maintainers an accurate picture of your environment without manually collecting version numbers and paths.
* **After changing `--api-home` or `COPILOT_API_HOME`.** Confirm that the correct data directory is being used.
* **When authentication is failing unexpectedly.** The output shows whether tokens are present and whether accounts are in a valid state, which helps narrow down whether the problem is a missing token, wrong data path, or expired credential.

<Note>
  `debug` reads only from local storage — it does not make network requests to GitHub or the Copilot API. If you need to verify that a token is still accepted by GitHub, run `auth ls -q` instead.
</Note>
