CLI Reference
Use the CLI to upload bundles, release them, inspect bundle and release history, and manage apps.
Quick start
- Create an app in the OtaKit dashboard and copy its
appId. - Add that
appIdtoplugins.OtaKitincapacitor.config.ts. - Log in:
otakit login - Build your web app.
- Ship it:
otakit upload --release
Project config
Project commands read from capacitor.config.*.
// capacitor.config.ts
import type { CapacitorConfig } from "@capacitor/cli";
const config: CapacitorConfig = {
appId: "com.example.myapp",
appName: "My App",
webDir: "out",
plugins: {
OtaKit: {
appId: "app_xxxxxxxx",
// Optional named channel:
// channel: "staging"
}
}
};
export default config;Authentication
For local development, sign in once and the CLI stores a token locally. For CI or non-interactive environments, use an organization secret key instead.
# Local development otakit login # CI / non-interactive export OTAKIT_SECRET_KEY=otakit_sk_... export OTAKIT_APP_ID=app_xxxxxxxx
Release flow
- Upload only:
otakit upload - Upload and release to the base channel:
otakit upload --release - Upload and release to a named channel:
otakit upload --release beta - Promote an existing bundle later:
otakit release <bundleId> --channel production
Resolution order
The CLI resolves values in a deterministic order.
- App ID:
--app-id->OTAKIT_APP_ID->capacitor.config.* - Server URL:
--server->OTAKIT_SERVER_URL->plugins.OtaKit.serverUrl-> hosted default - Auth token:
OTAKIT_TOKEN->OTAKIT_ACCESS_TOKEN-> stored login token ->OTAKIT_SECRET_KEY - Upload path: CLI path argument ->
OTAKIT_BUILD_DIR->capacitor.config.* webDir - Release channel:
--release-> base channel,--release <channel>-> named channel - Upload version:
--version->OTAKIT_VERSION-> auto-generated version
Command reference
otakit upload[path]
Upload a bundle. Optionally release it immediately.
otakit upload --release
otakit release[bundleId]
Release a bundle to the base channel or a named channel. If bundleId is omitted, releases the latest bundle.
otakit release --channel production
otakit list
List uploaded bundles.
otakit list --limit 20
otakit releases
Show release history across all streams or a specific target.
otakit releases --base
otakit delete<bundleId>
Delete a bundle.
otakit delete abc123 --force
otakit register
Create a new app and print the plugin snippet to paste into capacitor.config.ts.
otakit register --slug com.example.myapp
otakit login
Sign in with email OTP and store a token locally.
otakit login --email you@example.com
otakit whoami
Show current authenticated user and organization context.
otakit whoami
otakit logout
Remove stored token for a server.
otakit logout
otakit config resolve
Show effective CLI values and where they came from.
otakit config resolve --json
otakit config validate
Validate the OtaKit-related values in capacitor.config.*.
otakit config validate
otakit generate-signing-key
Generate an ES256 key pair for manifest signing.
otakit generate-signing-key
Troubleshooting
- Missing app ID: add
plugins.OtaKit.appIdtocapacitor.config.ts, or pass--app-id. - Missing
index.html: build your web app and verifywebDiror the explicit upload path. - Need to create an app from automation: use
otakit register --slug <slug>.