BlyxDocumentation
Browse chapters
Documentation / Local toolchain

Create a project on disk

Move a program from the browser into a project, check the file and run it from a terminal.

Create a workspace

Choose a parent directory where you want to keep your work. This command creates a fresh directory named hello. Blyx refuses to create the project if that directory already exists, which helps protect existing work.

blyxc new hello

Find the entry point

The generated project contains Blyx.toml and src/main.blyx. The manifest records the project name, version and edition. The released CLI takes an explicit source file. Open hello/src/main.blyx in a text editor and find fn main().

Check, run and edit

From the same parent directory, run these commands in order. check parses the source. run executes it. The starter prints Hello, Blyx! Replace its print call with a calculation, save the file and run it again.

blyxc check hello/src/main.blyx
blyxc run hello/src/main.blyx

Keep paths consistent

If you change directory into hello, write src/main.blyx in subsequent commands. A file-not-found message is often a working-directory issue. The formatter rewrites the named file with normalized line endings.

blyxc fmt hello/src/main.blyx

Add a package to a native project

Clone a tagged Blyx library beside your entry file and import its public functions with use. The native runner and native build follow these local paths. The “Evaluate models with Blyx packages” chapter builds a working example. A Git submodule or a recorded commit keeps the dependency reproducible.

Practice

Make the starter print 21. Run a syntax check first and then execute the saved file.

Hint

In main, multiply 3 by 7 inside println!.

Worked solution

Use println!(3 * 7); and save. A successful check reports that the file parsed. The run command prints 21.