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.
ota-ns keygen --key-id prod-2026 --out-dir ~/.ota-keys| Flag | Required | Description |
|---|---|---|
--key-id <id> | No | Key identifier embedded in signatures and ota.config.json (defaults to ota-key-<year>). |
--out-dir <dir> | No | Target directory outside your app repo (defaults to ~/.ota-keys). |
--force | No | Overrides the guard that refuses writing keys inside src/, app/, App_Resources/ or platforms/. |
--json | No | Emit structured JSON output. |
ota-ns fingerprint
Computes a per-platform runtime compatibility fingerprint and optionally compares against a store-binary baseline.
ota-ns fingerprint --platform ios --project . \
--write-baseline ./ota.baseline.ios.json --write-config| Flag | Required | Description |
|---|---|---|
--platform <ios|android> | Yes | Target NativeScript platform. |
--project <dir> | No | NativeScript app root (defaults to process.cwd()). |
--bundle-dir <dir> | No | Explicit prepared bundle directory override. |
--baseline <path> | No | Compare against a saved baseline; exits 0 if compatible, 2 if native drift is detected. |
--write-baseline <path> | No | Write the computed fingerprint JSON to disk. |
--write-config | No | Update runtimeContract for this platform in <project>/ota.config.json. |
--json | No | Emit 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.
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-105Safety checks enforced automatically:
- Diffs current project against
--baselineand refuses on native drift unless--allow-driftis 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.jsonmainresolves to an existing entry (main,${main}.mjsor${main}.js).
| Flag | Required | Description |
|---|---|---|
--platform <ios|android> | Yes | Target platform. |
--release-id <id> | Yes | Unique immutable release identifier. |
--private-key <pem> | Yes | Path to Ed25519 PKCS8 private key PEM. |
--key-id <id> | Yes | Matching keyId configured in ota.config.json. |
--out <dir> | Yes | Output directory (manifest.json + files/). |
--project <dir> | No | NativeScript app root (auto-discovers prepared bundle + ota.config.json defaults). |
--bundle-dir <dir> | No | Explicit bundle directory override. |
--baseline <path> | No | Baseline fingerprint for drift enforcement and default targetBuild/runtimeContract. |
--app-id, --target-build, --runtime-contract | No | Explicit manifest metadata overrides. |
--allow-drift | No | Override 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.
ota-ns verify \
--bundle ./dist-ota/ota-105 \
--config ./ota.config.json \
--baseline ./ota.baseline.ios.jsonVerifies:
manifest.jsonschema and Ed25519 signature against--public-key(raw base64 or PEM) or--config.- Optional
--baseline,--app-id,--platform,--target-build,--runtime-contractassertions. - Exact 1:1 match between
manifest.filesand<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.