Sparkling CLI
Sparkling CLI (sparkling-app-cli) is the built-in command-line tool that powers the development workflow. It handles building Lynx bundles, autolinking native method modules, running apps on Android/iOS, and diagnosing your environment.
Installation
The CLI is included automatically when you scaffold a project with create-sparkling-app. You can also install it manually:
Once installed, run commands via npx sparkling or through the npm scripts defined in your project's package.json.
Commands
sparkling build
Build Lynx bundles using your project's app.config.ts.
By default, asset copying is skipped for faster iteration during development. Use --copy when you need the bundles inside the native projects (e.g. for a release build).
sparkling dev
Start the Rspeedy dev server for hot-reload development. Instead of rebuilding and copying bundles manually, the dev server serves bundles over HTTP so changes are reflected instantly.
The default port 5969 spells LYNX on a phone keypad (L=5, Y=9, N=6, X=9).
Port resolution priority is:
--portapp.config.tsdev.server.portapp.config.tslynxConfig.server.port5969
If you run sparkling dev --port <number>, the CLI writes it back to app.config.ts as dev.server.port.
Once the server is running, point your app to http://<your-ip>:5969/main.lynx.bundle (or whatever entry point you need). In the project template, DEBUG builds connect to the dev server automatically.
sparkling copy-assets
Copy compiled bundles into Android and iOS resource directories.
sparkling autolink
Discover Sparkling method modules for Android and iOS. The CLI scans for module.config.json files in the workspace and node_modules, then updates the native Sparkling method links and generates Sparkling registry files. Host apps also enable the Lynx library Autolink plugins, so non-method Lynx libraries that ship lynx.lib.json can be linked by the Lynx toolchain.
What it does:
- Android — Links Sparkling method Gradle projects and generates
SparklingAutolink.kt. Debug-tool packages are linked asdebugImplementation. - iOS — Links Sparkling method pods and generates
SparklingAutolink.swift. Debug-tool packages are linked in the debug target.
sparkling run:android
Build, autolink, and launch the Android debug build in one step.
This command will:
- Autolink method modules for Android
- Resolve the dev port from
app.config.tsand auto-start a dev server if needed - Auto-detect device type and inject host for template debug URL:
- emulator:
127.0.0.1(and autoadb reverse) - physical device: host LAN IPv4
- emulator:
- Build the Lynx bundle
- Run
gradlew assembleDebug - Install the APK on a connected device/emulator
- Launch the main activity
sparkling run:ios
Build, autolink, and launch the iOS simulator build in one step.
This command will:
- Pick a simulator (prefers a booted device; falls back to common names like iPhone 17 Pro)
- Resolve the dev port from
app.config.tsand auto-start a dev server if needed - Autolink method modules for iOS
- Run
pod install(unless--skip-pod-install) - Build the Lynx bundle
- Build, install, and launch the app on the simulator
You can also set the SPARKLING_IOS_SIMULATOR environment variable to specify a default simulator.
sparkling doctor
Verify that your development environment is properly set up.
The doctor command checks:
If any check fails, the output includes a hint on how to fix it.
Global Options
All commands support the following flag:
You can also set the SPARKLING_VERBOSE environment variable for the same effect.

