Creating a project

Installing the rebar3 build tool

Note: Gleam's tooling is very young and in a state of flux. Expect rough edges and breaking changes to come.

The Gleam compiler can build Gleam projects that are managed with the standard Erlang build tool, rebar3. If you don't have rebar3 installed please install it now and the rebar_gleam plugin.

Generating a project

Now a project can be generated using rebar3 like so:

rebar3 new gleam_lib my_fantastic_project
cd my_fantastic_project

You'll now have a project with this structure:

├── gleam.toml
├── rebar.config
├── src
│   ├──
│   └── my_fantastic_project.gleam
└── test
    └── my_fantastic_project_test.gleam

2 directories, 7 files

Here are some commonly used commands rebar3 commands that you can use with your new project:

# Run an interactive shell with your code loaded (Erlang syntax)
rebar3 shell

# Run the eunit tests
rebar3 eunit

More information can be found on the rebar3 documentation website.

What next?

Want to see some Gleam code? See the example projects.

Looking learn the language? Check out the language tour.

Need ideas for a project? We have a list of libraries that need writing.