shernova_cli 2.0.0 copy "shernova_cli: ^2.0.0" to clipboard
shernova_cli: ^2.0.0 copied to clipboard

Shernova setup CLI for Flutter projects — detect Android app id, SHA256, and generate config.

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):

  1. Walks up from the current directory to find a Flutter pubspec.yaml.
  2. Reads the Dart package name.
  3. Parses android/app/build.gradle(.kts) for applicationId.
  4. Runs keytool on ~/.android/debug.keystore to extract debug SHA256 (if available).
  5. Adds shernova_core to pubspec.yaml (and shernova_ui when --with-ui is set), unless --skip-deps.
  6. Runs flutter pub get.
  7. Creates lib/shernova_config.dart with ShernovaConfig ready to pass to Shernova.init().
  8. 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.gradle or build.gradle.kts
  • keytool on PATH (JDK) for automatic SHA256 extraction
0
likes
135
points
234
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Shernova setup CLI for Flutter projects — detect Android app id, SHA256, and generate config.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

args, path

More

Packages that depend on shernova_cli