Command line reference

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

new

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.

build

gleam build [project-root]

Builds the given gleam project. Defaults to the current directory.

Note: This does not download gleam packages. The best experience is to use rebar3 which will download any dependencies and in turn call gleam build as part of its build process. For more information see Running the project.

format

gleam format [files]...

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

docs

Contains all the documentation commands.

docs build

gleam docs build [project-root]

Builds the documentation for a gleam project. Defaults to the current directory.

docs publish

gleam docs publish [project-root]

Publishes the project documentation to HexDocs. Defaults to the current directory.

docs remove

gleam docs remove

Removes a version of the published documentation from HexDocs.

docs help

gleam docs help

Prints an overview of the gleam docs commands or the details of a specific command if a command name is given. For example: gleam docs help build.

help

gleam help

Prints an overview of the gleam commands or the details of a specific command if a command name is given. For example: gleam help format.