shernova_cli 1.0.0 copy "shernova_cli: ^1.0.0" to clipboard
shernova_cli: ^1.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

# Run setup
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 for API usage).

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)
--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 and shernova_ui to pubspec.yaml (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 dependencies and lib/shernova_config.dart exist and flags placeholder values.

Examples #

Sandbox setup with placeholders filled later:

dart run shernova_cli setup

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/shernova.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
0
points
234
downloads

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

unknown (license)

Dependencies

args, path

More

Packages that depend on shernova_cli