Expand description
cuenv - CUE-powered environment management library
This crate provides a library-first architecture for cuenv, allowing external crates to extend functionality by registering custom providers.
§Architecture
cuenv uses a unified provider system where providers implement one or more capability traits:
SyncCapability- Sync files from CUE configurationRuntimeCapability- Execute tasks (future)SecretCapability- Resolve secrets (future)
§Example: Custom CLI with Additional Providers
ⓘ
use cuenv::{Cuenv, SyncCapability};
fn main() -> cuenv::Result<()> {
Cuenv::builder()
.with_defaults()
.with_sync_provider(my_provider::CustomProvider::new())
.build()
.run()
}§Example: Multi-Capability Provider
A single provider can implement multiple capabilities:
ⓘ
use cuenv::{Provider, SyncCapability, RuntimeCapability};
pub struct DaggerProvider;
impl Provider for DaggerProvider {
fn name(&self) -> &'static str { "dagger" }
fn description(&self) -> &'static str { "Dagger-based sync and execution" }
fn as_any(&self) -> &dyn std::any::Any { self }
fn as_any_mut(&mut self) -> &mut dyn std::any::Any { self }
}
// Implement both SyncCapability and RuntimeCapability...Re-exports§
pub use provider::Provider;pub use provider::RuntimeCapability;pub use provider::SecretCapability;pub use provider::SyncCapability;pub use registry::ProviderRegistry;
Modules§
- cli
- CLI argument parsing and exit codes.
- commands
- Command implementations (task, env, sync, etc.).
- completions
- Shell completion generation. Dynamic shell completion support for cuenv
- coordinator
- Multi-process event coordination. Event Coordinator for multi-UI support.
- events
- Event handling and routing.
- performance
- Performance measurement utilities. Performance instrumentation and metrics collection
- provider
- Provider trait definitions. Provider traits for extensible cuenv functionality.
- providers
- Built-in provider implementations. Built-in providers for cuenv.
- registry
- Provider registration and lookup. Provider registry for managing registered providers.
- tracing
- Tracing and logging configuration. Enhanced tracing configuration for cuenv CLI
- tui
- Terminal UI components.
Macros§
- command_
span - Create a new span for command execution with structured fields
- measure_
perf - Macro for easy performance measurement
- measure_
perf_ async - Async version of performance measurement
- perf_
event - Log performance metrics
- perf_
span - Create performance measurement span
Structs§
- Cuenv
- The main cuenv application.
- Cuenv
Builder - Builder for configuring and creating a
Cuenvinstance.
Constants§
- EXIT_
SIGINT - Exit code for SIGINT (128 + signal number 2)
- LLMS_
CONTENT - LLM context content (llms.txt + CUE schemas concatenated at build time)
Type Aliases§
- Result
- Result type alias for cuenv operations