@zepto-labs/delta-cli
v1.0.0
Published
CLI to manage Delta releases
Readme
Ship the change. Not the bundle.
The next generation of runtime updates for React Native.
delta is a production-ready patch-based runtime update platform for React Native that enables you to ship bug fixes, performance improvements, and new features instantly—without waiting for App Store or Play Store approvals.
Unlike traditional OTA solutions that download and replace the entire JavaScript bundle, delta generates and applies lightweight binary patches, delivering only what changed. The result is dramatically smaller downloads, faster update adoption, lower bandwidth consumption, and a seamless update experience for your users.
Why delta?
Traditional OTA platforms replace the entire JavaScript bundle every time you publish an update—even if you've changed only a few lines of code.
Delta takes a fundamentally different approach.
Using intelligent binary delta patching, it computes the difference between releases and delivers only the bytes required to transform one version into another. This significantly reduces update sizes, accelerates deployments, and helps users stay on the latest version with minimal data usage.
What does the CLI do?
The delta-cli is the developer interface to the Delta ecosystem, streamlining the complete runtime update workflow from your terminal.
- 📦 Create Releases by packaging your React Native application for deployment.
- Δ Generate Binary Delta Patches between releases, ensuring users download only what has changed.
- 🚀 Publish Updates to your Delta Server with a single command.
- 🎯 Manage Deployments across environments, release channels, and native app versions.
- 🔄 Automate CI/CD Pipelines by integrating seamlessly with GitHub Actions, Bitrise, CircleCI, Codemagic, Azure DevOps, Jenkins, and other automation platforms.
- 📊 Manage Release Metadata including release versions, patch relationships, deployment history, and update information.
- 🔐 Securely Authenticate with your Delta Server and publish production-ready runtime updates.
Whether you're shipping a critical hotfix or your next major feature, Delta CLI provides a fast, reliable, and repeatable deployment experience.
Ship only the difference. Deliver updates that users barely notice—but always appreciate.
Related Repositories
This CLI is one part of the Delta platform. It works alongside:
| Repository | Description | | ---------------------------------------------------------------------- | --------------------------------------------------------------- | | react-native-delta | React Native SDK for receiving and applying OTA updates | | delta-server | Backend server for patch delivery, releases, and the update API |
Table of Contents
Prerequisites
- Node.js 18 or newer.
- AWS credentials configured (e.g. AWS CLI profile) with permission to invoke the Delta Lambda functions and access the Delta S3 bucket.
- For
**createBundleRelease**: a React Native project with Hermes enabled and platform-specific env variables set (see Environment Variables).
Installation
Using yarn:
yarn add -D @zepto-labs/delta-cliUsing npm:
npm install --save-dev @zepto-labs/delta-cliAfter installation, the CLI is available as delta-cli via yarn delta-cli, npx delta-cli, or directly if globally linked.
Configuration
The CLI requires a delta.config.json file in your project root. This file provides the AWS resource configuration needed by the CLI.
Note: The S3 bucket referenced below must either be publicly readable or fronted by a CDN for bundle download URLs to work at runtime.
{
"s3": {
"bucket": "your-delta-s3-bucket",
"region": "ap-south-1"
},
"lambda": {
"region": "ap-south-1",
"getLatestPatch": "delta-getLatestPatch",
"getReleaseList": "delta-getReleaseList",
"createRelease": "delta-createRelease",
"updateRelease": "delta-updateRelease",
"getRegistryList": "delta-getRegistryList",
"createRegistry": "delta-createRegistry",
"invalidateCache": "delta-invalidateCache"
}
}| Key | Description |
| ------------------------ | ----------------------------------------------------------- |
| s3.bucket | S3 bucket name for storing bundle and patch artifacts. |
| s3.region | AWS region of the S3 bucket. |
| lambda.region | AWS region where Lambda functions are deployed. |
| lambda.getLatestPatch | Lambda function name for fetching the latest patch version. |
| lambda.getReleaseList | Lambda function name for listing releases. |
| lambda.createRelease | Lambda function name for creating a release record. |
| lambda.updateRelease | Lambda function name for updating a release. |
| lambda.getRegistryList | Lambda function name for listing registered apps. |
| lambda.createRegistry | Lambda function name for registering a new app. |
| lambda.invalidateCache | Lambda function name for CDN cache invalidation. |
Usage
yarn delta-cli <command> [options]Each command accepts its own set of options (flags). All flags are passed after the command name.
Commands
createBundleRelease
Builds a production Hermes bytecode bundle from your React Native project, generates binary diff patches against previous releases, uploads all artifacts to S3, and registers a new release via the Delta API.
Options
| Option | Short | Type | Required | Description |
| ----------------- | ----- | ------- | -------- | --------------------------------------------------------------------------------------------- |
| --platform | | string | Yes | Target platform. Must be android or ios. |
| --entryFile | | string | Yes | Path to the React Native entry file (passed to react-native bundle --entry-file). |
| --pushToStaging | -P | boolean | No | If set, the release is created in staging state instead of the default created state. |
| --description | -m | string | No | A human-readable description stored alongside the release. |
Notes
**--entryFilevalue depends on your codebase.** If your project has separate entry files per platform (e.g.index.android.jsfor Android andindex.jsfor iOS), pass the one that matches--platform. If you have a singleindex.js, use that for both platforms.
Examples
# Android release (separate entry file)
yarn delta-cli createBundleRelease --platform android --entryFile index.android.js
# iOS release (shared entry file)
yarn delta-cli createBundleRelease --platform ios --entryFile index.js
# Push directly to staging
yarn delta-cli createBundleRelease --platform android --entryFile index.android.js -PupdateRelease
Modifies an existing release. Use this to change the rollout percentage, transition the release state (e.g. from staging to live), or mark a release as the default.
You must specify at least one of --rollout, --releaseState, or --defaultRelease.
Options
| Option | Short | Type | Required | Description |
| ------------------ | ----- | ------ | -------- | ---------------------------------------------------------------------------------------------------- |
| --platform | | string | Yes | Target platform (android or ios). Used to resolve appId from env if --appId is not provided. |
| --jsVersion | -j | number | Yes | The JS version of the release to update. |
| --bundleVersion | -b | number | Yes | The bundle version of the release to update. |
| --rollout | -r | number | No* | New rollout percentage (0-100). |
| --releaseState | -s | number | No* | New release state value. See Release States below. |
| --defaultRelease | -d | string | No* | Set to true or false to mark/unmark as the default release. |
| --appId | -a | string | No | Delta app id. Falls back to env variable for the given platform if omitted. |
At least one of
--rollout,--releaseState, or--defaultReleaseis required.
Release States
| Value | State | Description |
| ----- | -------- | ---------------------------------------------------------- |
| 0 | CREATED | Initial state when a release is first created. |
| 10 | STAGING | Only available to internal users for testing. |
| 20 | LIVE | Available to end users. |
| 30 | DISABLED | Disabled for updates; can be moved back to LIVE. |
| 40 | DELETED | Invalid or corrupted build; cannot be moved to LIVE again. |
Examples
# Set rollout to 100%
yarn delta-cli updateRelease --platform android -a my-app-id -j 1 -b 2 -r 100
# Move release to live state
yarn delta-cli updateRelease --platform ios -a my-app-id -j 3 -b 1 -s 20
# Mark as default release
yarn delta-cli updateRelease --platform android -a my-app-id -j 1 -b 5 -d truelistReleases
Fetches and displays all releases (and their patches) for a given app. Outputs a formatted table to the console.
Options
| Option | Short | Type | Required | Description |
| ------------- | ----- | ------ | -------- | ---------------------------------------- |
| --appId | -a | string | Yes* | Delta app id to list releases for. |
| --jsVersion | -j | number | No | Filter results to a specific JS version. |
If
--appIdis not provided, the CLI falls back to theDELTA_IDenvironment variable.
Examples
# List all releases for an app
yarn delta-cli listReleases -a my-app-id
# Filter by JS version
yarn delta-cli listReleases -a my-app-id -j 2listRegistries
Fetches and displays all registered apps in a formatted table. No options are required.
Options
None.
Examples
yarn delta-cli listRegistriescreateRegistry
Registers a new app with Delta. Each app is identified by a unique id, a display name, and a platform.
Options
| Option | Short | Type | Required | Description |
| ------------ | ----- | ------ | -------- | ------------------------------------------------------------- |
| --appId | -a | string | Yes | Unique identifier for the new app. |
| --appName | | string | Yes | Human-readable display name for the app. |
| --platform | | string | Yes | Platform this registry entry represents (android or ios). |
Examples
yarn delta-cli createRegistry -a my-app-id --appName "My App" --platform android
yarn delta-cli createRegistry -a my-app-id-ios --appName "My App iOS" --platform iosinvalidateCache
Triggers a CDN / cache invalidation for the specified cache type. Useful after publishing a release to ensure clients fetch fresh data immediately.
Options
| Option | Short | Type | Required | Description |
| ------------- | ----- | ------ | -------- | -------------------------------------------- |
| --cacheType | | string | Yes | Which cache to invalidate. See values below. |
--cacheType values
| Value | Description |
| -------------- | -------------------------------------------------------------------------------- |
| ALL | Invalidates all supported caches at once. |
| CHECK_UPDATE | Invalidates the check-update endpoint cache (clients checking for new releases). |
| GET_REGISTRY | Invalidates the registry endpoint cache. |
| RELEASE_LIST | Invalidates the release-list endpoint cache. |
Examples
# Invalidate everything
yarn delta-cli invalidateCache --cacheType ALL
# Only invalidate the update-check cache
yarn delta-cli invalidateCache --cacheType CHECK_UPDATEContributing
See CONTRIBUTING.md for development setup, coding conventions, and how to submit changes.
Security
See SECURITY.md for how to report vulnerabilities.
Third-Party Licenses
This project depends on the following third-party packages. See each package's license for terms and conditions.
| Package | Version | License | License Changed? | | ------------------------------------------------------------------------------ | -------- | ----------------------------------------------------------------------------- | ---------------- | | @aws-sdk/client-lambda | 3.967.0 | Apache-2.0 | No | | @aws-sdk/client-s3 | 3.967.0 | Apache-2.0 | No | | @types/adm-zip | ^0.5.5 | MIT | No | | @types/node | ^20.12.7 | MIT | No | | adm-zip | ^0.5.12 | MIT | No | | bsdiff-node | ^2.5.0 | MIT | No | | chalk | ^4.1.2 | MIT | No | | dotenv | 16.4.5 | BSD-2-Clause | No | | lint-staged | 15.2.2 | MIT | No | | prettier | 3.2.5 | MIT | No | | typescript | 5.2.2 | Apache-2.0 | No |
