title | subtitle | layout |
---|---|---|
Command line reference |
Getting Gleam things done in the terminal |
page |
The gleam
command uses subcommands to access different parts of the functionality:
gleam add [OPTIONS] <PACKAGES>...
Add new project dependencies
Option | Description |
---|---|
--dev |
Add the packages as dev-only dependencies |
gleam build [OPTIONS]
Build the project
Option | Description |
---|---|
-t, --target <TARGET> |
The platform to target |
--warnings-as-errors |
Emit compile time warnings as errors |
gleam check [OPTIONS]
Type check the project
Option | Description |
---|---|
-t, --target <TARGET> |
The platform to target |
gleam clean
Clean build artifacts
gleam deps <SUBCOMMAND>
Work with dependency packages
gleam deps download
Download all dependency packages
gleam deps list
List all dependency packages
gleam deps update
Update dependency packages to their latest versions
gleam docs <SUBCOMMAND>
Render HTML documentation
gleam docs build [OPTIONS]
Render HTML docs locally
Option | Description |
---|---|
--open |
Opens the docs in a browser after rendering |
gleam docs publish
Publish HTML docs to HexDocs
This command uses this environment variables:
- HEXPM_USER: (optional) The Hex username to authenticate with.
- HEXPM_PASS: (optional) The Hex password to authenticate with.
gleam docs remove --package <PACKAGE> --version <VERSION>
Remove HTML docs from HexDocs
This command uses this environment variables:
- HEXPM_USER: (optional) The Hex username to authenticate with.
- HEXPM_PASS: (optional) The Hex password to authenticate with.
Option | Description |
---|---|
--package <PACKAGE> The name of the package |
|
--version <VERSION> The version of the docs to remove |
gleam export <SUBCOMMAND>
Export something useful from the Gleam project
gleam export erlang-shipment
Precompiled Erlang, suitable for deployment
gleam export hex-tarball
The package bundled into a tarball, suitable for publishing to Hex
gleam export javascript-prelude
The JavaScript prelude module
gleam export package-interface --out <OUTPUT>
Information on the modules, functions, and types in the project in JSON format
Option | Description |
---|---|
--out <OUTPUT> |
The path to write the JSON file to |
gleam export typescript-prelude
The TypeScript prelude module
gleam fix
Rewrite deprecated Gleam code
gleam format [OPTIONS] [FILES]...
Format source code
Option | Description |
---|---|
--check |
Check if inputs are formatted without changing them |
--stdin |
Read source from STDIN |
gleam help [SUBCOMMAND]...
Print this message or the help of the given subcommand(s)
gleam hex <SUBCOMMAND>
Work with the Hex package manager
gleam hex retire <PACKAGE> <VERSION> <REASON> [MESSAGE]
Retire a release from Hex
This command uses this environment variables:
- HEXPM_USER: (optional) The Hex username to authenticate with.
- HEXPM_PASS: (optional) The Hex password to authenticate with.
gleam hex unretire <PACKAGE> <VERSION>
Un-retire a release from Hex
This command uses this environment variables:
- HEXPM_USER: (optional) The Hex username to authenticate with.
- HEXPM_PASS: (optional) The Hex password to authenticate with.
gleam lsp
Run the language server, to be used by editors
gleam new [OPTIONS] <PROJECT_ROOT>
Create a new project
Option | Description |
---|---|
--name <NAME> |
Name of the project |
--skip-git |
Skip git initialization and creation of .gitignore, .git/* and .github/* files |
--skip-github |
Skip creation of .github/* files |
--template <TEMPLATE> |
[default: lib] [possible values: lib] |
gleam publish [OPTIONS]
Publish the project to the Hex package manager
This command uses this environment variables:
- HEXPM_USER: (optional) The Hex username to authenticate with.
- HEXPM_PASS: (optional) The Hex password to authenticate with.
Option | Description |
---|---|
--replace |
|
-y, --yes |
gleam remove <PACKAGES>...
Remove project dependencies
gleam run [OPTIONS] [ARGUMENTS]...
Run the project
Option | Description |
---|---|
-m, --module <MODULE> |
The module to run |
--runtime <RUNTIME> |
|
-t, --target <TARGET> |
The platform to target |
gleam shell
Start an Erlang shell
gleam test [OPTIONS] [ARGUMENTS]...
Run the project tests
Option | Description |
---|---|
--runtime <RUNTIME> |
|
-t, --target <TARGET> |
The platform to target |
gleam update
Update dependency packages to their latest versions