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

# Commands

> This page provides the complete reference for the OnCall CLI commands and top‑level flags.

# Commands

<table><thead><tr><th>Command</th><th>Description</th><th width="250">Example</th></tr></thead><tbody><tr><td><code>debug --help</code></td><td>Show usage help and exit.</td><td><code>debug --help</code></td></tr><tr><td><code>debug --version</code> / <code>debug -v</code></td><td>Print the installed OpenBug CLI version and exit.</td><td><code>debug --version</code></td></tr><tr><td><code>debug init \[-id \<project-id>] -m \<description></code></td><td>Initialize OpenBug configuration and create/update <code>openbug.yaml</code> for the current directory.</td><td><code>debug init -id openbug-service  -m "Node.js API"</code></td></tr><tr><td><code>debug login \<auth-key></code></td><td>Save your API key into <code>\~/.openbug/config</code>.</td><td><code>debug login abc123xyz789</code></td></tr><tr><td><code>debug</code></td><td>Start the local WebSocket cluster server on port 4466 for multi-service debugging and also Start the Ai chat interface</td><td><code>debug</code> </td></tr><tr><td><code>debug \<command>...</code></td><td>Run any shell command under OpenBug's interactive debugging.</td><td><code>debug npm run dev</code></td></tr></tbody></table>

#### `oncall init` options

Initializes configuration for the current project and writes `oncall.yaml`.

* `-m <description>` (required)
  * Human-readable description of the service.
* `-id <project-id>` (optional)
  * Project identifier used to group services into a cluster.
  * If omitted, you will be prompted to enter one interactively.

Example:

```bash theme={null}
oncall init -id my-app -m "Node.js REST API backend"
```

#### `debug login` arguments

Stores your API key in `~/.openbug/config`:

* `<auth-key>` (required)
  * Obtain this from the OnCall dashboard (`https://app.oncall.build`).

Example:

```bash theme={null}
debug login abc123xyz789
```

#### `debug`

#### Starts Ai Chat Interface:

* Lets the user to ask questions on the active sessions available
* Lets user understand what is going wrong in his service

#### Starts a local WebSocket server in the background (`ws://127.0.0.1:4466` by default) that:

* Registers services when you run `debug <command>` in directories with `openbug.yaml`.
* Keeps a registry of all services for each project `id`.
* Lets the OpenBug debugging service see your app’s architecture (services + access flags).

The command does not accept additional arguments.\
Stop the server with `Ctrl+C` in that terminal.

Example:

```bash theme={null}
debug
```

#### `debug <command>...`

Wraps any shell command with OpenBug's interactive debugging interface:

* The command is executed via a pseudo-terminal.
* Logs are streamed into the OpenBug UI.
* You can ask questions in the chat pane while the command runs.
* The OpenBug debugging service may use tools (logs/code) according to your `openbug.yaml` flags.

Examples:

```bash theme={null}
debug npm run dev
debug python app.py
debug docker-compose up
debug node server.js --port 3000
```

### Global flags

OpenBug CLI supports a small set of top-level flags:

| Flag              | Description                                      |
| ----------------- | ------------------------------------------------ |
| `--help`, `-h`    | Print usage help and exit.                       |
| `--version`, `-v` | Print the installed OnCall CLI version and exit. |

These flags are handled before any subcommand or wrapped command is executed.
