dart: The Dart command-line tool
The
dart
tool is the command-line interface to the
Dart SDK.
The tool is available no matter how you get the Dart SDK—whether
you download the Dart SDK explicitly
or download only the
Flutter SDK.
Usage example
#
Here's how you might use the
dart
tool
to create, analyze, test, and run an app:
$ dart create -t console my_app
$ cd my_app
$ dart analyze
$ dart test
$ dart run bin/my_app.dart
You can also run
pub
commands
using the
dart
tool:
$ dart pub get
$ dart pub outdated
$ dart pub upgrade
Available commands
#The following table shows which commands you can use with the dart
tool.
Command | Format of command | More information |
---|---|---|
analyze |
dart analyze [<DIRECTORY|DART_FILE>] |
Analyzes the project's Dart source code. Learn more. |
build |
dart build <APP_TYPE> |
Experimental
Builds a Dart app including native assets . Learn more. |
compile |
dart compile <FORMAT> |
Compiles Dart to various formats (native executable, JavaScript, WebAssembly).
Learn more. |
create |
dart create <DIRECTORY> |
Creates a new project. Learn more. |
devtools |
dart devtools |
Opens Dart DevTools, a suite of debugging and performance tools for Dart.
Learn more. |
doc |
dart doc <DIRECTORY> |
Generates API reference documentation. Learn more. |
fix |
dart fix <DIRECTORY|DART_FILE> |
Applies automated fixes to Dart source code. Learn more. |
format |
dart format <DIRECTORY|DART_FILE> |
Formats Dart source code. Learn more. |
info |
dart info |
Outputs Dart tooling diagnostic information. Learn more. |
pub |
dart pub <PUB_COMMAND> |
Works with packages. Replaces pub .Learn more. |
run |
dart run <DART_FILE> |
Runs a Dart program. Learn more. |
test |
dart test <DIRECTORY|DART_FILE> |
Runs tests in this package. Learn more. |
(none) | dart <DART_FILE> |
Runs a Dart program. Prefer dart run . |
Learn more
#
To get help with any of the commands, run
dart help <command>
.
You can also get details on
pub
commands.
$ dart help pub outdated
Unless stated otherwise, the documentation on this site reflects Dart 3.9.2. Page last updated on 2025-9-19. View source or report an issue.