# Largo
[](https://crates.io/crates/largo-cli)
[](LICENSE)
A simple CLI tool that runs `cargo check → build → run` at the project root (auto-detected).
## What it does
Largo automatically finds the nearest Rust project by searching for a `Cargo.toml` file, then runs the standard development workflow:
1. **`cargo check`** - Fast syntax and type checking
2. **`cargo build`** - Compile the project
3. **`cargo run`** - Execute the binary
This is especially useful when you're working in a subdirectory of a Rust project and want to quickly test the entire project without navigating to the root.
## Installation
### From crates.io
```bash
cargo install largo-cli
```
### From source
```bash
git clone https://github.com/stevecellbio/largo
cd largo
cargo install --path .
```
## Usage
### Basic usage
```bash
# Run from anywhere in your Rust project
largo
```
This will:
- Find the nearest `Cargo.toml` file by walking up the directory tree
- Run `cargo check`, then `cargo build`, then `cargo run` in that directory
### Command-line options
```bash
largo [OPTIONS] [-- <RUN_ARGS>...]
Options:
--no-check Skip cargo check
--no-build Skip cargo build
--no-run Skip cargo run
-p, --path <PATH> Start searching from this directory instead of current directory
-h, --help Print help
-V, --version Print version
Arguments:
[RUN_ARGS]... Arguments to pass to cargo run
```
### Examples
```bash
# Skip the check step
largo-cli --no-check
# Only build, don't run
largo-cli --no-run
# Pass arguments to your program
largo-cli -- arg1 arg2 --flag
# Start from a specific directory
largo-cli --path /path/to/project
# Only run cargo check and build
largo-cli --no-run
```
## Example workflow
```bash
# You're working in src/modules/parser/
pwd
# /home/user/my-rust-project/src/modules/parser
# Instead of doing:
cd ../../..
cargo check
cargo build
cargo run
# Just do:
cargo run largo
```
Output:
```
Found Rust project at: /home/user/my-rust-project
Running cargo check...
Checking my-project v0.1.0 (/home/user/my-rust-project)
Finished dev [unoptimized + debuginfo] target(s) in 0.12s
Running cargo build...
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running cargo run...
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/my-project`
Hello, world!
```
## Safety features
- **Infinite recursion protection**: Largo detects if you're trying to run it on the largo project itself and prevents execution
- **Respects cargo's exit codes**: If any step fails, largo stops and returns the appropriate exit code
## Why "Largo"?
Largo is a musical term meaning "slow and dignified" - perfect for a tool that takes its time to check, build, and run your code properly, one step at a time.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.