The dart create command creates a Dart project, using one of several supported templates. The same functionality is available in IDEs.

When you run dart create, it first creates a directory with the project files. Then it gets package dependencies (unless you specify the --no-pub flag).

Here's an example of using dart create to create a directory named my_cli that contains a simple console app (the default template):

$ dart create my_cli

To use a different template, such as web, add a template argument:

$ dart create -t web my_web_app

The following table shows the templates you can use:

cliA command-line application with basic argument parsing using package:args.
consoleA command-line application.
packageA package containing shared Dart libraries.
server-shelfA server built using shelf.
webA web app built using core Dart libraries.

These templates result in a file structure that follows package layout conventions.

If the specified directory already exists, dart create fails. You can force project generation with the --force flag:

$ dart create --force <DIRECTORY>

For further information on command-line options, use the --help flag:

$ dart create --help