Skip to main content

Installation

Learn how to add LC as a dependency to your Rust project.

Adding the Dependency

Add LC to your Cargo.toml file:

[dependencies]
lc-cli = "0.1.1"
Package Name

Note that the package name is lc-cli (as defined in the [package] section), not just lc.

With Specific Features

LC supports optional features that you can enable based on your needs:

[dependencies]
lc-cli = { version = "0.1.1", features = ["unix-sockets", "pdf"] }

Available Features

FeatureDescriptionDefaultPlatforms
unix-socketsUnix domain socket support for MCP daemon✅ (Unix only)Linux, macOS, WSL2
pdfPDF processing capabilitiesAll platforms

Platform-Specific Builds

Unix Systems (Linux, macOS, WSL2)

[dependencies]
lc-cli = "0.1.1" # All features enabled by default

Windows (without Unix sockets)

[dependencies]
lc-cli = { version = "0.1.1", default-features = false, features = ["pdf"] }

Minimal Build (no optional features)

[dependencies]
lc-cli = { version = "0.1.1", default-features = false }

Async Runtime

LC is built on tokio, so your project needs an async runtime. Add this to your Cargo.toml:

[dependencies]
lc-cli = "0.1.1"
tokio = { version = "1.35", features = ["full"] }

And use #[tokio::main] in your main function:

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Your code here
Ok(())
}

Verification

Create a simple test to verify the installation:

// src/main.rs
use lc_cli::Config;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Try to load the configuration
match Config::load() {
Ok(config) => println!("LC library loaded successfully!"),
Err(e) => println!("Config load failed (expected if not configured): {}", e),
}
Ok(())
}

Run with:

cargo run

If you see "LC library loaded successfully!" or a config-related error (which is normal if you haven't set up providers yet), the library is installed correctly.

Next Steps