pub enum Commands {
Show 31 variants
New {
name: String,
web: bool,
site: bool,
},
Init {
name: Option<String>,
},
Build {
release: bool,
verify: bool,
lib: bool,
target: Option<String>,
native_functions: bool,
emit: Option<String>,
json: bool,
manifest: bool,
static: bool,
},
Verify {},
Run {
release: bool,
interpret: bool,
emit: Option<String>,
engine: Option<RunEngine>,
max_steps: Option<u64>,
timeout: Option<String>,
seed: Option<u64>,
json: bool,
args: Vec<String>,
},
Serve {
timeout: Option<String>,
seed: Option<u64>,
watch: bool,
open: bool,
host: Option<String>,
port: Option<u16>,
as_backend: bool,
args: Vec<String>,
},
Check {
file: Option<PathBuf>,
kernel: bool,
deep: bool,
json: bool,
},
Opts {
file: PathBuf,
json: bool,
jit: bool,
args: Vec<String>,
},
Publish {
registry: Option<String>,
dry_run: bool,
allow_dirty: bool,
},
Login {
registry: Option<String>,
token: Option<String>,
},
Logout {
registry: Option<String>,
},
Doctor {
registry: Option<String>,
},
Repl {
logic: bool,
format: Option<LogicFormat>,
load: Option<PathBuf>,
},
Sat {
file: PathBuf,
proof: Option<PathBuf>,
stats: bool,
},
Prove {
file: Option<PathBuf>,
kernel: bool,
trace: bool,
json: bool,
certificate: bool,
},
Logic {
sentence: Option<String>,
file: Option<PathBuf>,
format: LogicFormat,
all_readings: bool,
pragmatic: bool,
discourse: bool,
},
Doc {
out: Option<PathBuf>,
},
Add {
spec: String,
path: Option<String>,
git: Option<String>,
},
Remove {
name: String,
},
Fmt {
paths: Vec<PathBuf>,
check: bool,
json: bool,
},
Emit {
target: EmitTarget,
file: Option<PathBuf>,
output: Option<PathBuf>,
chip: Option<String>,
format: Option<RduFormat>,
bridge: Option<String>,
model: Option<String>,
ctx: Option<usize>,
batch: Option<String>,
tp: Option<String>,
prefill: Option<usize>,
},
Bringup {
checkpoint: PathBuf,
targets: Vec<String>,
ctx: usize,
output: PathBuf,
run: bool,
tokens: Option<usize>,
prompt: Vec<u32>,
golden: Option<PathBuf>,
prompts: Option<String>,
},
Expand {
file: PathBuf,
},
Clean {
all: bool,
},
Completions {
shell: Shell,
},
Replay {
file: PathBuf,
verify: bool,
},
Explain {
topic: String,
json: bool,
},
Mcp {
worker: Option<String>,
worker_args: Vec<String>,
},
Test {
filter: Option<String>,
seed: u64,
format: String,
json: bool,
live: bool,
prove: bool,
tiers: Option<String>,
browser: bool,
},
Dap {},
Lean {
args: Vec<OsString>,
},
}Expand description
Available CLI subcommands.
Each variant is one operation largo can perform, and largo --help lists every one.
They span project management, building and running, the package registry, logic and
proof (such as logic and prove), and interactive, editor and agent tooling (such as
repl, dap and mcp). A sample from the first three groups:
§Project Management
§Build & Run
Build- Compile the projectRun- Build and executeCheck- Type-check without buildingVerify- Run Z3 static verification
§Package Registry
Variants§
New
Create a new LOGOS project in a new directory.
Scaffolds a complete project structure including:
Largo.tomlmanifest filesrc/main.lgentry point with a “Hello, world!” example.gitignoreconfigured for LOGOS projects
§Example
largo new my_project
cd my_project
largo runFields
Init
Initialize a LOGOS project in the current directory.
Similar to New but works in an existing directory.
Creates the manifest and source structure without creating a new folder.
§Example
mkdir my_project && cd my_project
largo initBuild
Build the current project.
A program or a backend: compiles the LOGOS source to Rust, then invokes
cargo build on the generated code; the binary is published at
target/debug/<name> or target/release/<name>. A full-stack site’s
binary carries its pages and assets inside it. A site (pages, no Serve
backend) has no program to compile, so it is exported to dist/ — the
same as --static.
§Verification
When --verify is passed, the build process includes Z3 static
verification of logical constraints. This requires the verification
feature enabled at build time (the full build).
§Example
largo build # Debug build
largo build --release # Release build with optimizations
largo build --verify # Build with Z3 verificationFields
lib: boolBuild as a library instead of an executable.
Generates lib.rs with crate-type = ["cdylib"] instead of a binary.
target: Option<String>Target triple for cross-compilation. Use “wasm” as shorthand for “wasm32-unknown-unknown”.
native_functions: boolPre-build every is exported for native function into the AOT-native
tier bundle (a cached cdylib per function) under .logos-native/.
emit: Option<String>Emit target: c, c-bytecode, wasm, wasm-linked, isa or riscv.
c and c-bytecode build native executables from the optimized AST and bytecode respectively.
wasm compiles the project straight to a
self-contained .wasm module via the built-in backend (no rustc, cargo or wasm-bindgen),
written to target/<name>.wasm beside a Node.js host shim. wasm-linked additionally links the
real logicaffeine_base::BigInt runtime (via rust-lld) so overflowing integer arithmetic
computes the exact big number instead of wrapping; it needs the Rust toolchain and a wasm32
base build. isa writes LOGOS Silicon ISA assembly beside the entry as <entry>.isa.
riscv (also risc-v) writes RV64GC assembly beside the entry as <entry>.s, with the
logos_rt.c runtime shim next to it. Omit for the default rustc-based Rust build.
json: boolPrint one logos-check/1 JSON envelope on stdout: a parse error
reports as a structured diagnostic, a cargo failure as one
build-failure diagnostic carrying the raw output.
manifest: boolPrint the machine-readable build manifest (JSON) instead of building:
the local package identity, feature selection, the resolved
path/git dependencies, and the transitive closure (every linked
.lg file tagged with its source dependency). No cargo/rustc runs.
static: boolExport the site to dist/ as plain files instead of building a binary —
pre-rendered HTML, the content-addressed module and shim, static/**,
robots.txt, sitemap.xml and a _headers file carrying the same cache
rules the binary sends. Deployable to any static host (Pages, Netlify,
Cloudflare, S3). No cargo, no rustc, and no backend required. What a
plain largo build does for a site; ask for it on a full-stack site to
export its pages without the backend.
Verify
Run Z3 static verification without building.
Performs formal verification of logical constraints in the project using the Z3 SMT solver. This catches logical errors that would be impossible to detect through testing alone.
Needs the full build (the verification feature).
§Example
largo verifyRun
Build and run the current project.
Equivalent to largo build followed by executing the resulting binary.
The exit code of the built program is propagated.
With --interpret, skips the Rust build and runs the program in-process on the
bytecode VM, with JIT tier-up on x86-64 Linux and macOS, for fast feedback during
development. A concurrent or asynchronous program, or a construct the VM compiler
does not take, runs on the tree-walking interpreter instead.
§Example
largo run # Debug mode (compile to Rust)
largo run --release # Release mode
largo run --interpret # Run in-process on the VM (no Rust build)Fields
interpret: boolRun in-process on the bytecode VM (JIT where available) instead of building Rust. Gives fast feedback but lacks full compiled-Rust performance.
emit: Option<String>wasm compiles straight to a .wasm (built-in backend, no rustc) and runs it via the
emitted host shim (node). wasm-linked links the real BigInt runtime first (exact
arbitrary-precision integers; needs the Rust toolchain). Compile-and-run in one step.
max_steps: Option<u64>Stop after the engine executes N steps (--interpret only) —
deterministic, the same op on every run. Exhaustion exits 122 with the
partial output delivered.
timeout: Option<String>Kill the run after this wall clock (500ms, 10s, 2m).
Expiry exits 124 (the GNU timeout convention).
seed: Option<u64>Scheduler seed for deterministic concurrent runs (sets LOGOS_SEED for this run and any compiled child).
Serve
Serve the project over HTTP.
What is served is decided from the project itself. A SITE — pages/ or
static/ and no Serve backend — gets the dev server: largo owns the
public port, serves the built pages and assets with hot reload, and
answers anything else 404 as a static host would. A FULL-STACK site adds
its Serve backend as a child on LOGOS_PORT, proxied for everything the
pages do not answer. A BACKEND — a Serve program alone — is interpreted
directly and binds its own port. Any other program is built to
WebAssembly and served as a bundle.
§Example
largo serveFields
watch: boolServe a program’s WebAssembly bundle, rebuilding and live-reloading the browser on every source save. (A site always watches.)
host: Option<String>Bind address for a site. Default 127.0.0.1 (this machine only);
pass 0.0.0.0 to serve the whole local network, so a phone or a
tablet on the same wifi can open the site.
port: Option<u16>The public port for a site or a bundle (falls forward to the next free port if taken). Default 8080.
Check
Check the project for errors without producing a binary.
Parses and type-checks the LOGOS source without invoking the full build pipeline. Useful for quick validation during development.
§Example
largo checkFields
file: Option<PathBuf>A LOGOS kernel-vernacular document to check (with --kernel)
instead of the project.
kernel: boolCheck FILE as a LOGOS kernel-vernacular literate document through
the kernel’s own document door (Repl::execute_document): every
block, in order, stopping at the first that does not check.
Opts
Report which optimizations actually fire when compiling a LOGOS file.
Compiles the file on the AOT, run-path, and VM-compile paths with the firing trace on, and lists the optimizations that genuinely changed the program (not merely the ones that are enabled). Useful for understanding and auditing what the compiler did to a given program.
§Example
largo opts src/main.lg
largo opts src/main.lg --json
largo opts src/main.lg --json --jit -- 1000Fields
Publish
Publish the package to the LOGOS registry.
Packages the project as a tarball and uploads it to the specified
registry. Requires authentication via largo login.
§Pre-flight Checks
Before publishing, the command verifies:
- The entry point exists
- No uncommitted git changes (unless
--allow-dirty) - Valid authentication token
§Example
largo publish # Publish to default registry
largo publish --dry-run # Validate without uploadingFields
Login
Authenticate with the package registry.
Stores an API token for the specified registry. The token is saved
in ~/.config/logos/credentials.toml with restricted permissions.
§Token Acquisition
Tokens can be obtained from the registry’s web interface:
- Visit
{registry}/auth/githubto authenticate - Generate an API token from your profile
- Provide it via
--tokenor interactive prompt
§Example
largo login # Interactive prompt
largo login --token tok_xxxxx # Non-interactiveFields
Logout
Remove stored credentials for a registry.
Deletes the authentication token from the local credentials file.
§Example
largo logoutDoctor
Diagnose the environment largo runs in.
Checks the Rust toolchain (needed by build/run), the wasm32
target, node (for --emit wasm), the verification flavor, registry
reachability and credentials, update freshness, and — inside a
project — manifest health. Degradations are warnings; only a broken
project fails. Works offline.
Repl
Start the interactive LOGOS REPL.
Two modes in one session: imperative statements against a
persistent interpreter session (logos>), and English→FOL logic
mode with discourse-aware anaphora (logic>). Type :help inside
for the meta-commands (:mode, :format, :readings, :vars,
:save, …). Works on a pipe too — no terminal required.
Fields
Sat
Solve a DIMACS CNF with the certified SAT engine.
The SAT Competition interface as a largo verb: prints
s SATISFIABLE with a v model or s UNSATISFIABLE, optionally
exporting a DRAT/DPR/SR refutation for external checkers
(drat-trim). Exit codes follow the competition convention:
10 = SAT, 20 = UNSAT, 1 = error.
Fields
Prove
Prove the theorems in a LOGOS source file (kernel-certified).
Runs ## Theory developments (formal Axiom/Theorem declarations,
proved in citation order) and English ## Theorem blocks
(Given/Prove/Proof) through the proof engine. Every ✓ is certified
by the type-theory kernel — a mere derivation never counts.
Fields
Logic
Translate English to First-Order Logic.
Compiles a natural-language sentence to formal logic — the LOGOS
logic mode from the terminal. Reads the sentence inline, from
--file, or from piped stdin. Prints bare FOL on stdout, so output
pipes cleanly into other tools.
Fields
format: LogicFormatOutput format for the logical form.
Doc
Generate documentation from the project’s ## blocks.
Renders a markdown reference from the literate structure of the
entry file: ## To signatures, type definitions, notes, examples,
and formal blocks — in source order. ## Main is omitted.
Add
Add a dependency to Largo.toml.
Accepts name (any version), name@version, or logos:name (the
registry URI form). --path and --git record local and git
dependencies. Edits preserve the manifest’s comments and formatting.
Fields
Remove
Remove a dependency from Largo.toml.
Deletes the named entry from [dependencies], leaving the rest of
the manifest byte-identical.
Fmt
Format LOGOS source files.
Applies the canonical style (4-space indentation, no tabs, no
trailing whitespace) — the same rules the language server uses.
Without paths, formats the whole project; with paths, exactly those
files. --check writes nothing and exits 1 if anything would change.
Fields
Emit
Emit compiled code without building a binary.
Prints the generated Rust or C translation of the program, or writes
a self-contained .wasm module (built-in backend, no rustc) with its
Node.js host shim. Without FILE, uses the current project’s entry;
with FILE, works on any standalone .lg/.md source.
Fields
target: EmitTargetWhat to emit.
output: Option<PathBuf>Write to this path instead of stdout (rust/c) or the default module path (wasm).
format: Option<RduFormat>emit rdu: the artifact to print bare / add to the bundle — placement (the default; the
neutral placement text), spatial (Spatial source), sambaflow (PyTorch module + compile
scaffold), vllm (the Qwen3.8 deployment plan for the chip), report (the MODELED II report).
bridge: Option<String>emit rdu: hand the certified artifact to an SDK bridge by name (mock, sambaflow).
model: Option<String>emit rdu: lower a whole model instead of FILE — qwen38 (Qwen3.8-27B, all 64 layers), qwen38-tiny,
qwen38-mini (the tiny shape with heads that split over 2 or 4 chips), or a Qwen3.5/3.8 checkpoint’s
.gguf, its program read from the checkpoint — as one certified program per layer kind plus the head, the
program they are cuts of (program.lg) and a manifest binding every layer and naming every program’s cut.
Needs -o DIR.
ctx: Option<usize>emit rdu --model: lower the DECODE deployment with a KV cache of CTX positions — an embedding
program, layer kinds whose attention appends to and reads the cache, and a head that emits the next
token; tok and pos are runtime inputs. Without it, the bundle is the authored forward.
batch: Option<String>emit rdu --model --ctx: serve BATCH sequences per decode step — the hidden states stacked BATCH × d,
every weight read once for all of them, each sequence with its own KV caches and carried state;
tok_s{b} and pos_s{b} are runtime inputs. auto: the most sequences whose per-step working set stays
in a chip’s SRAM (the serving plan). The default is one sequence.
tp: Option<String>emit rdu --model --ctx: TENSOR-PARALLEL over TP chips — every layer kind one program over the chips,
each chip its own heads and FFN columns and a slice of every weight, the partials summed by two
all-reduces a layer. TP must split the model’s heads (Qwen3.8-27B: 1, 2, 4 or 8). auto: the widest width
the heads admit in the chip’s scale-up domain. The default is one chip.
prefill: Option<usize>emit rdu --model --ctx: PREFILL a chunk of PREFILL prompt tokens of one sequence per step — the chunk’s
hidden states stacked PREFILL × d, every weight read once for the chunk, the rows taking the sequence’s KV
caches and recurrent memories in order, the last row’s next token out. The state is the decode bundle’s,
so decoding continues from it; tok_s{b} and pos_s{b} are runtime inputs.
Bringup
Bring a model up on every chip from its one program.
Reads the checkpoint’s spec, writes the model’s computation as one LOGOS program (program.lg) and lowers that
program on each backend asked for: the CPU tiers (the VM’s bytecode, the same with its JIT, C, Rust, RISC-V and
WebAssembly), the CUDA lane (one fused .cu and the sidecar of constants it reads), the D5005 decode engine (the
sequencer’s program), the SN50 (a certified bundle) and the fabric. Every artifact names the cut of the program
it was lowered from (LOGOS program: <cut>, sha256 <hex>); a backend that does not run the model refuses it by
name. With --run, every chip that brought the model up and is on this machine then generates from a prompt
(or every prompt of a golden, --prompts) through the one program, and reports its tokens, its tokens a second
and how many lead the reference’s.
Fields
targets: Vec<String>The chips to bring the model up on, comma-separated: vm, jit, c, rust, riscv-qemu, wasm, cuda, d5005, sn50, fabric. Every one when absent.
run: boolThen run the model on every chip that brought it up and is on this machine, each judged by how many of its tokens lead the reference’s.
tokens: Option<usize>The tokens a run generates after the prompt (8, or the golden’s continuation, unless given).
Expand
Show what an LGX page became: the ordinary LOGOS its constructs lower to.
A ## Component is not run as written: it becomes a render function that writes
the view to a tape (vdOpen/vdText/vdClose) its commit turns into DOM calls, an
action function per action, a mount entry and a dispatcher; a ## Route becomes a function plus the synthesized
route(method, path) walk. When a page behaves in a way its markup does not
explain, the lowering is the answer — this prints it.
Clean
Remove build artifacts.
Deletes the project’s target/ directory. With --all, also removes
the .logos-native/ compiled-function bundle cache produced by
largo build --native-functions.
Completions
Generate shell completions for largo.
Writes a completion script for the given shell to stdout. Source it from your shell’s configuration to get tab completion for every largo command and flag.
Fields
shell: ShellThe shell to generate completions for.
Replay
Re-execute a .replay failure artifact.
A failing largo run --interpret writes a self-contained bundle under
target/replays/ — embedded source, scheduler seed and decision trace,
input transcript, and the failure coordinate. Replaying it re-executes
the program deterministically and reports whether the recorded failure
still reproduces byte-identically, no longer fires (fixed), or diverged
(the program or bundle changed since recording).
Bundles are portable and committable: a bundle checked into a project’s test corpus is a permanent reproduction of the bug it recorded.
Fields
Explain
Explain a diagnostic code or a language construct, offline.
Looks the topic up in the error catalog first (largo explain zero-index — every code from check --json and the MCP tools), then
in the teach lessons (largo explain Let). No project or network
needed.
Fields
Mcp
Serve the LOGOS toolchain over the Model Context Protocol (stdio).
Speaks JSON-RPC 2.0, one JSON object per line: check with structured diagnostics, sandboxed deterministic runs, English→FOL, kernel-certified proofs, code emission, and optimization reports — plus the quickguide and docs guides as MCP resources. Made for AI agents; humans want the plain subcommands.
Fields
Test
Run the project’s ## Test blocks.
Discovers every ## Test: <prose name> in the project, runs each in a
fresh, isolated world on the interpreter tier, and prints a
deterministic, name-ordered report. Expect that failures
record-and-continue (one run reports everything); runaway tests fail at
a deterministic op budget (the timeout that cannot flake); skips are
loud, need a reason, and fail the run unless budgeted under
[test] skip_budget in Largo.toml.
Fields
json: boolEmit the machine-readable CLAIM INVENTORY as JSON: every ## Test
classified by kind (example / finite-enumeration property) with an
honest status, vacuous flags, disclosed domain bounds, and any
concrete counterexample. A superset of --format json.
live: boolAlso run capability-granted tests (This test may use the real filesystem. etc.) — they leave the hermetic no-flake guarantee.
prove: boolEscalate finite-domain For all properties to exhaustive proof
(booleans are checked over every case, not sampled) → rank PROVEN.
tiers: Option<String>Cross-tier differential: all (or a list of interpreter,vm) also runs
each passing test’s computation on the bytecode VM and compares it byte for
byte, failing if the compiled tier cannot run what the interpreter did (the
F18 “works-on-my-tier” guard). Any other value is refused rather than ignored.
browser: boolA mounted test’s page tiers also drive a real headless Chrome (CHROME_BIN, or the
first of google-chrome/google-chrome-stable/chromium/chromium-browser/chrome
on PATH) and must agree with it, exactly as they already must agree with the lowered
bytecode VM. No Chrome found is a refused run, not a silent skip.
Dap
Debug a LOGOS program over the Debug Adapter Protocol (stdio).
Speaks DAP with Content-Length framing: launch, breakpoints,
stackTrace/scopes/variables, the stepping verbs, evaluate, and —
the headline — real reverse execution (stepBack/reverseContinue,
supportsStepBack: true). A thin serializer over the same DebugSession
facade the Studio drawer renders, so an editor and the browser drawer
see the same session. Made for editor integrations; humans want largo repl.
Lean
Lean 4 → LOGOS: import a Lean declaration as a checked LOGOS package.
largo lean import --project <dir> --target <Name> --out <dir> compiles
the project with the pinned Lean 4.14.0, exports the target with the
pinned lean4export, checks it with the LOGOS kernel, rechecks it
independently, holds its assumptions to policy, emits it as a LOGOS
document and replays the package in a fresh process. stdout is one
logos-lean-result/1 document; stderr is NDJSON diagnostics.
largo lean replay <dir> replays a published package.
Trait Implementations§
Source§impl FromArgMatches for Commands
impl FromArgMatches for Commands
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Commands
impl Subcommand for Commands
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for Commands
impl RefUnwindSafe for Commands
impl Send for Commands
impl Sync for Commands
impl Unpin for Commands
impl UnsafeUnpin for Commands
impl UnwindSafe for Commands
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.