stonly-sdk-cli
v0.9.4
Published
Stonly Mobile SDK CLI — detect your framework, install the SDK, and wire up your project
Downloads
22
Maintainers
Readme
stonly-sdk-cli
Stonly Mobile SDK CLI — detect your framework, install the SDK, and wire up your project.
Install
npx stonly-sdk-cli <command>
# or globally:
npm i -g stonly-sdk-cli
stonly-sdk-cli <command>The legacy stonly-setup binary is preserved as an alias for stonly-sdk-cli init.
Quick start
# 1. Detect the framework, install the SDK, and wire up the project
npx stonly-sdk-cli init
# 2. Verify the integration (and repair / update if needed)
stonly-sdk-cli doctor
stonly-sdk-cli doctor --fix
stonly-sdk-cli doctor --updateinit is fully interactive and never contacts the Stonly backend — you provide the
widgetId and URL scheme(s) by hand (find them in the Stonly dashboard).
Dirty working tree:
init,doctor --fix, anddoctor --updatemodify your source files. If the project's Git working tree has uncommitted changes, the CLI warns you and asks for confirmation (Y/n) before touching anything. Pass--yesto skip the prompt in non-interactive runs.
Supported targets
init detects your project automatically and lets you confirm or change the target:
| target | Platform |
|---|---|
| android-xml | Android — XML (Views) |
| android-compose | Android — Jetpack Compose |
| android-hybrid | Android — Hybrid (XML + Compose) |
| ios-uikit | iOS — UIKit |
| ios-swiftui | iOS — SwiftUI |
| react-native | React Native |
| flutter | Flutter |
Compose projects additionally get the navigation observer wired in:
StonlyNavigationObserver(navController) { Stonly.onScreenChanged(it) }Command reference
init
Detects the framework, installs the SDK dependency (CocoaPods / SPM / XcodeGen for iOS,
JitPack/Gradle for Android, npm/pub for cross-platform), wires up the widget id, URL
scheme (Info.plist / AndroidManifest.xml), and the deep-link handlers. Writes
.stonly/stonly.yaml.
| Flag | Purpose |
|---|---|
| -p, --path <dir> | Project path (skip prompt) |
| -w, --widget-id <uuid> | Widget ID (skip prompt) |
| -u, --url-scheme <scheme> | URL scheme (repeat for iOS + Android) |
| -t, --target <target> | Force a target, skip the detection prompt |
| --sentry <on\|off> | Allow SDK error reports to Stonly Sentry (skip prompt; default: on). off injects the platform opt-out call |
| -y, --yes | Auto-accept the detected target |
| -d, --dry-run | Preview changes without modifying files |
doctor
Health-checks the integration: project type, .stonly/stonly.yaml, SDK installed and on
the latest stable, URL scheme present, and the deep-link / widget wiring.
| Flag | Purpose |
|---|---|
| --fix | Repair missing SDK wiring using .stonly/stonly.yaml |
| --update | Bump the SDK coordinate to the latest stable version |
| -y, --yes | Skip the dirty-working-tree confirmation |
Directory layout
After stonly-sdk-cli init:
.stonly/
└── stonly.yaml # project config (widgetId, platforms, framework, target)Global flags
--cwd <path>— run in the given directory (default: current)--help, -h— show help--version, -v— show version--dry-run— preview without writing (supported byinit)
Development
npm install
npm test # run vitest
npm run build # produce dist/SDK version pinning
init pins the latest stable SDK release (JitPack for Android, GitHub Releases for iOS).
Override with STONLY_SDK_VERSION, STONLY_ANDROID_SDK_VERSION, or
STONLY_IOS_SDK_VERSION when network access is restricted.
