Skip to content

Quick Start

This quick start guide will get you up and running with cuenv in just a few minutes.

Before you begin, make sure you have:

  • Rust 1.70+ installed via rustup
  • Git for version control
  • (Optional) Nix package manager for additional features
  1. Clone the repository:
Terminal window
git clone https://github.com/cuenv/cuenv.git
cd cuenv
  1. Install locally:
Terminal window
cargo install --path crates/cuenv-cli

Once published to crates.io:

Terminal window
cargo install cuenv-cli
  1. Create a new project directory:
Terminal window
mkdir my-cuenv-project
cd my-cuenv-project
  1. Create a simple env.cue file:
package cuenv
import "github.com/cuenv/cuenv/schema"
schema.#Cuenv
// Define your environment variables
env: {
NODE_ENV: "development" | "production"
PORT: 3000
}
// Define tasks
tasks: {
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"]
}
}
  1. Run a task:
Terminal window
cuenv task dev

cuenv supports workspaces for managing complex monorepos. Define workspaces in your configuration:

package cuenv
import "github.com/cuenv/cuenv/schema"
schema.#Cuenv
// Shared environment variables
env: {
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"
}
}

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"]
}
}

If you encounter build issues:

  1. Ensure you have the latest Rust version:
Terminal window
rustup update
  1. Clean and rebuild:
Terminal window
cargo clean
cargo build

For CUE-related errors: