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

Builds the given gleam project.

run

gleam run [arguments]...

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

test

gleam test [arguments]...

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

add

gleam add <package>

Add a new dependency package to the project.

shell

gleam shell

Run an Erlang shell with the project loaded.

check

gleam check

Verify the types of Gleam code without performing codegen.

clean

gleam clean

Remove build artifacts.

update

gleam update

Update dependency packages to their latest versions.

help

gleam help [subcommand]

Print help message or the help of the given subcommand(s).

format

gleam format [files]...

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

lsp

gleam lsp

Run the language server. Typically you would not run this command yourself, instead your text editor would call it for you as it can speak the language server protocol.

publish

gleam publish

Publish the package to the Hex package manager.

This command uses this environment variables:

deps

deps list

gleam deps list

List all the dependencies for the project.

deps download

gleam deps download

Download all the project dependency packages.

hex

hex retire

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

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

This command uses this environment variables:

hex unretire

gleam hex unretire <package> <version>

Un-retire a retired Hex package.

This command uses this environment variables:

docs

docs build

gleam docs build

Builds the HTML documentation for the project.

docs publish

gleam docs publish

Publishes the project documentation to HexDocs.

This command uses this environment variables:

docs remove

gleam docs remove

Removes a version of the published documentation from HexDocs.

This command uses this environment variables:

export erlang-shipment

gleam export erlang-shipment

Build a directory of precompiled Erlang bytecode and configuration, suitable for deployment.