moose_cli 0.8.0
moose_cli: ^0.8.0 copied to clipboard
Moose CLI is a lightweight utility that reports the currently installed CLI version.
Moose CLI #
Moose CLI is a lightweight, globally installable tool that surfaces metadata about the Moose ecosystem and proxies common workflows (e.g., bootstrapping Moose starter templates via manifests) in an AI-friendly manner.
Install #
# Verify Flutter is on PATH (required because the CLI bootstraps Flutter projects)
# macOS/Linux:
flutter --version >/dev/null 2>&1
# Windows (PowerShell):
flutter --version > $null 2>&1
# If the command above fails, install Flutter first: https://docs.flutter.dev/get-started/install
dart pub global activate moose_cli
Once activated you can run the CLI from anywhere. The snippet below walks through the most common flows:
# Print the installed version
moose version
# Scaffold an empty Flutter project (no manifest needed)
moose init my_app
# Bootstrap from a named built-in template
moose init my_app --template shopify
# Bootstrap a Moose starter project using a manifest on disk
moose init my_app --manifest ./starter_manifest.json
# Or point to a remote manifest (GitHub raw, CDN, etc.)
moose init my_app --manifest https://raw.githubusercontent.com/greymooseinc/moose_templates/refs/heads/main/shopify.json
What happens during moose init? #
# verbose mode streams git output as repositories are cloned
moose init storefront --manifest ./manifests/shopify.json --verbose
- Manifest download – reads
shopify.jsonfrom disk or an HTTPS URL. - Base repo clone – clones the
base.repositoryintostorefront, strips.git, and prepares the project. - Extensions clone – pulls the
extensions.repository, copies the requested plugins/adapters intolib/pluginsandlib/adapters, and merges any dependency overrides. - Registration – updates
lib/main.dartby addingimportstatements and callingpluginRegistry.registerPlugin/adapterRegistry.registerAdapterusing the classes declared in each module’smoose.manifest.json. - Configuration – writes plugin/adapter
configblocks intoassets/config/environment.json. - Dependencies – merges module dependencies into
pubspec.yamland runsdart pub get.
When init finishes you’ll see a cd <project> hint, so you can immediately start building inside the new workspace.
Commands #
| Command | Description |
|---|---|
moose init <name> |
Scaffolds an empty Flutter project. |
moose init <name> --template <name> |
Scaffolds from a named built-in template (e.g. shopify). |
moose init <name> --manifest <path|url> |
Copies the manifest-defined template into the target directory. |
moose plugin add <name> (--git repo | --path dir) |
Installs a plugin from a git repo or local directory into lib/plugins/<name>. |
moose adapter add <name> (--git repo | --path dir) |
Installs an adapter from a git repo or local directory into lib/adapters/<name>. |
moose version |
Prints the currently installed CLI version. |
moose help <command> |
Prints detailed usage (flags, subcommands) for the selected command. |
# Add a plugin from a remote extensions repo
moose plugin add loyalty --git https://github.com/greymooseinc/moose_extensions.git
# Add an adapter from a local extensions checkout
moose adapter add stripe --path ./extensions/lib/adapters
Tips:
- Use
--template <name>for built-in templates; use--manifestfor a local file or custom URL. They are mutually exclusive.- Templates are defined by manifest JSON files. Use
--manifestto point to those manifests, either on disk or via an HTTPS URL.- Command output is color-coded with emoji markers so you can follow progress at a glance.
- Use
moose plugin addormoose adapter addto pull individual modules without re-runninginit.- If you omit
--gitwhen runningmoose plugin|adapter add, the CLI defaults tohttps://github.com/greymooseinc/moose_extensions.git.- The manifest must specify the base repository and optional extensions repository; git must be installed and available on PATH.
- When plugins or adapters are present in the manifest,
lib/main.dartis automatically updated to import and register them.- Plugin/adapter configs defined in manifests are merged into
assets/config/environment.jsonunder their respective sections.- Each plugin can ship its own
moose.manifest.jsondescribing required imports and dependencies. These dependencies are merged into your project'spubspec.yamlbeforedart pub getruns.dart pub getruns automatically after cloning the template and installing extensions so dependencies stay in sync.
Development #
dart test