shernova_cli
Command-line setup tool for Shernova Flutter integrations.
Automates the boring parts: detect your Flutter project, read the Android applicationId, extract the debug SHA256 fingerprint, add SDK dependencies, and generate lib/shernova_config.dart.
Quick Start
flutter create my_app
cd my_app
# Add the CLI (dev dependency)
dart pub add --dev shernova_cli:^2.0.0
# Run setup — adds shernova_core only by default
dart run shernova_cli setup --pk pk_test_YOUR_KEY --app-id YOUR_APP_UUID
Then wire Shernova.init(shernovaConfig) in your app (see shernova_core for API usage).
Optional UI: add --with-ui to also install shernova_ui, or run dart pub add shernova_ui:^2.0.0 later.
Commands
setup
dart run shernova_cli setup [options]
| Option | Description |
|---|---|
--pk |
Publishable key (pk_test_... or pk_live_...) |
--app-id |
App UUID from Shernova dashboard |
--api-url |
API base URL (default: https://api.shernova.com) |
--with-ui |
Also add optional shernova_ui to pubspec.yaml |
--force |
Overwrite existing lib/shernova_config.dart |
--skip-deps |
Do not modify pubspec.yaml |
What it does (step by step):
- Walks up from the current directory to find a Flutter
pubspec.yaml. - Reads the Dart package
name. - Parses
android/app/build.gradle(.kts)forapplicationId. - Runs
keytoolon~/.android/debug.keystoreto extract debug SHA256 (if available). - Adds
shernova_coretopubspec.yaml(andshernova_uiwhen--with-uiis set), unless--skip-deps. - Runs
flutter pub get. - Creates
lib/shernova_config.dartwithShernovaConfigready to pass toShernova.init(). - Prints a success/warning/error report.
verify
dart run shernova_cli verify
Checks that shernova_core dependency and lib/shernova_config.dart exist and flags placeholder values. shernova_ui is optional and not required for verify to pass.
Examples
Test setup with placeholders filled later:
dart run shernova_cli setup
Setup with optional UI:
dart run shernova_cli setup --pk pk_test_... --app-id ... --with-ui
Production keys:
dart run shernova_cli setup \
--pk pk_live_abc123 \
--app-id 550e8400-e29b-41d4-a716-446655440000
Re-generate config after changing signing key:
dart run shernova_cli setup --force
Validate before CI:
dart run shernova_cli verify
Generated config
lib/shernova_config.dart:
import 'package:shernova_core/shernova_core.dart';
ShernovaConfig get shernovaConfig => ShernovaConfig(
publishableKey: shernovaPublishableKey,
apiBaseUrl: shernovaApiBaseUrl,
appId: shernovaAppId,
packageName: shernovaPackageName,
sha256: shernovaSha256,
);
Register shernovaPackageName + shernovaSha256 in the Shernova dashboard before calling Shernova.init().
Requirements
- Flutter SDK 3.10+
- Android project with
android/app/build.gradleorbuild.gradle.kts keytoolon PATH (JDK) for automatic SHA256 extraction
Related packages
shernova_core— core headless SDK (required)shernova_ui— optional verification UIshernova_android_helpers— optional legacy Android auto-return