CLI Quickstart

The hosted happy path is: create an app in the dashboard, paste its appId into capacitor.config.ts, run otakit login, then otakit upload --release.

Quick start

  1. Create an app in the OtaKit dashboard and copy its OtaKit appId.
  2. Add that appId to plugins.OtaKit in capacitor.config.ts.
  3. Log in: otakit login
  4. Build your web app.
  5. Upload and release: otakit upload --release

Project config

Project commands read from capacitor.config.*. The CLI uses:

// 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 track
      // channel: "staging"
    }
  }
};

export default config;

The CLI reads plugins.OtaKit.appId, optional channel, optional serverUrl, and webDir. CLI flags and environment variables can still override any of those values.

Auth and config

otakit login stores a token locally for the current server. For CI or agent workflows, you can skip local login and use environment variables instead.

# Local dev
otakit login

# CI / non-interactive
export OTAKIT_SECRET_KEY=otakit_sk_...
export OTAKIT_APP_ID=app_xxxxxxxx
export OTAKIT_BUILD_DIR=out

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 / OTAKIT_OUTPUT_DIR -> capacitor.config.* webDir
  • Release target: --release -> base stream, --release <channel> -> named channel
  • Upload version: --version -> OTAKIT_VERSION -> auto-generated version

Upload flow

Use one command depending on intent:

  • Upload only: otakit upload
  • Upload and release to the base stream: otakit upload --release
  • Upload and release to a specific channel: otakit upload --release beta

Command reference

otakit upload[path]

Upload a bundle. Optionally release immediately.

[path]Bundle directory. If omitted, uses OTAKIT_BUILD_DIR / OTAKIT_OUTPUT_DIR or capacitor.config.* webDir.
--app-id <id>App ID override.
--server <url>Server URL override.
--version <version>Version string. Otherwise OTAKIT_VERSION, then auto-generated.
--strict-versionRequire explicit or env-provided version.
--min-native-build <n>Minimum native build required for this update.
--release [channel]Release after upload (base stream if omitted).
otakit upload --release

otakit release[bundleId]

Release a bundle to the base stream or a named channel. If bundleId is omitted, releases the latest bundle.

--channel <channel>Target named channel. Omit it to use the base stream.
otakit release --channel production

otakit list

List uploaded bundles.

--limit <n>Max results. Defaults to 20.
otakit list --limit 20

otakit releases

Show release history across all streams or a specific target.

--channel <channel>Show only a named channel.
--baseShow only the base stream.
--limit <n>Max results. Defaults to 10.
otakit releases --base

otakit delete<bundleId>

Delete a bundle.

--forceSkip confirmation prompt.
otakit delete abc123 --force

otakit register

Create a new app and print the plugin snippet to paste into capacitor.config.ts.

--slug <slug>App slug (for example com.example.app).
--server <url>Server URL override.
--token <token>Access token or organization API key.
--secret-key <key>Alias for --token.
otakit register --slug com.example.myapp

otakit login

Sign in with email OTP and store a token locally.

--email <email>Email address. If omitted, prompts interactively.
--server <url>Server URL override.
--token-onlyPrint token to stdout only.
otakit login --email you@example.com

otakit whoami

Show current authenticated user and organization context.

--server <url>Server URL override.
otakit whoami

otakit logout

Remove stored token for a server.

--server <url>Server URL override.
otakit logout

otakit config resolve

Show effective CLI values and where they came from.

--app-id <id>App ID override.
--server <url>Server URL override.
--output-dir <path>Output directory override.
--channel <channel>Channel override.
--jsonPrint machine-readable JSON output.
otakit config resolve --json

otakit config validate

Validate the OtaKit-related values in capacitor.config.*.

--jsonPrint machine-readable JSON output.
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.appId to capacitor.config.ts, or pass --app-id.
  • Missing index.html: build your web app and verify webDir or the explicit upload path.
  • Need to create an app from automation: use otakit register --slug <slug>.