An open API service indexing awesome lists of open source software.

https://github.com/cap-go/cli

CLI to help you to manage your version in capgo cloud
https://github.com/cap-go/cli

capacitor cli nodejs

Last synced: 12 days ago
JSON representation

CLI to help you to manage your version in capgo cloud

Awesome Lists containing this project

README

          

# Capgo CLI
Capgo - Instant updates for capacitor


Check out: Capgo โ€” Instant updates for capacitor


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/

## ๐Ÿ“‘ 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)
- ๐Ÿ”น [Organization](#organization)
- [List](#organization-list)
- [Add](#organization-add)
- [Members](#organization-members)
- [Set](#organization-set)
- [Delete](#organization-delete)
- ๐Ÿ”น [Organisation](#organisation)
- [List](#organisation-list)
- [Add](#organisation-add)
- [Set](#organisation-set)
- [Delete](#organisation-delete)
- ๐Ÿ”น [Build](#build)
- [Request](#build-request)
- [Credentials](#build-credentials)
- ๐Ÿ”น [Mcp](#mcp)

## ๐Ÿš€ **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
```

## Options

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

## ๐Ÿ‘จโ€โš•๏ธ **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
```

## Options

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

## ๐Ÿ”‘ **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
```

## Options

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

## ๐Ÿ“ฆ **Bundle**

๐Ÿ“ฆ Manage app bundles for deployment in Capgo Cloud, including upload, compatibility checks, and encryption.

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

### ๐Ÿงช **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,** | string | API key to link to your account |
| **-c,** | string | Channel to check the compatibility with |
| **--text** | boolean | Output text instead of emojis |
| **--package-json** | string | Paths to package.json files for monorepos (comma-separated) |
| **--node-modules** | string | Paths to node_modules directories for monorepos (comma-separated) |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

### ๐Ÿ—‘๏ธ **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,** | string | API key to link to your account |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

### ๐Ÿ“‹ **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,** | string | API key to link to your account |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

### ๐Ÿงน **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,** | string | Bundle version number of the app to delete |
| **-a,** | string | API key to link to your account |
| **-k,** | string | Number of versions to keep |
| **-f,** | string | Force removal |
| **--ignore-channel** | boolean | Delete bundles even if linked to channels (WARNING: deletes channels too) |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

### ๐Ÿ”’ **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** | string | Custom path for private signing key |
| **--key-data** | string | Private signing key |
| **-j,** | string | Output in JSON |

### ๐Ÿ”“ **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** | string | Custom path for private signing key |
| **--key-data** | string | Private signing key |
| **--checksum** | string | Checksum of the bundle, to verify the integrity of the bundle |

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

## ๐Ÿ“ฑ **App**

๐Ÿ“ฑ Manage your Capgo app settings and configurations in Capgo Cloud.

### โž• **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,** | string | App name for display in Capgo Cloud |
| **-i,** | string | App icon path for display in Capgo Cloud |
| **-a,** | string | API key to link to your account |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

### ๐Ÿ—‘๏ธ **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,** | string | API key to link to your account |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

### ๐Ÿ“‹ **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,** | string | API key to link to your account |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

### ๐Ÿž **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,** | string | API key to link to your account |
| **-d,** | string | The specific device ID to debug |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

### โš™๏ธ **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** | string | A value for the setting to modify as a boolean, ex: --bool true |
| **--string** | string | A value for the setting to modify as a string, ex: --string "Production" |

### โš™๏ธ **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,** | string | App name for display in Capgo Cloud |
| **-i,** | string | App icon path for display in Capgo Cloud |
| **-a,** | string | API key to link to your account |
| **-r,** | string | Days to keep old bundles (0 = infinite, default: 0) |
| **--expose-metadata** | string | Expose bundle metadata (link and comment) to the plugin (true/false, default: false) |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

## ๐Ÿ“ข **Channel**

๐Ÿ“ข Manage distribution channels for app updates in Capgo Cloud, controlling how updates are delivered to devices.

### โž• **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,** | string | Set the channel as default |
| **--self-assign** | boolean | Allow device to self-assign to this channel |
| **-a,** | string | API key to link to your account |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

### ๐Ÿ—‘๏ธ **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,** | string | API key to link to your account |
| **--delete-bundle** | boolean | Delete the bundle associated with the channel |
| **--success-if-not-found** | boolean | Success if the channel is not found |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

### ๐Ÿ“‹ **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,** | string | API key to link to your account |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

### ๐Ÿ“ฆ **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,** | string | Channel to get the current bundle from |
| **-a,** | string | API key to link to your account |
| **--quiet** | boolean | Only print the bundle version |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

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

## ๐Ÿ” **Key**

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

### ๐Ÿ”น **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,** | string | Force generate a new one |
| **--key** | string | Key path to save in Capacitor config |
| **--key-data** | string | Key data to save in Capacitor config |

### ๐Ÿ”จ **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,** | string | Force generate a new one |

### ๐Ÿ—‘๏ธ **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
```

## ๐Ÿ‘ค **Account**

๐Ÿ‘ค Manage your Capgo account details and retrieve information for support or collaboration.

### ๐Ÿ”น **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,** | string | API key to link to your account |

## ๐Ÿ”น **Organization**

๐Ÿข Manage your organizations in Capgo Cloud for team collaboration and app management.

### ๐Ÿ“‹ **List**

**Alias:** `l`

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

๐Ÿ“‹ List all organizations you have access to in Capgo Cloud.

**Example:**

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

**Options:**

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

### โž• **Add**

**Alias:** `a`

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

โž• Create a new organization in Capgo Cloud for team collaboration.

**Example:**

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

**Options:**

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

### ๐Ÿ”น **Members**

**Alias:** `m`

```bash
npx @capgo/cli@latest organization members
```

๐Ÿ‘ฅ List organization members and their 2FA status.
Shows all members of an organization with their roles and whether they have 2FA enabled.
Useful before enabling 2FA enforcement to see which members will be affected.
> โ„น๏ธ Viewing 2FA status requires super_admin rights in the organization.

**Example:**

```bash
npx @capgo/cli@latest organization members ORG_ID
```

**Options:**

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

### โš™๏ธ **Set**

**Alias:** `s`

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

โš™๏ธ Update organization settings such as name, email, and 2FA enforcement.

**Example:**

```bash
npx @capgo/cli@latest organization set ORG_ID --name "New Name"
```

**Options:**

| Param | Type | Description |
| -------------- | ------------- | -------------------- |
| **-n,** | string | Organization name |
| **-e,** | string | Management email for the organization |
| **--enforce-2fa** | boolean | Enable 2FA enforcement for all organization members |
| **--no-enforce-2fa** | boolean | Disable 2FA enforcement for organization |
| **-a,** | string | API key to link to your account |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |

### ๐Ÿ—‘๏ธ **Delete**

**Alias:** `d`

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

๐Ÿ—‘๏ธ Delete an organization from Capgo Cloud. This action cannot be undone.
Only organization owners can delete organizations.

**Example:**

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

**Options:**

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

## ๐Ÿ”น **Organisation**

[DEPRECATED] Use "organization" instead. This command will be removed in a future version.

### ๐Ÿ“‹ **List**

**Alias:** `l`

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

[DEPRECATED] Use "organization list" instead.

**Options:**

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

### โž• **Add**

**Alias:** `a`

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

[DEPRECATED] Use "organization add" instead.

**Options:**

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

### โš™๏ธ **Set**

**Alias:** `s`

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

[DEPRECATED] Use "organization set" instead.

**Options:**

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

### ๐Ÿ—‘๏ธ **Delete**

**Alias:** `d`

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

[DEPRECATED] Use "organization delete" instead.

**Options:**

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

## ๐Ÿ”น **Build**

๐Ÿ—๏ธ Manage native iOS/Android builds through Capgo Cloud.
โš ๏ธ This feature is currently in PUBLIC BETA and cannot be used by anyone at this time.
๐Ÿ”’ SECURITY GUARANTEE:
Build credentials are NEVER stored on Capgo servers.
They are used only during the build and auto-deleted after.
Builds sent directly to app stores - Capgo keeps nothing.
๐Ÿ“‹ BEFORE BUILDING:
Save your credentials first:
npx @capgo/cli build credentials save --appId --platform ios
npx @capgo/cli build credentials save --appId --platform android

### ๐Ÿ”น **Request**

```bash
npx @capgo/cli@latest build request
```

Request a native build from Capgo Cloud.
This command will zip your project directory and upload it to Capgo for building.
The build will be processed and sent directly to app stores.
๐Ÿ”’ SECURITY: Credentials are never stored on Capgo servers. They are auto-deleted
after build completion. Builds sent directly to stores - Capgo keeps nothing.
๐Ÿ“‹ PREREQUISITE: Save credentials first with:
npx @capgo/cli build credentials save --appId --platform

**Example:**

```bash
npx @capgo/cli@latest build request com.example.app --platform ios --path .
```

**Options:**

| Param | Type | Description |
| -------------- | ------------- | -------------------- |
| **--path** | string | Path to the project directory to build (default: current directory) |
| **--platform** | string | Target platform: ios or android (required) |
| **--build-mode** | string | Build mode: debug or release (default: release) |
| **--build-config** | string | Additional build configuration as JSON string |
| **--build-certificate-base64** | string | iOS: Base64-encoded .p12 certificate |
| **--build-provision-profile-base64** | string | iOS: Base64-encoded provisioning profile |
| **--build-provision-profile-base64-prod** | string | iOS: Base64-encoded production provisioning profile |
| **--p12-password** | string | iOS: Certificate password (optional if cert has no password) |
| **--apple-id** | string | iOS: Apple ID email |
| **--apple-app-specific-password** | string | iOS: App-specific password |
| **--apple-key-id** | string | iOS: App Store Connect API Key ID |
| **--apple-issuer-id** | string | iOS: App Store Connect Issuer ID |
| **--apple-key-content** | string | iOS: Base64-encoded App Store Connect API key (.p8) |
| **--apple-profile-name** | string | iOS: Provisioning profile name |
| **--app-store-connect-team-id** | string | iOS: App Store Connect Team ID |
| **--android-keystore-file** | string | Android: Base64-encoded keystore file |
| **--keystore-key-alias** | string | Android: Keystore key alias |
| **--keystore-key-password** | string | Android: Keystore key password |
| **--keystore-store-password** | string | Android: Keystore store password |
| **--play-config-json** | string | Android: Base64-encoded Google Play service account JSON |
| **-a,** | string | API key to link to your account |
| **--supa-host** | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| **--supa-anon** | string | Custom Supabase anon key (for self-hosting) |
| **--verbose** | boolean | Enable verbose output with detailed logging |

### ๐Ÿ”น **Credentials**

```bash
npx @capgo/cli@latest build credentials
```

Manage build credentials stored locally on your machine.
๐Ÿ”’ SECURITY:
- Credentials saved to ~/.capgo-credentials/credentials.json (global) or .capgo-credentials.json (local)
- When building, sent to Capgo but NEVER stored permanently
- Deleted from Capgo immediately after build
- Builds sent directly to app stores - Capgo keeps nothing
๐Ÿ“š DOCUMENTATION:
iOS setup: https://capgo.app/docs/cli/cloud-build/ios/
Android setup: https://capgo.app/docs/cli/cloud-build/android/

## ๐Ÿ”น **Mcp**

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

๐Ÿค– Start the Capgo MCP (Model Context Protocol) server for AI agent integration.
This command starts an MCP server that exposes Capgo functionality as tools for AI agents.
The server communicates via stdio and is designed for non-interactive, programmatic use.
Available tools exposed via MCP:
- capgo_list_apps, capgo_add_app, capgo_update_app, capgo_delete_app
- capgo_upload_bundle, capgo_list_bundles, capgo_delete_bundle, capgo_cleanup_bundles
- capgo_list_channels, capgo_add_channel, capgo_update_channel, capgo_delete_channel
- capgo_get_current_bundle, capgo_check_compatibility
- capgo_list_organizations, capgo_add_organization
- capgo_get_account_id, capgo_doctor, capgo_get_stats
- capgo_request_build, capgo_generate_encryption_keys
Example usage with Claude Desktop:
Add to claude_desktop_config.json:
{
"mcpServers": {
"capgo": {
"command": "npx",
"args": ["@capgo/cli", "mcp"]
}
}
}

**Example:**

```bash
npx @capgo/cli mcp
```

## 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.