Dart CLI Run and compile Dart programs from the command line

This lesson is available for PRO members or as a single course purchase. Sign-in and choose a plan below.
Get Unlimited PRO Access

OR


*Enrollment provides full access to this course (and updates) for life.

Create a New Dart Project

Learn about the available commands and how to use them.

command line
dart --help

Create a new project.

command line
dart create -t console-simple my_app

# OR use the current directory (if it's empty)

dart create -t console-simple . --force

Run the application.

command line
dart run

Compile Dart Code

Compile dart code to an executable.

command line
dart compile exe bin/dart.dart
bin/dart.exe

Compile your code to JavaScript and run it with Node.js.

command line
dart compile js bin/dart.dart
node out.js

Q&A Chat