Command Line Interface
Layman provides a unified CLI for managing projects, compiling code, and running tests.
Installation
Build the compiler from source:
# Clone the repository
git clone https://github.com/layman-lang/layman
cd layman
# Build the compiler
cargo build --release
# Or use make
make build-releaseCommand Reference
| Command | Description |
|---|---|
| layman init [name] | Initialize a new project |
| layman run [file] | Run a .lay file (or project entry point) |
| layman compile [file] | Compile a .lay file to an executable |
| layman test [dir] | Run all tests in a directory |
| layman install [pkg] | Install a package |
| layman graph | View dependency graph |
Usage Examples
Running Code
# Run the project in the current directory (looks for src/main.lay)
layman run
# Run a specific project directory
layman run my-project
# Run a specific file
layman run src/main.layCompiling Code
# Compile the project in the current directory
layman compile
# Compile a specific file
layman compile src/main.lay
# Compile with custom output name
layman compile src/main.lay --output my-appManaging Projects
# Initialize a new project in the current directory
layman init
# Initialize a new project in a new directory
layman init my-new-app
# Initialize with a custom name
layman init --name custom-pkg