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

# CLI Commands

> Complete reference for all capwrap-cli commands — authentication, build management, app store deployment, config validation, and built-in help.

Every `capwrap` command maps 1:1 to an action you can perform in the Capwrapper dashboard. Use this page as a reference for the full command set, available flags, and what each command does.

## Authentication

Authenticate your local environment with your Capwrapper API key. Your credentials are stored on disk and reused across sessions until you log out.

```bash theme={null}
capwrap auth login --key <api-key>   # Authenticate with your API key
capwrap auth logout                   # Log out and remove stored credentials
capwrap auth whoami                   # Show the currently authenticated account
```

| Flag              | Description                                                                   |
| ----------------- | ----------------------------------------------------------------------------- |
| `--key <api-key>` | Your Capwrapper API key. Find it in **Settings > API Keys** in the dashboard. |

## Builds

Trigger and manage build jobs. These commands correspond to the `POST /api/v1/builds`, `GET /api/v1/builds/:id`, and `GET /api/v1/builds` REST API endpoints.

```bash theme={null}
capwrap build create --url <url> --name <name> --bundle-id <id>   # Create a new build
capwrap build list                                                   # List all builds
capwrap build status <build-id>                                      # Get status of a specific build
capwrap build download <build-id> --output ./my-app.apk             # Download a build artifact
```

### `build create` flags

| Flag                    | Required | Description                                                                 |
| ----------------------- | -------- | --------------------------------------------------------------------------- |
| `--url <url>`           | Yes      | The public HTTPS URL of your web app.                                       |
| `--name <name>`         | Yes      | The display name of your app.                                               |
| `--bundle-id <id>`      | Yes      | Your app's bundle ID in reverse domain notation (e.g. `com.example.myapp`). |
| `--platform <platform>` | No       | Target platform: `android` or `ios`. Defaults to both.                      |
| `--version <version>`   | No       | Semantic version string (e.g. `1.0.0`).                                     |

### `build download` flags

| Flag              | Required | Description                                                                     |
| ----------------- | -------- | ------------------------------------------------------------------------------- |
| `<build-id>`      | Yes      | The ID of the completed build to download.                                      |
| `--output <path>` | No       | Local file path for the downloaded artifact. Defaults to the current directory. |

## Deploy

Deploy a completed build to the Google Play Store or Apple App Store. This command corresponds to the `POST /api/v1/deploys` endpoint. Your store credentials must be configured in the dashboard before deploying.

```bash theme={null}
capwrap deploy --build-id <id> --platform android   # Deploy to Google Play Store
capwrap deploy --build-id <id> --platform ios        # Deploy to App Store / TestFlight
```

| Flag                    | Required | Description                                                              |
| ----------------------- | -------- | ------------------------------------------------------------------------ |
| `--build-id <id>`       | Yes      | The ID of the build to deploy.                                           |
| `--platform <platform>` | Yes      | Target store: `android` (Google Play) or `ios` (App Store / TestFlight). |

## Config validation

Validate your `capwrap.config.json` file before submitting a build. Running `validate` locally catches configuration errors early and avoids failed build jobs.

```bash theme={null}
capwrap validate                                          # Validate capwrap.config.json in the current directory
capwrap validate --config path/to/capwrap.config.json    # Validate a config file at a specific path
```

| Flag              | Required | Description                                                   |
| ----------------- | -------- | ------------------------------------------------------------- |
| `--config <path>` | No       | Path to the config file. Defaults to `./capwrap.config.json`. |

## Help and version

```bash theme={null}
capwrap --help             # Show top-level help and list available commands
capwrap --version          # Show the installed CLI version
capwrap <command> --help   # Show help for a specific command
```

Run `capwrap <command> --help` for any command to see its flags, required arguments, and usage examples inline.
