Quick Start
This quick start guide will get you up and running with cuenv in just a few minutes.
Prerequisites
Section titled “Prerequisites”Before you begin, make sure you have:
- Rust 1.70+ installed via rustup
- Git for version control
- (Optional) Nix package manager for additional features
Installation
Section titled “Installation”From Source (Development)
Section titled “From Source (Development)”- Clone the repository:
git clone https://github.com/cuenv/cuenv.gitcd cuenv- Install locally:
cargo install --path crates/cuenv-cliUsing Cargo (Future)
Section titled “Using Cargo (Future)”Once published to crates.io:
cargo install cuenv-cliYour First CUE Environment
Section titled “Your First CUE Environment”- Create a new project directory:
mkdir my-cuenv-projectcd my-cuenv-project- Create a simple
env.cuefile:
package cuenv
import "github.com/cuenv/cuenv/schema"
schema.#Cuenv
// Define your environment variablesenv: { NODE_ENV: "development" | "production" PORT: 3000}
// Define taskstasks: { install: { description: "Install dependencies" command: "bun" args: ["install"] }
build: { description: "Build the application" command: "bun" args: ["run", "build"] dependsOn: ["install"] }
dev: { description: "Start development server" command: "bun" args: ["run", "dev"] dependsOn: ["install"] }}- Run a task:
cuenv task devWhat’s Next?
Section titled “What’s Next?”- Learn about configuration options
- Explore task orchestration features
- Set up typed environments
- Integrate with Nix for package management
- Configure secret management
Common Use Cases
Section titled “Common Use Cases”Monorepo Management
Section titled “Monorepo Management”cuenv supports workspaces for managing complex monorepos. Define workspaces in your configuration:
package cuenv
import "github.com/cuenv/cuenv/schema"
schema.#Cuenv
// Shared environment variablesenv: { LOG_LEVEL: "info" RUST_LOG: "debug"}
// Workspace configuration (auto-detected from package managers)workspaces: { api: { enabled: true package_manager: "bun" } worker: { enabled: true package_manager: "cargo" }}Development Workflows
Section titled “Development Workflows”Automate common development tasks:
package cuenv
import "github.com/cuenv/cuenv/schema"
schema.#Cuenv
tasks: { test: { description: "Run all tests" command: "cargo" args: ["test", "--workspace"] }
lint: { description: "Run linting" command: "cargo" args: ["clippy", "--", "-D", "warnings"] }
format: { description: "Format code" command: "cargo" args: ["fmt"] }
ci: { description: "Run CI pipeline" command: "echo" args: ["CI complete"] dependsOn: ["lint", "test", "format"] }}Troubleshooting
Section titled “Troubleshooting”Build Issues
Section titled “Build Issues”If you encounter build issues:
- Ensure you have the latest Rust version:
rustup update- Clean and rebuild:
cargo cleancargo buildCUE Evaluation Errors
Section titled “CUE Evaluation Errors”For CUE-related errors:
- Validate your
.cuefiles with the CUE CLI - Check for syntax errors and type constraints
- Refer to the CUE Language documentation
Getting Help
Section titled “Getting Help”- Check the API Reference
- Browse examples for common patterns
- Open an issue on GitHub
- Join the discussion on GitHub Discussions