init
Description
Section titled “Description”init performs a full project scaffold from stackchain.yaml (or defaults if missing).
dart run stackchain init [options]dart run stackchain:init [options]No subcommand is equivalent to init.
Options
Section titled “Options”| Option | Description |
|---|---|
--overwrite, -f |
Overwrite existing generated files |
--dry-run |
Preview actions without writing |
--verbose, -v |
Verbose logging |
--skip-analyze |
Skip analyze step in quality gate |
--path, -p |
Project root |
Pipeline
Section titled “Pipeline”- Detect Flutter app via
pubspec.yaml - Load / parse config (defaults if absent)
- Ensure feature directories
- Write templates: app, router, core, features, modules
- Merge pubspec dependencies
- Write default
stackchain.yamlif missing - Remove stock
test/widget_test.dart - Write
.stackchain/lock.yaml - Run quality gate
Overwrite policy
Section titled “Overwrite policy”Existing files are skipped unless --overwrite / -f is set. The stock counter main.dart may be force-replaced as part of baseline setup.
Examples
Section titled “Examples”dart run stackchain initdart run stackchain init --overwritedart run stackchain init --dry-run -vExpected output
Section titled “Expected output”You should see file write/skip logs, dependency merges, lockfile update, and a quality gate summary. On success, lib/app, lib/core, and lib/features exist and the app boots with configureDependencies + App.