Skip to content

feat: Add flame create, the ignite_cli scaffolding as a flutter create style command - #4059

Merged
spydon merged 2 commits into
mainfrom
feat/flame-cli-create
Sep 30, 2026
Merged

spydon merged 2 commits into
mainfrom
feat/flame-cli-create

Conversation

@spydon

@spydon spydon commented Sep 26, 2026

Copy link
Copy Markdown
Member

Description

Stacked on #4057. This brings the scaffolding of ignite_cli
into flame_cli as flame create, structured like flutter create: no interactive prompts, a
positional output directory, sensible defaults and options to change them.

flame create my_game
cd my_game
flame run

How it works:

  • flutter create --empty generates the platform folders and the pubspec.yaml, with
    --project-name, --org, --description, --platforms and --overwrite passed through.
  • The files of the chosen template (--template simple|basics|example, basics by default) are
    written on top, plus an analysis_options.yaml that includes flame_lint.
  • flutter pub remove flutter_lints and flutter pub add flame dev:flame_lint [dev:flame_test] [--packages ...] set up the dependencies. Using pub add means the game always starts on the
    newest compatible versions, without a version list baked into the CLI or fetched from pub.dev
    the way ignite did. --flame-version ^1.30.0 pins a constraint when needed.
  • The project name defaults to the directory name and is validated with the same rules as
    flutter create (a lowercase Dart identifier that is not a keyword or a clashing package name),
    with a suggestion when it is invalid. An existing project is not touched without --overwrite.

The three templates are updated versions of ignite's:

  • simple: an empty FlameGame in a GameWidget.
  • basics: a world with a component that starts moving when tapped, and a FlameTester widget
    test for it.
  • example: a small complete game over a few files: a world, a camera with a score in the
    viewport, a player steered with the arrow keys or by tapping, stars to collect through
    collision detection, and four testWithGame tests.

The command shows up in a new "Creating a game" group at the top of flame --help.

Tests use a fake flutter process and check the exact command sequence, the written files, the
options, the overwrite guard, the validation and the failure path. I also created a game from each
template with the real flutter: all three pass flutter analyze, basics and example pass
flutter test, and the example runs under flame run on flutter-tester.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • [-] I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

@spydon
spydon added this pull request to stack #4058 September 28, 2026 12:35
@spydon
spydon force-pushed the feat/flame-cli-create branch 2 times, most recently from bbc7bd4 to db5a00b Compare September 30, 2026 13:05
@spydon
spydon force-pushed the feat/flame-cli-create branch 2 times, most recently from 1644605 to 84eaaed Compare September 30, 2026 13:14
@spydon
spydon force-pushed the feat/flame-cli-create branch from 84eaaed to 44d1295 Compare September 30, 2026 14:55
Base automatically changed from feat/flame-cli-input to main September 30, 2026 15:09
@spydon
spydon force-pushed the feat/flame-cli-create branch from 44d1295 to 1944e66 Compare September 30, 2026 15:09
…e style command

flame create runs flutter create, writes one of the simple, basics or example templates on top, swaps flutter_lints for flame_lint and adds the Flame packages with flutter pub add. It takes the same kind of options as flutter create and asks no questions.
flutter create runs with --no-pub since pub add resolves the packages anyway, --platforms accepts repeated values, the keyword list matches flutter create, the templates are formatter clean, and starting flutter and forwarding its output is shared between run and create.
@spydon
spydon force-pushed the feat/flame-cli-create branch from 1944e66 to 18198bc Compare September 30, 2026 15:11
@spydon
spydon merged commit fe9922e into main Sep 30, 2026
8 checks passed
@spydon
spydon deleted the feat/flame-cli-create branch September 30, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants