dart-build-cli-app
Skill by flutter
Guides building Dart command-line apps with patterns for entrypoints, exit codes, output streams, argument parsing and subprocess spawning. Built for developers writing CLI tools, console utilities and scripts.
Install dart-build-cli-app
Built from the published package, never by AI.
git clone --depth 1 https://github.com/flutter/agent-plugins /tmp/agent-plugins && mkdir -p ~/.claude/skills && cp -r /tmp/agent-plugins/skills/dart-build-cli-app ~/.claude/skills/dart-build-cli-appRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/flutter/agent-plugins /tmp/agent-plugins && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agent-plugins/skills/dart-build-cli-app ~/.gemini/antigravity-cli/skills/dart-build-cli-appAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill gives an AI assistant architectural guidance for building Dart command-line interface applications. It covers thin bin entrypoints with logic in lib/src, exit codes based on POSIX sysexits conventions, and routing data to stdout and diagnostics to stderr. It also covers argument parsing with package:args, pubspec executables, subprocess spawning, signal handling, testing, and compiling native binaries.
The guidance warns against calling exit() directly, since it can skip buffer flushing and finally blocks. It recommends package:cli_util for locating the Dart SDK inside AOT-compiled binaries and package:test_process for integration tests. The skill is for developers writing CLI tools, console utilities and scripts. It is not meant for Flutter UI widgets, web applications or standalone HTTP backend servers.
Written from the project's SKILL.md and checked against it.
What it can do
- Entrypoint structureKeeps bin files as thin trampolines and places commands and logic in lib/src.
- Exit codesMaps success and failure cases to POSIX sysexits codes such as 0, 64, 65, 70 and 78.
- Stream routingSends results to stdout and warnings and errors to stderr, with NO_COLOR and terminal checks.
- Argument parsingUses ArgParser, CommandRunner and typed accessors from package:args.
- Subprocess spawningExplains how to find the Dart SDK executable in AOT-compiled binaries using package:cli_util.
- Signal handlingCovers Windows SIGTERM guards, echo mode restoration, cursor visibility and socket cleanup.
- TestingDescribes in-memory unit tests and subprocess integration tests with test_process and test_descriptor.
- Pubspec executablesShows how to map command names to bin scripts under executables in pubspec.yaml.
- Compilation and distributionCovers dart run and dart install workflows for native CLI binaries.
What you need
- Dart SDK
Try asking
- Set up a Dart CLI with a thin bin entrypoint and logic in lib/src
- Which exit code should my Dart CLI return for a usage error?
- Write an integration test that runs my Dart CLI and checks its exit code
Good to know
- Not intended for Flutter UI widgets, web applications or standalone HTTP backend servers
- Sigterm watching is not available on Windows, so it must be guarded
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/dart-build-cli-app/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md14 KB -
examples/multi_command_runner.dart2 KB -
examples/single_command_tool.dart2 KB -
references/aot_sdk_discovery.md4 KB -
references/signals_and_terminal.md4 KB
Alternatives to dart-build-cli-app
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
dart-build-cli-app: common questions
Should a Dart CLI call exit() directly?
The skill advises against it during normal execution because exit() can drop unflushed output and skip finally blocks. It recommends setting exitCode or returning an integer from CommandRunner<int> instead.
Why not use Platform.resolvedExecutable to run the dart command?
In AOT-compiled binaries, resolvedExecutable points to the application itself, which can cause recursive self-invocation. The skill recommends package:cli_util to resolve the SDK executable.
Where should a Dart CLI put its cache files?
The skill says to store transient cache files in .dart_tool/<package_name>/ and never write persistent cache files to the project root.
How do I install dart-build-cli-app?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is dart-build-cli-app free?
The code is published under the BSD-3-Clause licence. The service it connects to may have its own pricing.
Is dart-build-cli-app safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to dart-build-cli-app?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
