Skip to main content

Commands

Enum Commands 

Source
pub enum Commands {
    New {
        name: String,
    },
    Init {
        name: Option<String>,
    },
    Build {
        release: bool,
        verify: bool,
        license: Option<String>,
        lib: bool,
        target: Option<String>,
    },
    Verify {
        license: Option<String>,
    },
    Run {
        release: bool,
        interpret: bool,
        args: Vec<String>,
    },
    Check,
    Publish {
        registry: Option<String>,
        dry_run: bool,
        allow_dirty: bool,
    },
    Login {
        registry: Option<String>,
        token: Option<String>,
    },
    Logout {
        registry: Option<String>,
    },
}
Expand description

Available CLI subcommands.

Each variant represents a distinct operation that largo can perform. Commands are grouped into three categories:

§Project Management

  • New - Create a new project in a new directory
  • Init - Initialize a project in the current directory

§Build & Run

  • Build - Compile the project
  • Run - Build and execute
  • Check - Type-check without building
  • Verify - Run Z3 static verification

§Package Registry

  • Publish - Upload package to registry
  • Login - Authenticate with registry
  • Logout - Remove stored credentials

Variants§

§

New

Create a new LOGOS project in a new directory.

Scaffolds a complete project structure including:

  • Largo.toml manifest file
  • src/main.lg entry point with a “Hello, world!” example
  • .gitignore configured for LOGOS projects

§Example

largo new my_project
cd my_project
largo run

Fields

§name: String

The project name, used for the directory and package name.

§

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 init

Fields

§name: Option<String>

Project name. If omitted, uses the current directory name.

§

Build

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 --license or LOGOS_LICENSE env var)
  • The verification feature enabled at build time

§Example

largo build              # Debug build
largo build --release    # Release build with optimizations
largo build --verify     # Build with Z3 verification

Fields

§release: bool

Build with optimizations enabled.

§verify: bool

Run Z3 static verification after compilation. Requires a Pro+ license.

§license: Option<String>

License key for verification. Can also be set via the LOGOS_LICENSE environment variable.

§lib: bool

Build 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”.

§

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 verify

Fields

§license: Option<String>

License key for verification. Can also be set via the LOGOS_LICENSE environment variable.

§

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

§release: bool

Build with optimizations enabled.

§interpret: bool

Run using the interpreter instead of compiling to Rust. Provides sub-second feedback but lacks full Rust performance.

§args: Vec<String>

Arguments to pass to the program.

§

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 check
§

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 uploading

Fields

§registry: Option<String>

Registry URL. Defaults to registry.logicaffeine.com.

§dry_run: bool

Perform all validation without actually uploading. Useful for testing the publish process.

§allow_dirty: bool

Allow publishing with uncommitted git changes. By default, publishing requires a clean working directory.

§

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:

  1. Visit {registry}/auth/github to authenticate
  2. Generate an API token from your profile
  3. Provide it via --token or interactive prompt

§Example

largo login                       # Interactive prompt
largo login --token tok_xxxxx     # Non-interactive

Fields

§registry: Option<String>

Registry URL. Defaults to registry.logicaffeine.com.

§token: Option<String>

API token. If omitted, prompts for input on stdin.

§

Logout

Remove stored credentials for a registry.

Deletes the authentication token from the local credentials file.

§Example

largo logout

Fields

§registry: Option<String>

Registry URL. Defaults to registry.logicaffeine.com.

Trait Implementations§

Source§

impl FromArgMatches for Commands

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Commands

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V