Guides/Get started in one minute

Get started in one minute

New

dart_tui create asks three questions and writes a starter project that runs, passes dart analyze and has tests. Pick a script, a CLI with commands, or a full-screen app.

get started in one minute · dart_tui
Get started in one minute demo

Install and create

bash
dart pub global activate dart_tui && dart_tui create

If your shell cannot find dart_tui, add pub's bin directory to your PATH (dart pub global activate prints it). The wizard asks for the project name, the starter and whether to run git init. Then it writes the files, runs dart pub get and prints the next steps:

bash
cd my_app
dart run
dart test

The starters

StarterWhat you getRun it
scriptOne file in bin/ that asks with Logger prompts and prints a result. Its test answers the prompts with TuiTester.dart run
cliA CliRunner app with two commands in one category, a progress line, styled --help, --plain, --no-color and shell completions. Its tests check the help and run a command.dart run my_app --help
appA full-screen Program: a checklist with a help bar and quit keys. Its tests press keys with TuiTester and read the screen.dart run

Each starter has a pubspec.yaml that depends on dart_tui, analysis_options.yaml with package:lints, a .gitignore and a short README. It needs the same Dart SDK as dart_tui: 3.5 or later.

Without questions (CI and agents)

Give the directory and --template, and nothing is asked:

bash
dart_tui create my_app --template app
dart_tui create tools --template cli --name my_tool --no-git --no-pub-get
FlagMeaning
-t, --templatescript, cli or app.
--nameThe package name. The default is made from the directory name (My-App becomes my_app).
--[no-]gitRun git init (default on).
--[no-]pub-getRun dart pub get (default on).
--forceWrite into a directory that is not empty.
--plainNever show the terminal UI.

In a pipe, in CI or with --plain, it never prompts. A missing directory or --template then exits with code 64 and names what is missing.

Safety

The name must be a valid Dart package name, not a reserved word and not dart_tui. A directory that is not empty is refused (exit 73) unless you pass --force. Even then nothing is deleted: the starter's files are added or overwritten, and each one is listed. When dart pub get or git init fails, the files stay, the command's output and the command to run again are printed, and the exit code is 1.

Next: the MVU architecture, building a CLI with commands and testing.