Reference · 05

CLI Commands

Complete command-line reference for the ochre binary — run, build, check, fmt, test, init, disasm, lsp, repl, and upgrade.

All Ochre tools live inside a single executable (ochre). Check your installed version with ochre --version.

Running Programs

# Shorthand execution with optional script arguments
ochre app.och
ochre app.och arg1 arg2 --flag

# Explicit subcommand (use `--` to forward hyphenated flags cleanly)
ochre run app.och -- arg1 arg2 --flag

Every argument after <file.och> (or --) is forwarded to args() inside the script.

Complete Subcommand Reference

CommandFlagsDescription
ochre <file.och> [args...]—Type-check and execute a file on the bytecode VM
ochre run <file.och> [-- args...]—Explicit run subcommand with argument forwarding
ochre build <file.och>-o <path>, --emit-objCompile supported programs to native machine code via Cranelift AOT
ochre check <file.och>—Parse and type-check without executing
ochre fmt <file.och>-w / --write, --checkCanonical formatter preserving comments, raw strings, and precedence
ochre test [path]—Discover and run all zero-arg fn test_*() tests (default: .)
ochre init [name]—Scaffold ochre.toml and src/main.och
ochre disasm <file.och>—Print compiled bytecode instructions for every chunk
ochre lsp—Start the Language Server Protocol server over stdio
ochre repl—Launch the interactive REPL (default when invoked with no arguments)
ochre upgrade—Download and verify the latest GitHub release via the official installer

Installer Environment Variables

Both install.sh and install.ps1 honor these environment variables:

VariableDefaultPurpose
OCHRE_VERSIONlatestPin an exact release tag (e.g., v0.1.0-alpha.4)
OCHRE_INSTALL_DIR~/.local/bin (Unix) / %USERPROFILE%\.ochre\bin (Win)Override installation directory
OCHRE_REPOochre-sh/ochreOverride GitHub repository
OCHRE_RELEASE_BASE_URLGitHub Releases URLOverride download mirror (still verifies SHA256SUMS.txt)