UNPKG

@capgo/cli

Version:
1,249 lines (914 loc) โ€ข 80.7 kB
# Capgo CLI <a href="https://capgo.app/"><img src="https://capgo.app/readme-banner.svg?repo=Cap-go/capgo" alt="Capgo - Instant updates for Capacitor" /></a> [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.com/invite/VnYRvBfgA6) <a href="https://discord.com/invite/VnYRvBfgA6"><img src="https://img.shields.io/discord/912707985829163099?color=%237289DA&label=Discord" alt="Discord"></a> [![npm](https://img.shields.io/npm/dm/@capgo/cli)](https://www.npmjs.com/package/@capgo/cli) [![GitHub latest commit](https://badgen.net/github/last-commit/Cap-go/capgo/main)](https://github.com/Cap-go/capgo/commit/) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Cap-go_capgo&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=Cap-go_capgo) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Cap-go_capgo&metric=bugs)](https://sonarcloud.io/summary/new_code?id=Cap-go_capgo) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Cap-go_capgo&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=Cap-go_capgo) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=Cap-go_capgo&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=Cap-go_capgo) <div align="center"> <h2><a href="https://capgo.app/?ref=cli_readme"> โžก๏ธ Get Instant updates for your App with Capgo</a></h2> <h2><a href="https://capgo.app/consulting/?ref=cli_readme"> Missing a feature? Weโ€™ll build it for you ๐Ÿ’ช</a></h2> </div> Command line tool to manage Capgo apps, bundles, channels, compatibility checks, and cloud builds from your terminal or CI. Open-source CLI for Capacitor live updates. ## Why Capgo CLI? Shipping live updates should not require clicking through a dashboard for every release. Capgo CLI solves this by: - **Fast setup** - Connect a Capacitor app to Capgo with one guided command - **CI-ready uploads** - Build your app, upload the web bundle, and assign it to a channel - **Compatibility checks** - Detect when a native release is required instead of an OTA update - **Channel control** - Promote bundles through production, beta, QA, or custom release tracks - **Cloud builds** - Save credentials locally and request iOS or Android builds from the CLI - **Automation** - Use the SDK or MCP server for scripts, agents, and release tooling Perfect for first-time setup, repeatable releases, native-vs-OTA decisions, and teams that want Capgo controlled from CI. ## Features - โ˜๏ธ Cloud / Self hosted Support: Use [Capgo Cloud](https://capgo.app/) or your own Supabase backend. - ๐Ÿš€ Guided Setup: Initialize a Capacitor app and verify live updates end to end. - ๐Ÿ“ฆ Bundle Management: Upload, list, delete, encrypt, decrypt, and clean bundles. - ๐Ÿ“บ Channel Support: Assign bundles to release channels and manage rollout tracks. - ๐Ÿงช Compatibility: Check native package compatibility before shipping OTA updates. - ๐Ÿ” **Delta Updates**: Upload changed files only when instant updates are enabled. - ๐Ÿ”’ **Security**: Support signed and encrypted bundles for sensitive apps. - ๐Ÿ“ฑ Device Runner: Launch iOS or Android devices and simulators from the CLI. - ๐Ÿ—๏ธ Cloud Builds: Request iOS and Android builds with locally stored credentials. - ๐Ÿค– MCP + SDK: Automate Capgo from AI agents, Node.js, or TypeScript scripts. - ๐Ÿ”‹ Supports Android and iOS - โšก๏ธ Capacitor 4/5/6/7/8 support through the Capgo updater ecosystem - ๐ŸŒ **Open Source Backend**: Self install [our backend](https://github.com/Cap-go/capgo) in your infra You have 3 ways possible: - Use [capgo.app](https://capgo.app) for a full featured live-update system with setup, upload, channels, rollback, stats, and cloud builds. - Use your own self-hosted backend with `--supa-host` and `--supa-anon` on supported commands. - Use the CLI programmatically through the SDK or MCP server for custom release automation. ## Quick Start Create your account in [capgo.app](https://capgo.app), get your [API key](https://console.capgo.app/dashboard/apikeys), and run: ```bash npx @capgo/cli@latest init YOUR_API_KEY com.example.app ``` For an app that is already configured, upload a new bundle with: ```bash npx @capgo/cli@latest bundle upload com.example.app --path ./dist --channel production ``` ## CI Upload Example ```bash npm ci npm run build npx @capgo/cli@latest bundle upload com.example.app \ --apikey "$CAPGO_API_KEY" \ --path ./dist \ --channel production \ --bundle "$GITHUB_SHA" \ --version-exists-ok ``` Add `--fail-on-incompatible` when CI must stop instead of uploading a bundle that cannot safely update the current native build. ## Documentation The most complete [documentation is here](https://capgo.app/docs/). - CLI guide: https://capgo.app/docs/cli/overview/ - Live updates setup: https://capgo.app/docs/plugin/cloud-mode/getting-started/ - Cloud build guides: https://capgo.app/docs/cli/cloud-build/ios/ and https://capgo.app/docs/cli/cloud-build/android/ ## Community Join the [discord](https://discord.gg/VnYRvBfgA6) to get help. <!-- AUTO-GENERATED-DOCS-START --> ## ๐Ÿ“‘ Capgo CLI Commands ## ๐Ÿ“‹ Table of Contents - ๐Ÿš€ [Init](#init) - ๐Ÿ“ฑ [Run](#run) - [Device](#run-device) - ๐Ÿ”น [Star](#star) - ๐Ÿ”น [Star-all](#star-all) - ๐Ÿ‘จโ€โš•๏ธ [Doctor](#doctor) - ๐Ÿ”‘ [Login](#login) - ๐Ÿ”น [Get-qr](#get-qr) - ๐Ÿ“ฆ [Bundle](#bundle) - [Upload](#bundle-upload) - [Compatibility](#bundle-compatibility) - [ReleaseType](#bundle-releaseType) - [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) - [Needed](#build-needed) - [Init](#build-init) - [Request](#build-request) - [Prescan](#build-prescan) - [Last-output](#build-last-output) - [Credentials](#build-credentials) - [Apple-key](#build-credentials-apple-key) - [Save](#build-credentials-save) - [List](#build-credentials-list) - [Clear](#build-credentials-clear) - [Update](#build-credentials-update) - [Manage](#build-credentials-manage) - [Migrate](#build-credentials-migrate) - ๐Ÿ”น [Probe](#probe) - ๐Ÿ”น [Generate-docs](#generate-docs) - ๐Ÿ”น [Mcp](#mcp) ## <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. Capgo bundles are web assets and can be fetched by anyone who knows the URL. Use encryption for banking, regulated, or other high-security apps. During the iOS run-on-device step, choose a physical iPhone/iPad or simulator. If you choose a physical device, the CLI lets you connect, unlock, and check again before it launches the app. **Example:** ```bash npx @capgo/cli@latest init YOUR_API_KEY com.example.app ``` ## <a id="options-init"></a> Options (Init) | 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) | | **--no-analytics** | <code>boolean</code> | Disable init analytics and terminal replay for this run | ## <a id="run"></a> ๐Ÿ“ฑ **Run** ๐Ÿ“ฑ Run Capacitor apps on devices from the CLI. ### <a id="run-device"></a> ๐Ÿ”น **Device** ```bash npx @capgo/cli@latest run device ``` ๐Ÿ“ฑ Run your Capacitor app on a connected device or simulator. If you omit the platform in an interactive terminal, the command asks whether to start on iOS or Android. The command lists available devices and simulators, lets you reload the list, and runs with your selection. For iOS, this asks whether to use a physical iPhone/iPad or simulator before showing devices. Use --no-launch to print the resolved command without starting the app. **Example:** ```bash npx @capgo/cli@latest run device ios --no-launch ``` **Options:** | Param | Type | Description | | -------------- | ------------- | -------------------- | | **--no-launch** | <code>boolean</code> | Resolve and print the run command without starting the app | ## <a id="star"></a> ๐Ÿ”น **Star** ```bash npx @capgo/cli@latest star ``` โญ Star a Capgo GitHub repository to support the project. If you do not pass a repository name, this defaults to capacitor-updater in the Cap-go org. ## <a id="star-all"></a> ๐Ÿ”น **Star-all** ```bash npx @capgo/cli@latest star-all ``` โญ Star all Capgo GitHub repositories with a small random delay between each request. If you do not pass repositories, this defaults to all Cap-go repositories whose name starts with `capacitor-`. ## <a id="options-star-all"></a> Options (Star-all) | Param | Type | Description | | -------------- | ------------- | -------------------- | | **--min-delay-ms** | <code>string</code> | Minimum delay in ms between each star action (default: 20) | | **--max-delay-ms** | <code>string</code> | Maximum delay in ms between each star action (default: 180) | | **--max-concurrency** | <code>string</code> | Maximum number of star requests running in parallel (default: 4) | ## <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-doctor"></a> Options (Doctor) | 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-login"></a> Options (Login) | 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="get-qr"></a> ๐Ÿ”น **Get-qr** ```bash npx @capgo/cli@latest get-qr ``` ๐Ÿ”ณ Print a terminal QR code for a bundle or channel preview. Preview must be enabled for the app. Examples: npx @capgo/cli@latest get-qr com.example.app --bundle 1.2.3 npx @capgo/cli@latest get-qr com.example.app --bundle 123 npx @capgo/cli@latest get-qr com.example.app --channel production npx @capgo/cli@latest get-qr com.example.app production --type channel ## <a id="options-get-qr"></a> Options (Get-qr) | Param | Type | Description | | -------------- | ------------- | -------------------- | | **-a** | <code>string</code> | API key to link to your account | | **--bundle** | <code>string</code> | Bundle name or id to preview | | **--channel** | <code>string</code> | Channel name or id to preview | | **--type** | <code>string</code> | Type for positional target | | **--png** | <code>string</code> | Write the preview QR code as a PNG image to the given file path | | **--url** | <code>boolean</code> | Print preview URLs only (web and deep link), without a terminal QR code | | **--web-url** | <code>boolean</code> | Encode the web preview URL in the QR code and PNG instead of the capgo:// deep link | | **--preview-env** | <code>string</code> | Preview web URL environment | | **--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,beta ``` **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. Use commas for multiple channels, for example production,beta | | **-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 | | **--fail-on-incompatible** | <code>boolean</code> | Fail the upload (exit non-zero) instead of uploading when the bundle is incompatible with the channel's current native packages. In an interactive terminal you can still choose a native build; declining fails. Cannot be combined with --ignore-metadata-check. | | **--ignore-checksum-check** | <code>boolean</code> | Ignores the checksum check when uploading | | **--force-crc32-checksum** | <code>boolean</code> | Force CRC32 checksum for upload (override auto-detection) | | **--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 delta updates (only changed files) for instant, super-fast updates instead of big zip downloads | | **--delta-only** | <code>boolean</code> | Upload only delta updates without full bundle for maximum speed (useful for large apps) | | **--no-delta** | <code>boolean</code> | Disable delta updates even if instant updates are enabled | | **--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: add the row in database without uploading files or updating channels (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) | | **--qr-preview** | <code>boolean</code> | Print a terminal QR code for this bundle preview after upload | | **--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) | | **--verbose** | <code>boolean</code> | Enable verbose output with detailed logging | ### <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-releaseType"></a> ๐Ÿ”น **ReleaseType** ```bash npx @capgo/cli@latest bundle releaseType ``` ๐Ÿงญ Print "native" or "OTA" based on compatibility with a channel's latest metadata. **Example:** ```bash npx @capgo/cli@latest bundle releaseType 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 compare against | | **--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>boolean</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>boolean</code> | Output in JSON | | **--package-json** | <code>string</code> | Paths to package.json files for monorepos (comma-separated) | ### <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 | | **--package-json** | <code>string</code> | Paths to package.json files for monorepos (comma-separated) | ### <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>boolean</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> | Local image file path (png, jpg, webp, svg) used as the app icon 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) | | **--expose-metadata** | <code>string</code> | Expose bundle metadata (link and comment) to the plugin (true/false, default: false) | | **--preview** | <code>boolean</code> | Enable bundle and channel preview QR codes for this app | | **--no-preview** | <code>boolean</code> | Disable bundle and channel preview QR codes for this app | | **--allow-device-custom-id** | <code>boolean</code> | Allow devices to set a custom device ID for this app | | **--no-allow-device-custom-id** | <code>boolean</code> | Disallow custom device IDs for this app | | **--block-provider-infra-requests** | <code>boolean</code> | Block provider infrastructure requests for this app | | **--no-block-provider-infra-requests** | <code>boolean</code> | Allow provider infrastructure requests for this app | | **--build-timeout-minutes** | <code>string</code> | Native build timeout in minutes (5-360, default: 15) | | **--ios-store-url** | <code>string</code> | iOS App Store URL for this app | | **--android-store-url** | <code>string</code> | Google Play Store URL for this app | | **--default-upload-channel** | <code>string</code> | Default upload channel name for this app | | **--default-download-channel** | <code>string</code> | Default download channel name for this app (sets channel public=true) | | **--disable-download-channels** | <code>boolean</code> | Disable Capgo download channels for this app (sets all channels public=false) | | **--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>boolean</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, 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** | <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 | | **--prod** | <code>boolean</code> | Allow sending update to production devices | | **--no-prod** | <code>boolean</code> | Disable sending update to production devices | | **--emulator** | <code>boolean</code> | Allow sending update to emulator devices | | **--no-emulator** | <code>boolean</code> | Disable sending update to emulator devices | | **--device** | <code>boolean</code> | Allow sending update to physical devices | | **--no-device** | <code>boolean</code> | Disable sending update to physical devices | | **--qr-preview** | <code>boolean</code> | Print a terminal QR code for this channel preview after updating it | | **--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>boolean</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>boolean</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="organization"></a> ๐Ÿ”น **Organization** ๐Ÿข Manage your organizations in Capgo Cloud for team collaboration and app management. ### <a id="organization-list"></a> ๐Ÿ“‹ **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** | <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="organization-add"></a> โž• **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** | <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="organization-members"></a> ๐Ÿ”น **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** | <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="organization-set"></a> โš™๏ธ **Set** **Alias:** `s` ```bash npx @capgo/cli@latest organization set ``` โš™๏ธ Update organization settings including name, email, security policies, and enforcement options. Security settings require super_admin role. **Example:** ```bash npx @capgo/cli@latest organization set ORG_ID --name "New Name" ``` **Options:** | Param | Type | Description | | -------------- | ------------- | -------------------- | | **-n** | <code>string</code> | Organization name | | **-e** | <code>string</code> | Management email for the organization | | **--enforce-2fa** | <code>boolean</code> | Enable 2FA enforcement for all organization members | | **--no-enforce-2fa** | <code>boolean</code> | Disable 2FA enforcement for organization | | **--password-policy** | <code>boolean</code> | Enable password policy enforcement for organization | | **--no-password-policy** | <code>boolean</code> | Disable password policy enforcement | | **--min-length** | <code>string</code> | Minimum password length (6-128, default: 10) | | **--require-uppercase** | <code>boolean</code> | Require uppercase letter in password | | **--no-require-uppercase** | <code>boolean</code> | Do not require uppercase letter | | **--require-number** | <code>boolean</code> | Require number in password | | **--no-require-number** | <code>boolean</code> | Do not require number | | **--require-special** | <code>boolean</code> | Require special character in password | | **--no-require-special** | <code>boolean</code> | Do not require special character | | **--require-apikey-expiration** | <code>boolean</code> | Require all API keys to have an expiration date | | **--no-require-apikey-expiration** | <code>boolean</code> | Do not require API key expiration | | **--max-apikey-expiration-days** | <code>string</code> | Maximum days before API key expiration (1-365, null for no limit) | | **--enforce-hashed-api-keys** | <code>boolean</code> | Enforce hashed/secure API keys (key value stored as hash, shown only once) | | **--no-enforce-hashed-api-keys** | <code>boolean</code> | Allow plain-text API keys | | **-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="organization-delete"></a> ๐Ÿ—‘๏ธ **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** | <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"></a> ๐Ÿ”น **Organisation** [DEPRECATED] Use "organization" instead. This command will be removed in a future version. ### <a id="organisation-list"></a> ๐Ÿ“‹ **List** **Alias:** `l` ```bash npx @capgo/cli@latest organisation list ``` [DEPRECATED] Use "organization list" instead. **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 ``` [DEPRECATED] Use "organization add" instead. **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 ``` [DEPRECATED] Use "organization set" instead. **Options:** | Param | Type | Description | | -------------- | ------------- | -------------------- | | **-n** | <code>string</code> | Organization name | | **-e** | <code>string</code> | Management email for the organization | | **--enforce-2fa** | <code>boolean</code> | Enable 2FA enforcement for all organization members | | **--no-enforce-2fa** | <code>boolean</code> | Disable 2FA enforcement for organization | | **--password-policy** | <code>boolean</code> | Enable password policy enforcement for organization | | **--no-password-policy** | <code>boolean</code> | Disable password policy enforcement | | **--min-length** | <code>string</code> | Minimum password length (6-128, default: 10) | | **--require-uppercase** | <code>boolean</code> | Require uppercase letter in password | | **--no-require-uppercase** | <code>boolean</code> | Do not require uppercase letter | | **--require-number** | <code>boolean</code> | Require number in password | | **--no-require-number** | <code>boolean</code> | Do not require number | | **--require-special** | <code>boolean</code> | Require special character in password | | **--no-requir