Command-Line Interface
Here are some of the most common compiler commands.
-
glistix new: An essential command, creates a new Glistix project for you with batteries included, containing:- Several basic directories and files of the project structure expected by the compiler (see "Project structure");
- This includes an initial
gleam.tomltuned for Glistix-specific defaults.
- This includes an initial
- An initial
flake.nix(see "Import a Gleam package in Nix"); - An initial Git repository with a
.gitignorefile.
- Several basic directories and files of the project structure expected by the compiler (see "Project structure");
-
glistix build [--target nix]: Builds your project tobuild/dev/<target>, by default the target specified in yourgleam.tomlunless you specify--target <target>.- Note that, if no target is specified in your
gleam.toml, the compiler will default to theerlangtarget to be compatible with existing Gleam projects. As such, make sure to specifytarget = "nix"in yourgleam.toml.
- Note that, if no target is specified in your
-
glistix run [--target nix]: Runs your project's main function in the target specified either by--targetor bygleam.toml(orerlangby default, for the same reason as before).- For the Nix target, this will call
nix-instantiateto evaluate yourpackagename.gleam'smainfunction.
- For the Nix target, this will call
-
glistix test [--target nix]: Similar toglistix run, but runs the main function compiled fromtest/packagename_test.gleam. -
glistix format: Formats your Gleam code according to Gleam's standards. -
glistix clean: Deletes yourbuild/directory. Useful to get rid of stale package versions. -
glistix add name: Adds a Hex dependency to your project. -
glistix docs build: Builds documentation for your package tobuild/docs. -
glistix publish: Publishes your package to Hex.