Skip to content
THE OTA MANUALCLI & compatibility

CLI reference (ota-ns) ​

@getcortexlabs/ota-cli provides the ota-ns command for key generation, per-platform compatibility fingerprinting, Webpack release packaging, offline verification and local fault-injection testing.

All commands support --json for machine-readable CI output and --help for usage.

ota-ns keygen ​

Generates an Ed25519 PKCS8 private key (0600), SPKI public key PEM, and raw 32-byte base64 publicKeys snippet for ota.config.json.

sh
ota-ns keygen --key-id prod-2026 --out-dir ~/.ota-keys
FlagRequiredDescription
--key-id <id>NoKey identifier embedded in signatures and ota.config.json (defaults to ota-key-<year>).
--out-dir <dir>NoTarget directory outside your app repo (defaults to ~/.ota-keys).
--forceNoOverrides the guard that refuses writing keys inside src/, app/, App_Resources/ or platforms/.
--jsonNoEmit structured JSON output.

ota-ns fingerprint ​

Computes a per-platform runtime compatibility fingerprint and optionally compares against a store-binary baseline.

sh
ota-ns fingerprint --platform ios --project . \
  --write-baseline ./ota.baseline.ios.json --write-config
FlagRequiredDescription
--platform <ios|android>YesTarget NativeScript platform.
--project <dir>NoNativeScript app root (defaults to process.cwd()).
--bundle-dir <dir>NoExplicit prepared bundle directory override.
--baseline <path>NoCompare against a saved baseline; exits 0 if compatible, 2 if native drift is detected.
--write-baseline <path>NoWrite the computed fingerprint JSON to disk.
--write-configNoUpdate runtimeContract for this platform in <project>/ota.config.json.
--jsonNoEmit full JSON fingerprint (and diff when --baseline is set).

ota-ns pack ​

Packages a prepared NativeScript Webpack 5 release bundle into <out>/files/ and writes an Ed25519-signed <out>/manifest.json.

sh
ota-ns pack \
  --platform android \
  --project . \
  --baseline ./ota.baseline.android.json \
  --release-id ota-105 \
  --private-key ~/.ota-keys/prod-2026.private.pem \
  --key-id prod-2026 \
  --out ./dist-ota/ota-105

Safety checks enforced automatically:

  • Diffs current project against --baseline and refuses on native drift unless --allow-drift is explicitly set.
  • Rejects symbolic links anywhere inside the bundle directory.
  • Rejects compiled native binary artifacts (.dex, .jar, .aar, .so, .dylib, .apk, .aab, .ipa, .framework, .xcframework, AndroidManifest.xml, Info.plist, metadata-*.bin, treeNodeStream.dat).
  • Validates package.json main resolves to an existing entry (main, ${main}.mjs or ${main}.js).
FlagRequiredDescription
--platform <ios|android>YesTarget platform.
--release-id <id>YesUnique immutable release identifier.
--private-key <pem>YesPath to Ed25519 PKCS8 private key PEM.
--key-id <id>YesMatching keyId configured in ota.config.json.
--out <dir>YesOutput directory (manifest.json + files/).
--project <dir>NoNativeScript app root (auto-discovers prepared bundle + ota.config.json defaults).
--bundle-dir <dir>NoExplicit bundle directory override.
--baseline <path>NoBaseline fingerprint for drift enforcement and default targetBuild/runtimeContract.
--app-id, --target-build, --runtime-contractNoExplicit manifest metadata overrides.
--allow-driftNoOverride baseline drift refusal (use only when intentionally testing mismatched contracts).

ota-ns verify ​

Offline CI verification gate auditing signature, schema, baseline compatibility and every file on disk.

sh
ota-ns verify \
  --bundle ./dist-ota/ota-105 \
  --config ./ota.config.json \
  --baseline ./ota.baseline.ios.json

Verifies:

  • manifest.json schema and Ed25519 signature against --public-key (raw base64 or PEM) or --config.
  • Optional --baseline, --app-id, --platform, --target-build, --runtime-contract assertions.
  • Exact 1:1 match between manifest.files and <bundle>/files/ (exact byte sizes, exact SHA-256 digests, no symlinks, no missing files, no extra unmanifested files).

ota-ns serve ​

Starts the local HTTP/TLS fixture server for device and simulator testing. See Fault-injection server for full mode documentation.