# Capgo CLI
  <a href="https://capgo.app/"><img src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/></a>

<div align="center">
<h2><a href="https://capgo.app/">Check out: Capgo — Instant updates for capacitor</a></h2>
</div>

A CLI to upload and download files from the Capgo Cloud.

You can find the most up to date version of this doc in our web doc:
https://capgo.app/docs/cli/overview/

## Usage

Before using the CLI, you should register here: https://capgo.app/

Then go to your account in `apikey` section and click in the `all` key to copy it.

Follow the documentation here: https://capacitorjs.com/docs/getting-started/

<!-- AUTO-GENERATED-DOCS-START -->
## 📑 Capgo CLI Commands

## 📋 Table of Contents

- 🚀 [Init](#init)
- 👨‍⚕️ [Doctor](#doctor)
- 🔑 [Login](#login)
- 📦 [Bundle](#bundle)
  - [Upload](#bundle-upload)
  - [Compatibility](#bundle-compatibility)
  - [Delete](#bundle-delete)
  - [List](#bundle-list)
  - [Cleanup](#bundle-cleanup)
  - [Encrypt](#bundle-encrypt)
  - [Decrypt](#bundle-decrypt)
  - [Zip](#bundle-zip)
- 📱 [App](#app)
  - [Add](#app-add)
  - [Delete](#app-delete)
  - [List](#app-list)
  - [Debug](#app-debug)
  - [Setting](#app-setting)
  - [Set](#app-set)
- 📢 [Channel](#channel)
  - [Add](#channel-add)
  - [Delete](#channel-delete)
  - [List](#channel-list)
  - [CurrentBundle](#channel-currentBundle)
  - [Set](#channel-set)
- 🔐 [Key](#key)
  - [Save](#key-save)
  - [Create](#key-create)
  - [Delete_old](#key-delete_old)
- 👤 [Account](#account)
  - [Id](#account-id)
- 🔹 [Organisation](#organisation)
  - [List](#organisation-list)
  - [Add](#organisation-add)
  - [Set](#organisation-set)
  - [Delete](#organisation-delete)

## <a id="init"></a> 🚀 **Init**

**Alias:** `i`

```bash
npx @capgo/cli@latest init
```

🚀 Initialize a new app in Capgo Cloud with step-by-step guidance.
This includes adding code for updates, building, uploading your app, and verifying update functionality.

**Example:**

```bash
npx @capgo/cli@latest init YOUR_API_KEY com.example.app
```

## <a id="options"></a> Options

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-n,** | <code>string</code> | App name for display in Capgo Cloud |
| **-i,** | <code>string</code> | App icon path for display in Capgo Cloud |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |


## <a id="doctor"></a> 👨‍⚕️ **Doctor**

```bash
npx @capgo/cli@latest doctor
```

👨‍⚕️ Check if your Capgo app installation is up-to-date and gather information useful for bug reports.
This command helps diagnose issues with your setup.

**Example:**

```bash
npx @capgo/cli@latest doctor
```

## <a id="options"></a> Options

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **--package-json** | <code>string</code> | Paths to package.json files for monorepos (comma-separated) |


## <a id="login"></a> 🔑 **Login**

**Alias:** `l`

```bash
npx @capgo/cli@latest login
```

🔑 Save your Capgo API key to your machine or local folder for easier access to Capgo Cloud services.
Use --apikey=******** in any command to override it.

**Example:**

```bash
npx @capgo/cli@latest login YOUR_API_KEY
```

## <a id="options"></a> Options

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **--local** | <code>boolean</code> | Only save in local folder, git ignored for security. |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |


## <a id="bundle"></a> 📦 **Bundle**

📦 Manage app bundles for deployment in Capgo Cloud, including upload, compatibility checks, and encryption.

### <a id="bundle-upload"></a> ⬆️ **Upload**

**Alias:** `u`

```bash
npx @capgo/cli@latest bundle upload
```

⬆️ Upload a new app bundle to Capgo Cloud for distribution.
Version must be > 0.0.0 and unique. Deleted versions cannot be reused for security.
External option: Store only a URL link (useful for apps >200MB or privacy requirements).
Capgo never inspects external content. Add encryption for trustless security.

**Example:**

```bash
npx @capgo/cli@latest bundle upload com.example.app --path ./dist --channel production
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-a,** | <code>string</code> | API key to link to your account |
| **-p,** | <code>string</code> | Path of the folder to upload, if not provided it will use the webDir set in capacitor.config |
| **-c,** | <code>string</code> | Channel to link to |
| **-e,** | <code>string</code> | Link to external URL instead of upload to Capgo Cloud |
| **--iv-session-key** | <code>string</code> | Set the IV and session key for bundle URL external |
| **--s3-region** | <code>string</code> | Region for your S3 bucket |
| **--s3-apikey** | <code>string</code> | API key for your S3 endpoint |
| **--s3-apisecret** | <code>string</code> | API secret for your S3 endpoint |
| **--s3-endpoint** | <code>string</code> | URL of S3 endpoint |
| **--s3-bucket-name** | <code>string</code> | Name for your AWS S3 bucket |
| **--s3-port** | <code>string</code> | Port for your S3 endpoint |
| **--no-s3-ssl** | <code>boolean</code> | Disable SSL for S3 upload |
| **--key-v2** | <code>string</code> | Custom path for private signing key (v2 system) |
| **--key-data-v2** | <code>string</code> | Private signing key (v2 system) |
| **--bundle-url** | <code>boolean</code> | Prints bundle URL into stdout |
| **--no-key** | <code>boolean</code> | Ignore signing key and send clear update |
| **--no-code-check** | <code>boolean</code> | Ignore checking if notifyAppReady() is called in source code and index present in root folder |
| **--display-iv-session** | <code>boolean</code> | Show in the console the IV and session key used to encrypt the update |
| **-b,** | <code>string</code> | Bundle version number of the bundle to upload |
| **--link** | <code>string</code> | Link to external resource (e.g. GitHub release) |
| **--comment** | <code>string</code> | Comment about this version, could be a release note, a commit hash, a commit message, etc. |
| **--min-update-version** | <code>string</code> | Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel |
| **--auto-min-update-version** | <code>boolean</code> | Set the min update version based on native packages |
| **--ignore-metadata-check** | <code>boolean</code> | Ignores the metadata (node_modules) check when uploading |
| **--ignore-checksum-check** | <code>boolean</code> | Ignores the checksum check when uploading |
| **--timeout** | <code>string</code> | Timeout for the upload process in seconds |
| **--multipart** | <code>boolean</code> | [DEPRECATED] Use --tus instead. Uses multipart protocol for S3 uploads |
| **--zip** | <code>boolean</code> | Upload the bundle using zip to Capgo cloud (legacy) |
| **--tus** | <code>boolean</code> | Upload the bundle using TUS to Capgo cloud |
| **--tus-chunk-size** | <code>string</code> | Chunk size in bytes for TUS resumable uploads (default: auto) |
| **--partial** | <code>boolean</code> | [DEPRECATED] Use --delta instead. Upload incremental updates |
| **--partial-only** | <code>boolean</code> | [DEPRECATED] Use --delta-only instead. Upload only incremental updates, skip full bundle |
| **--delta** | <code>boolean</code> | Upload incremental/differential updates to reduce bandwidth |
| **--delta-only** | <code>boolean</code> | Upload only delta updates without full bundle (useful for large apps) |
| **--encrypted-checksum** | <code>string</code> | An encrypted checksum (signature). Used only when uploading an external bundle. |
| **--auto-set-bundle** | <code>boolean</code> | Set the bundle in capacitor.config.json |
| **--dry-upload** | <code>boolean</code> | Dry upload the bundle process, mean it will not upload the files but add the row in database (Used by Capgo for internal testing) |
| **--package-json** | <code>string</code> | Paths to package.json files for monorepos (comma-separated) |
| **--node-modules** | <code>string</code> | Paths to node_modules directories for monorepos (comma-separated) |
| **--encrypt-partial** | <code>boolean</code> | Encrypt delta update files (auto-enabled for updater > 6.14.4) |
| **--delete-linked-bundle-on-upload** | <code>boolean</code> | Locates the currently linked bundle in the channel you are trying to upload to, and deletes it |
| **--no-brotli-patterns** | <code>string</code> | Files to exclude from Brotli compression (comma-separated globs, e.g., "*.jpg,*.png") |
| **--disable-brotli** | <code>boolean</code> | Completely disable brotli compression even if updater version supports it |
| **--version-exists-ok** | <code>boolean</code> | Exit successfully if bundle version already exists, useful for CI/CD workflows with monorepos |
| **--self-assign** | <code>boolean</code> | Allow devices to auto-join this channel (updates channel setting) |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="bundle-compatibility"></a> 🧪 **Compatibility**

```bash
npx @capgo/cli@latest bundle compatibility
```

🧪 Check compatibility of a bundle with a specific channel in Capgo Cloud to ensure updates are safe.

**Example:**

```bash
npx @capgo/cli@latest bundle compatibility com.example.app --channel production
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-a,** | <code>string</code> | API key to link to your account |
| **-c,** | <code>string</code> | Channel to check the compatibility with |
| **--text** | <code>boolean</code> | Output text instead of emojis |
| **--package-json** | <code>string</code> | Paths to package.json files for monorepos (comma-separated) |
| **--node-modules** | <code>string</code> | Paths to node_modules directories for monorepos (comma-separated) |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="bundle-delete"></a> 🗑️ **Delete**

**Alias:** `d`

```bash
npx @capgo/cli@latest bundle delete
```

🗑️ Delete a specific bundle from Capgo Cloud, optionally targeting a single version.

**Example:**

```bash
npx @capgo/cli@latest bundle delete BUNDLE_ID com.example.app
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-a,** | <code>string</code> | API key to link to your account |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="bundle-list"></a> 📋 **List**

**Alias:** `l`

```bash
npx @capgo/cli@latest bundle list
```

📋 List all bundles uploaded for an app in Capgo Cloud.

**Example:**

```bash
npx @capgo/cli@latest bundle list com.example.app
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-a,** | <code>string</code> | API key to link to your account |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="bundle-cleanup"></a> 🧹 **Cleanup**

**Alias:** `c`

```bash
npx @capgo/cli@latest bundle cleanup
```

🧹 Delete old bundles in Capgo Cloud, keeping specified number of recent versions.
Bundles linked to channels are preserved unless --ignore-channel is used.

**Example:**

```bash
npx @capgo/cli@latest bundle cleanup com.example.app --bundle=1.0 --keep=3
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-b,** | <code>string</code> | Bundle version number of the app to delete |
| **-a,** | <code>string</code> | API key to link to your account |
| **-k,** | <code>string</code> | Number of versions to keep |
| **-f,** | <code>string</code> | Force removal |
| **--ignore-channel** | <code>boolean</code> | Delete bundles even if linked to channels (WARNING: deletes channels too) |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="bundle-encrypt"></a> 🔒 **Encrypt**

```bash
npx @capgo/cli@latest bundle encrypt
```

🔒 Encrypt a zip bundle for secure external storage.
Returns ivSessionKey for upload/decryption. Get checksum using 'bundle zip --json'.

**Example:**

```bash
npx @capgo/cli@latest bundle encrypt ./myapp.zip CHECKSUM
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **--key** | <code>string</code> | Custom path for private signing key |
| **--key-data** | <code>string</code> | Private signing key |
| **-j,** | <code>string</code> | Output in JSON |

### <a id="bundle-decrypt"></a> 🔓 **Decrypt**

```bash
npx @capgo/cli@latest bundle decrypt
```

🔓 Decrypt an encrypted bundle (mainly for testing).
Prints base64 session key for verification.

**Example:**

```bash
npx @capgo/cli@latest bundle decrypt ./myapp_encrypted.zip CHECKSUM
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **--key** | <code>string</code> | Custom path for private signing key |
| **--key-data** | <code>string</code> | Private signing key |
| **--checksum** | <code>string</code> | Checksum of the bundle, to verify the integrity of the bundle |

### <a id="bundle-zip"></a> 🔹 **Zip**

```bash
npx @capgo/cli@latest bundle zip
```

🗜️ Create a zip file of your app bundle.
Returns checksum for use with encryption. Use --json for machine-readable output.

**Example:**

```bash
npx @capgo/cli@latest bundle zip com.example.app --path ./dist
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-p,** | <code>string</code> | Path of the folder to upload, if not provided it will use the webDir set in capacitor.config |
| **-b,** | <code>string</code> | Bundle version number to name the zip file |
| **-n,** | <code>string</code> | Name of the zip file |
| **-j,** | <code>string</code> | Output in JSON |
| **--no-code-check** | <code>boolean</code> | Ignore checking if notifyAppReady() is called in source code and index present in root folder |
| **--key-v2** | <code>boolean</code> | Use encryption v2 |
| **--package-json** | <code>string</code> | Paths to package.json files for monorepos (comma-separated) |


## <a id="app"></a> 📱 **App**

📱 Manage your Capgo app settings and configurations in Capgo Cloud.

### <a id="app-add"></a> ➕ **Add**

**Alias:** `a`

```bash
npx @capgo/cli@latest app add
```

➕ Add a new app to Capgo Cloud with a unique app ID in the format com.test.app.
All options can be guessed from config if not provided.

**Example:**

```bash
npx @capgo/cli@latest app add com.example.app --name "My App" --icon ./icon.png
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-n,** | <code>string</code> | App name for display in Capgo Cloud |
| **-i,** | <code>string</code> | App icon path for display in Capgo Cloud |
| **-a,** | <code>string</code> | API key to link to your account |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="app-delete"></a> 🗑️ **Delete**

```bash
npx @capgo/cli@latest app delete
```

🗑️ Delete an app from Capgo Cloud, optionally specifying a version to delete only that bundle.

**Example:**

```bash
npx @capgo/cli@latest app delete com.example.app
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-a,** | <code>string</code> | API key to link to your account |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="app-list"></a> 📋 **List**

**Alias:** `l`

```bash
npx @capgo/cli@latest app list
```

📋 List all apps registered under your account in Capgo Cloud.

**Example:**

```bash
npx @capgo/cli@latest app list
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-a,** | <code>string</code> | API key to link to your account |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="app-debug"></a> 🐞 **Debug**

```bash
npx @capgo/cli@latest app debug
```

🐞 Listen for live update events in Capgo Cloud to debug your app.
Optionally target a specific device for detailed diagnostics.

**Example:**

```bash
npx @capgo/cli@latest app debug com.example.app --device DEVICE_ID
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-a,** | <code>string</code> | API key to link to your account |
| **-d,** | <code>string</code> | The specific device ID to debug |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="app-setting"></a> ⚙️ **Setting**

```bash
npx @capgo/cli@latest app setting
```

⚙️ Modify Capacitor configuration programmatically.
Specify setting path (e.g., plugins.CapacitorUpdater.defaultChannel) with --string or --bool.

**Example:**

```bash
npx @capgo/cli@latest app setting plugins.CapacitorUpdater.defaultChannel --string "Production"
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **--bool** | <code>string</code> | A value for the setting to modify as a boolean, ex: --bool true |
| **--string** | <code>string</code> | A value for the setting to modify as a string, ex: --string "Production" |

### <a id="app-set"></a> ⚙️ **Set**

**Alias:** `s`

```bash
npx @capgo/cli@latest app set
```

⚙️ Update settings for an existing app in Capgo Cloud, such as name, icon, or retention period for bundles.
Retention of 0 means infinite storage.

**Example:**

```bash
npx @capgo/cli@latest app set com.example.app --name "Updated App" --retention 30
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-n,** | <code>string</code> | App name for display in Capgo Cloud |
| **-i,** | <code>string</code> | App icon path for display in Capgo Cloud |
| **-a,** | <code>string</code> | API key to link to your account |
| **-r,** | <code>string</code> | Days to keep old bundles (0 = infinite, default: 0) |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |


## <a id="channel"></a> 📢 **Channel**

📢 Manage distribution channels for app updates in Capgo Cloud, controlling how updates are delivered to devices.

### <a id="channel-add"></a> ➕ **Add**

**Alias:** `a`

```bash
npx @capgo/cli@latest channel add
```

➕ Create a new channel for app distribution in Capgo Cloud to manage update delivery.

**Example:**

```bash
npx @capgo/cli@latest channel add production com.example.app --default
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-d,** | <code>string</code> | Set the channel as default |
| **--self-assign** | <code>boolean</code> | Allow device to self-assign to this channel |
| **-a,** | <code>string</code> | API key to link to your account |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="channel-delete"></a> 🗑️ **Delete**

**Alias:** `d`

```bash
npx @capgo/cli@latest channel delete
```

🗑️ Delete a channel from Capgo Cloud, optionally removing associated bundles to free up resources.

**Example:**

```bash
npx @capgo/cli@latest channel delete production com.example.app
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-a,** | <code>string</code> | API key to link to your account |
| **--delete-bundle** | <code>boolean</code> | Delete the bundle associated with the channel |
| **--success-if-not-found** | <code>boolean</code> | Success if the channel is not found |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="channel-list"></a> 📋 **List**

**Alias:** `l`

```bash
npx @capgo/cli@latest channel list
```

📋 List all channels configured for an app in Capgo Cloud to review distribution settings.

**Example:**

```bash
npx @capgo/cli@latest channel list com.example.app
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-a,** | <code>string</code> | API key to link to your account |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="channel-currentBundle"></a> 📦 **CurrentBundle**

```bash
npx @capgo/cli@latest channel currentBundle
```

📦 Get the current bundle linked to a specific channel in Capgo Cloud for update tracking.

**Example:**

```bash
npx @capgo/cli@latest channel currentBundle production com.example.app
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-c,** | <code>string</code> | Channel to get the current bundle from |
| **-a,** | <code>string</code> | API key to link to your account |
| **--quiet** | <code>boolean</code> | Only print the bundle version |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="channel-set"></a> ⚙️ **Set**

**Alias:** `s`

```bash
npx @capgo/cli@latest channel set
```

⚙️ Configure settings for a channel, such as linking a bundle, setting update strategies (major, minor, metadata, patch, none), or device targeting (iOS, Android, dev, emulator).
One channel must be default.

**Example:**

```bash
npx @capgo/cli@latest channel set production com.example.app --bundle 1.0.0 --state default
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-a,** | <code>string</code> | API key to link to your account |
| **-b,** | <code>string</code> | Bundle version number of the file to set |
| **-s,** | <code>string</code> | Set the state of the channel, default or normal |
| **--latest-remote** | <code>boolean</code> | Get the latest bundle uploaded in capgo cloud and set it to the channel |
| **--latest** | <code>boolean</code> | Get the latest version key in the package.json to set it to the channel |
| **--downgrade** | <code>boolean</code> | Allow to downgrade to version under native one |
| **--no-downgrade** | <code>boolean</code> | Disable downgrade to version under native one |
| **--ios** | <code>boolean</code> | Allow sending update to iOS devices |
| **--no-ios** | <code>boolean</code> | Disable sending update to iOS devices |
| **--android** | <code>boolean</code> | Allow sending update to Android devices |
| **--no-android** | <code>boolean</code> | Disable sending update to Android devices |
| **--self-assign** | <code>boolean</code> | Allow device to self-assign to this channel |
| **--no-self-assign** | <code>boolean</code> | Disable devices to self-assign to this channel |
| **--disable-auto-update** | <code>string</code> | Block updates by type: major, minor, metadata, patch, or none (allows all) |
| **--dev** | <code>boolean</code> | Allow sending update to development devices |
| **--no-dev** | <code>boolean</code> | Disable sending update to development devices |
| **--emulator** | <code>boolean</code> | Allow sending update to emulator devices |
| **--no-emulator** | <code>boolean</code> | Disable sending update to emulator devices |
| **--package-json** | <code>string</code> | Paths to package.json files for monorepos (comma-separated) |
| **--ignore-metadata-check** | <code>boolean</code> | Ignore checking node_modules compatibility if present in the bundle |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |


## <a id="key"></a> 🔐 **Key**

🔐 Manage encryption keys for secure bundle distribution in Capgo Cloud, supporting end-to-end encryption with RSA and AES combination.

### <a id="key-save"></a> 🔹 **Save**

```bash
npx @capgo/cli@latest key save
```

💾 Save the public key in the Capacitor config, useful for CI environments.
Recommended not to commit the key for security.

**Example:**

```bash
npx @capgo/cli@latest key save --key ./path/to/key.pub
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-f,** | <code>string</code> | Force generate a new one |
| **--key** | <code>string</code> | Key path to save in Capacitor config |
| **--key-data** | <code>string</code> | Key data to save in Capacitor config |

### <a id="key-create"></a> 🔨 **Create**

```bash
npx @capgo/cli@latest key create
```

🔨 Create RSA key pair for end-to-end encryption.
Creates .capgo_key_v2 (private) and .capgo_key_v2.pub (public) in project root.
Public key is saved to capacitor.config for mobile app decryption.
NEVER commit the private key - store it securely!

**Example:**

```bash
npx @capgo/cli@latest key create
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-f,** | <code>string</code> | Force generate a new one |

### <a id="key-delete_old"></a> 🗑️ **Delete_old**

```bash
npx @capgo/cli@latest key delete_old
```

🧹 Delete the old encryption key from the Capacitor config to ensure only the current key is used.

**Example:**

```bash
npx @capgo/cli@latest key delete_old
```


## <a id="account"></a> 👤 **Account**

👤 Manage your Capgo account details and retrieve information for support or collaboration.

### <a id="account-id"></a> 🔹 **Id**

```bash
npx @capgo/cli@latest account id
```

🪪 Retrieve your account ID, safe to share for collaboration or support purposes in Discord or other platforms.

**Example:**

```bash
npx @capgo/cli@latest account id
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-a,** | <code>string</code> | API key to link to your account |


## <a id="organisation"></a> 🔹 **Organisation**

🏢 Manage your organizations in Capgo Cloud for team collaboration and app management.

### <a id="organisation-list"></a> 📋 **List**

**Alias:** `l`

```bash
npx @capgo/cli@latest organisation list
```

📋 List all organizations you have access to in Capgo Cloud.

**Example:**

```bash
npx @capgo/cli@latest organisation list
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-a,** | <code>string</code> | API key to link to your account |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="organisation-add"></a> ➕ **Add**

**Alias:** `a`

```bash
npx @capgo/cli@latest organisation add
```

➕ Create a new organization in Capgo Cloud for team collaboration.

**Example:**

```bash
npx @capgo/cli@latest organisation add --name "My Company" --email admin@mycompany.com
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-n,** | <code>string</code> | Organization name |
| **-e,** | <code>string</code> | Management email for the organization |
| **-a,** | <code>string</code> | API key to link to your account |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="organisation-set"></a> ⚙️ **Set**

**Alias:** `s`

```bash
npx @capgo/cli@latest organisation set
```

⚙️ Update organization settings such as name and management email.

**Example:**

```bash
npx @capgo/cli@latest organisation set ORG_ID --name "Updated Company Name"
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-n,** | <code>string</code> | Organization name |
| **-e,** | <code>string</code> | Management email for the organization |
| **-a,** | <code>string</code> | API key to link to your account |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |

### <a id="organisation-delete"></a> 🗑️ **Delete**

**Alias:** `d`

```bash
npx @capgo/cli@latest organisation delete
```

🗑️ Delete an organization from Capgo Cloud. This action cannot be undone.
Only organization owners can delete organizations.

**Example:**

```bash
npx @capgo/cli@latest organisation delete ORG_ID
```

**Options:**

| Param          | Type          | Description          |
| -------------- | ------------- | -------------------- |
| **-a,** | <code>string</code> | API key to link to your account |
| **--supa-host** | <code>string</code> | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | <code>string</code> | Custom Supabase anon key (for self-hosting) |



<!-- AUTO-GENERATED-DOCS-END -->

## Programmatic Usage (SDK)

You can use the Capgo CLI programmatically in your Node.js/TypeScript projects for automation and CI/CD pipelines.

### Installation

```bash
npm install @capgo/cli
```

### Example: Upload a Bundle

```typescript
import { CapgoSDK } from '@capgo/cli/sdk'

const sdk = new CapgoSDK({
  apikey: 'your-api-key'
})

await sdk.uploadBundle({
  appId: 'com.example.app',
  bundle: '1.0.0',
  path: './dist',
  channel: 'production'
})
```

### Example: CI/CD Automation

```typescript
import { CapgoSDK } from '@capgo/cli/sdk'

const sdk = new CapgoSDK({
  apikey: process.env.CAPGO_API_KEY
})

// Upload new version
await sdk.uploadBundle({
  appId: 'com.example.app',
  bundle: process.env.VERSION,
  path: './dist',
  channel: 'production'
})

// Cleanup old bundles
await sdk.cleanupBundles({
  appId: 'com.example.app',
  keep: 10
})
```

All CLI features are available as SDK methods. See the [TypeScript types](./src/sdk.ts) for the complete API reference.
