···11+---
22+title: gleam-tool
33+description: helper command used in gleam2nix builds
44+---
55+66+<!--
77+SPDX-FileCopyrightText: 2025 Ruby Iris Juric <ruby@srxl.me>
88+99+SPDX-License-Identifier: 0BSD
1010+-->
1111+1212+:::danger
1313+this is an internal command used during nix builds, and is probably not meant to be used outside of them!
1414+:::
1515+1616+`gleam-tool` provides some functionality to generate some supporting files required by compiled gleam projects, that would otherwise be created through normal use of commands like `gleam build`.
1717+1818+## subcommands
1919+2020+### `appspec`
2121+2222+```shellsession
2323+$ gleam-tool appspec [out_path] [otp_dependencies]...
2424+```
2525+2626+generates an [application specification](https://www.erlang.org/doc/apps/kernel/app) for a gleam project.
2727+2828+- `out_path`: where to write the generated specification to
2929+- `otp_dependencies` (optional): space-separated list of otp applications name that the specification should declare a dependency on
3030+3131+### `entrypoint`
3232+3333+```shellsession
3434+$ gleam-tool entrypoint
3535+```
3636+3737+generates and compiles an erlang module used as the entrypoint for running applications built by [`buildGleamApplication`](../buildgleamapplication). the final compiled module is output to `gleam_entrypoint.beam` in the current directory.