pub enum Commands {
Show 23 variants
New {
name: String,
},
Init {
name: Option<String>,
},
Build {
release: bool,
verify: bool,
license: Option<String>,
lib: bool,
target: Option<String>,
native_functions: bool,
emit: Option<String>,
},
Verify {
license: Option<String>,
},
Run {
release: bool,
interpret: bool,
emit: Option<String>,
args: Vec<String>,
},
Check {
deep: bool,
},
Opts {
file: PathBuf,
json: bool,
},
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>,
trace: bool,
json: 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,
},
Emit {
target: EmitTarget,
file: Option<PathBuf>,
output: Option<PathBuf>,
},
Clean {
all: bool,
},
Completions {
shell: Shell,
},
Test {
args: Vec<String>,
},
}Expand description
Available CLI subcommands.
Each variant represents a distinct operation that largo can perform.
Commands are grouped into three categories:
§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 runInit
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.
Compiles the LOGOS source to Rust, then invokes cargo build on the
generated code. The resulting binary is placed in target/debug/ or
target/release/ depending on the mode.
§Verification
When --verify is passed, the build process includes Z3 static
verification of logical constraints. This requires:
- A Pro+ license (via
--licenseorLOGOS_LICENSEenv var) - The
verificationfeature enabled at build time
§Example
largo build # Debug build
largo build --release # Release build with optimizations
largo build --verify # Build with Z3 verificationFields
license: Option<String>License key for verification.
Can also be set via the LOGOS_LICENSE environment variable.
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. wasm compiles the project DIRECTLY to a self-contained .wasm module via the
built-in backend (no rustc / cargo / wasm-bindgen — milliseconds), written to
target/<name>.wasm. 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 — needs the Rust toolchain + a wasm32 base build. Omit for the default
rustc-based Rust build.
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.
Requires a Pro+ license.
§Example
largo verify --license sub_xxxxx
# Or with environment variable:
export LOGOS_LICENSE=sub_xxxxx
largo verifyFields
Run
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 Rust compilation and uses the tree-walking
interpreter for sub-second feedback during development.
§Example
largo run # Debug mode (compile to Rust)
largo run --release # Release mode
largo run --interpret # Interpret directly (no compilation)Fields
interpret: boolRun using the interpreter instead of compiling to Rust. Provides sub-second feedback but lacks full Rust performance.
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
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 --jsonFields
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.
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.
Test
Reserved for the LOGOS test framework (coming in a future release).
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.