Command line reference

The gleam command uses subcommands to access different parts of the functionality:


gleam new <name> [project-root]

Creates a folder with the necessary files for starting a new gleam project with the given name. The project-root defaults to the value of name.


gleam build

Builds the given gleam project.


gleam run [arguments]...

Run the project. Any arguments will be passed to the program.


gleam test [arguments]...

Run the project’s tests. Any arguments will be passed to the program.


gleam add <package>

Add a new dependency package to the project.


gleam shell

Run an Erlang shell with the project loaded.


gleam format [files]...

Formats all the gleam files in place in the provided directory tree. Defaults to the current directory.


gleam publish

Publish the package to the Hex package manager.

deps list

gleam deps list

List all the dependencies for the project.

deps download

gleam deps download

Download all the project dependency packages.

hex retire

gleam hex retire <package> <version> <reason> [message]

Retire an already published package version from the Hex package manager.

hex unretire

gleam hex unretire <package> <version>

Un-retire a retired Hex package.

docs build

gleam docs build

Builds the HTML documentation for the project.

docs publish

gleam docs publish

Publishes the project documentation to HexDocs.

docs remove

gleam docs remove

Removes a version of the published documentation from HexDocs.