CLI Commands

The Luma CLI is the primary way to interact with and execute your Luma programs. It supports compiling, running, debugging, and exploring your code easily from the command line.

luma [global options] command [command options]

Example

luma run app.luma

Available Commands

run

Run a .luma file directly.

luma run hello.luma

This command compiles the Luma source code to Go in-memory and immediately runs it.

tokens

Print all tokens (lexical elements) parsed from a .luma file.

Useful for debugging the lexer and syntax behavior.

luma tokens app.luma

compile

Compile a .luma file and print the equivalent Go code.

Useful for debugging the lexer and syntax behavior.

luma compile app.luma

build

Compile a .luma file into a standalone Go executable.

luma build app.luma -o app

This generates a main.go, compiles it with Go, and produces a binary (./app or ./app.exe).

repl

Start an interactive REPL session (Read-Eval-Print Loop) for quick experimentation:

luma repl

Type and execute code one line at a time. Great for testing expressions, types, or functions quickly.

help, h

Show a list of all available commands or help for a specific one:

luma help
luma help run

Example Workflow

luma compile app.luma   # See generated Go code
luma run app.luma       # Execute script directly
luma build app.luma     # Create Go binary for distribution
Last updated on