Reference Browse docs
On this page 5 sections

Reference

Command reference

Every command, its flags, and what each exit code means. User commands first, contributor gates after, one honest list with no stubs.

User commands

Find a command, copy its example, move on. These operate on an installed binary or on a locally built one (invoke by its local path when it is not on PATH). Exit codes for each command are in the exit matrix.

Command What it does Example
orbit build <file> Compile to a native executable (-O1; --release selects -O2) orbit build main.orb -o main
orbit run <file> Build and run it with inherited stdio (servers keep the terminal) orbit run main.orb
orbit start [file] Build into .orbit/ and run it; service mode with routes, program mode otherwise orbit start svc.orb --port 8080
orbit dev [file] Watch sources, rebuild and restart on change (drains on both hosts; the Windows ask is a named stop channel) orbit dev svc.orb
orbit stop Stop the service recorded in .orbit/start.pid (idempotent) orbit stop
orbit migrate <file> Apply the program’s migrations and exit. ORBIT_MIGRATE_DOWN=<version> rolls back to that version orbit migrate main.orb
orbit check <file> Parse, typecheck and verify the IR without emitting code orbit check main.orb
orbit fmt <file> Format a file (writes only on success) orbit fmt main.orb
orbit fmt --check <file|dir> List files that need formatting orbit fmt --check ./compiler
orbit doctor [dir] Project checks; read-only unless --fix orbit doctor ./examples
orbit frontend <file> Emit the typed IR (TIR) without building. The document goes to stdout unless -o names a file orbit frontend main.orb
orbit lextrace <file> Developer lexer trace; output is unstable by design orbit lextrace main.orb
orbit cluster ... Single-host multiprocess orchestration (up, status, drain, restart, down, logs) orbit cluster up --nodes 3 --port-base 8100
orbit lsp Language server on stdin/stdout: JSON-RPC 2.0 framing, diagnostics from orbit check started by the editor, not by hand
orbit --help / --version Help / compiler version (-h and -v also work) orbit --help
orbit (no arguments) Short help with next steps, exits 0 orbit

Two commands do more than the table fits:

  • orbit start builds to .orbit/<name>[.exe] (plus .orbit/data/ for the database and .orbit/logs/ for dev output), so the binary never lands next to your source. With no file argument it uses main.orb. --port N overrides the service port. With no --port the file’s port declaration is used, and with neither the default is 3000. start refuses to build while the recorded server is still alive and tells you to run orbit stop first.
  • orbit stop ends the service recorded in .orbit/start.pid, which a service binary writes at boot (only when .orbit/ exists) and removes on graceful shutdown. It asks for a drain first: SIGTERM on POSIX, a named stop channel on Windows. The channel’s name is the pid. The worker loop polls it after every select, so a stop is seen within the loop’s 1 s timeout. Stop escalates to kill after ~3 s. With no channel carrying that pid, Windows falls back to TerminateProcess. It is idempotent: nothing recorded, or a stale record from a killed server, exits 0 after cleanup.
  • orbit dev does the same in a watch loop. It polls a content hash every second over the entry file plus its transitive imports and rebuilds on change. It stops the old child gracefully first: SIGTERM drain on POSIX, a named stop channel on Windows. It escalates to kill after ~3 s. A failed rebuild keeps watching without a child. The child pid lives in .orbit/dev.pid, so the next dev reaps a stale child from Ctrl-C.

The exit matrix

One rule everywhere: 0 clean, 1 clean failure (findings, unreadable file, compile error, failed health), 2 usage (missing or invalid flags, unknown subcommand). The fuzzer accepts 0, 1, and 2. Pick a command to see its example and what each code means:

Example
orbit build main.orb -o main
ExitMeaning
0emitted
1unreadable input, parse/typecheck error, C write/compile failure
2missing input file, bad flags

Flags and output

Flags per command:

Command Flag Effect
build --release Compile the emitted unit at -O2 instead of the default -O1
build, run --backend=c|native Pick the code generator. The default is native when the compiler finds an r6 it can run, c otherwise
start, dev --port N Override the service port
build, run, check --quiet Less success chatter; errors always print
build, run, check --verbose Echoes the C compiler invocation on build and run, the input size on check
build, run, check --color always|never|auto Styled output; auto paints only on a live terminal and stays plain in pipes
fmt --quiet Single-file mode
fmt --verbose Scan totals with --check
doctor --fix Whitespace only: trailing whitespace and a missing final newline
doctor --quiet, --verbose --verbose shows the scan scope
doctor --format json Findings as a JSON array of {file, line, code, severity, message, fix} on stdout; exit codes unchanged
doctor --color always|never|auto Same as above
cluster up/down/drain/restart --quiet Errors only
cluster up, cluster restart --verbose Echoes spawned commands

R6 refuses every program that declares a route. orbit start, orbit dev and orbit cluster need --backend=c for routed programs. cluster always uses the C backend. A refusal by R6 is a compile error. There is no fallback to C.

The child program owns the terminal under run, so its output is never silenced.

Color rules:

  • One palette everywhere: red for errors, yellow for warnings and tips, green for success, cyan for codes and paths, bold for locations, dim for secondary text.
  • Color fires only on a live terminal. Piped and redirected output stays plain (byte-identical), as do CI logs.
  • NO_COLOR set or TERM=dumb always win. --color always forces styled output anywhere (for docs and snapshots) and --color never forces plain text.
  • The gradient printer the server banner used is deleted. The banner prints Admission control on in the shared palette.
  • orbit build prints Building <in> -> <out> first and wrote <out> in <N> ms last (both suppressed by --quiet).
  • orbit doctor closes text runs with a score box (N / 100 plus N issues across M/F files in Ts). It prints on live terminals only, so piped output stays plain.

Error cards

One format everywhere: fact, then fix, then an optional tip. Headers stay plain so a tired dev can act without decoding anything. What each source prints:

Source Where Shape
Compiler diagnostics (parse/typecheck/codegen) stderr error[code]: message + --> file:line:col + the source line with ^-- here + = help: hint
orbit doctor findings stdout, one line each file:line severity [D00X] message fix: action
Operational failures (orbit fmt, orbit cluster, unreadable files, failed spawns) stderr orbit <cmd>: fact.
Usage errors stderr Usage: ..., exit 2

--help prints the same usage text to stdout and exits 0. An unknown top-level command prints Unknown command: <cmd> to stderr and exits 2.

Contributor gates

For contributors and release maintainers, from the repository root (set ORBIT_CC or pass --cc when the C compiler is not auto-detected):

Command Purpose
python scripts/trust.py build --out <path> Build the compiler from the committed canonical C source
python scripts/trust.py build --check-stale Confirm the generated fixed point matches the committed canonical source
python scripts/trust.py verify --cc <compiler> Rebuild and verify the C seed and self-host chain
python scripts/trust.py verify --cc <compiler> --emit-fixed-point <path> Emit a compiler binary for local gates
python scripts/corpus_gates.py parity --cc <compiler> --compiler <path> Compare compiler output with committed parity goldens
python scripts/corpus_gates.py suite --cc <compiler> --compiler <path> Compile and execute the language behavior suite
python scripts/trust.py build --promote Promote an intentional compiler change to the canonical C artifact

A compiler change is not complete until the gates pass:

  • the self-hosted compiler converges;
  • the canonical C source is current when the change is intentional;
  • parity probes match their goldens;
  • the behavior suite passes;
  • fmt --check is clean on compiler, tests/suite, std, tests/std and examples, doctor is silent on tests/suite, and cli_probe passes;
  • the docs and examples reflect the supported behavior.

The install page walks the contributor path from zero. Next in the reading path: the standard library.

Type to search commands, errors, modules and concepts.