Command line reference
Getting things done in the terminal
Getting things done in the terminal
The gleam command uses subcommands to access different parts of the functionality:
addgleam add [OPTIONS] <PACKAGES>...
Add new project dependencies
| Option | Description |
|---|---|
--dev | Add the packages as dev-only dependencies |
buildgleam build [OPTIONS]
Build the project
| Option | Description |
|---|---|
-t, --target <TARGET> | The platform to target |
--warnings-as-errors | Emit compile time warnings as errors |
checkgleam check [OPTIONS]
Type check the project
| Option | Description |
|---|---|
-t, --target <TARGET> | The platform to target |
cleangleam clean
Clean build artifacts
depsgleam deps <SUBCOMMAND>
Work with dependency packages
deps downloadgleam deps download
Download all dependency packages
deps listgleam deps list
List all dependency packages
deps updategleam deps update
Update dependency packages to their latest versions
devgleam dev [OPTIONS] [ARGUMENTS]...
Run the project development entrypoint
| Option | Description |
|---|---|
--runtime <RUNTIME> | |
-t, --target <TARGET> | The platform to target |
docsgleam docs <SUBCOMMAND>
Render HTML documentation
docs buildgleam docs build [OPTIONS]
Render HTML docs locally
| Option | Description |
|---|---|
--open | Opens the docs in a browser after rendering |
docs publishgleam docs publish
Publish HTML docs to HexDocs
This command uses this environment variables:
docs removegleam docs remove --package <PACKAGE> --version <VERSION>
Remove HTML docs from HexDocs
This command uses this environment variables:
| Option | Description |
|---|---|
--package <PACKAGE> The name of the package | |
--version <VERSION> The version of the docs to remove |
exportgleam export <SUBCOMMAND>
Export something useful from the Gleam project
export erlang-shipmentgleam export erlang-shipment
Precompiled Erlang, suitable for deployment
export hex-tarballgleam export hex-tarball
The package bundled into a tarball, suitable for publishing to Hex
export javascript-preludegleam export javascript-prelude
The JavaScript prelude module
export package-interfacegleam 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 |
export typescript-preludegleam export typescript-prelude
The TypeScript prelude module
fixgleam fix
Rewrite deprecated Gleam code
formatgleam format [OPTIONS] [FILES]...
Format source code
| Option | Description |
|---|---|
--check | Check if inputs are formatted without changing them |
--stdin | Read source from STDIN |
helpgleam help [SUBCOMMAND]...
Print this message or the help of the given subcommand(s)
hexgleam hex <SUBCOMMAND>
Work with the Hex package manager
hex retiregleam hex retire <PACKAGE> <VERSION> <REASON> [MESSAGE]
Retire a release from Hex
This command uses this environment variables:
hex unretiregleam hex unretire <PACKAGE> <VERSION>
Un-retire a release from Hex
This command uses this environment variables:
lspgleam lsp
Run the language server, to be used by editors
newgleam 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: erlang] [possible values: erlang, javascript] |
publishgleam publish [OPTIONS]
Publish the project to the Hex package manager
This command uses this environment variables:
| Option | Description |
|---|---|
--replace | |
-y, --yes |
removegleam remove <PACKAGES>...
Remove project dependencies
rungleam run [OPTIONS] [ARGUMENTS]...
Run the project
| Option | Description |
|---|---|
-m, --module <MODULE> | The module to run |
--runtime <RUNTIME> | |
-t, --target <TARGET> | The platform to target |
shellgleam shell
Start an Erlang shell
testgleam test [OPTIONS] [ARGUMENTS]...
Run the project tests
| Option | Description |
|---|---|
--runtime <RUNTIME> | |
-t, --target <TARGET> | The platform to target |
updategleam update
Update dependency packages to their latest versions