Crate lc

Source
Expand description

LC (LLM Client) Library

This library provides the core functionality for the LC CLI tool, including configuration management, provider handling, and chat functionality.

§Platform Differences

This crate includes platform-specific features that are only available on certain operating systems:

§Unix Socket Support

Unix socket functionality is only available on Unix-like systems (Linux, macOS, BSD, WSL2) and requires the unix-sockets feature to be enabled.

§MCP Daemon

The MCP (Model Context Protocol) daemon functionality uses Unix domain sockets for inter-process communication and is therefore only available on Unix systems:

  • Unix systems (Linux, macOS, WSL2): Full MCP daemon support with persistent connections
  • Windows: MCP daemon is not supported; direct MCP connections work on all platforms

§Usage Statistics

Usage statistics functionality works on all platforms (Windows, macOS, Linux, WSL2). It uses SQLite database which has full cross-platform support.

§Feature Flags

  • unix-sockets: Enables Unix socket functionality (default on Unix systems)
  • pdf: Enables PDF processing support (default)

To build without Unix socket support:

cargo build --no-default-features --features pdf

To build with all features:

cargo build --features "unix-sockets,pdf"

Re-exports§

pub use config::CachedToken;
pub use config::Config;
pub use config::ProviderConfig;
pub use provider::ChatRequest;
pub use provider::Message;
pub use provider::OpenAIClient;

Modules§

chat
cli
completion
Shell completion support for the lc CLI
config
Configuration management for the lc CLI tool
database
dump_metadata
error
http_client
image_utils
input
mcp
Model Context Protocol (MCP) client implementation using the official Anthropic Rust SDK
mcp_daemon
MCP Daemon Service for persistent MCP connections across CLI invocations
model_metadata
models_cache
provider
proxy
readers
search
sync
Configuration synchronization module
template_processor
test_utils
Test utilities for managing test providers and cleanup
token_utils
unified_cache
usage_stats
vector_db
webchatproxy

Macros§

debug_log
test_with_cleanup
Macro to wrap test functions with automatic setup and cleanup