Skip to content

Project Templates

Copper ships templates to bootstrap new projects quickly. Use them to get a runnable task graph, logging setup, and basic app layout in minutes.

Prerequisites

  • Rust toolchain (rustup)
  • cargo-generate: cargo install cargo-generate
  • Optional: just for helper commands (see Task Automation with just)

Choose a template

Template Use it for
cu_project Single-crate project for quick experiments.
cu_full Multi-crate workspace with apps/ and components/.

Generate from a local checkout

  1. Clone the repo and move into the templates directory:
git clone https://github.com/copper-project/copper-rs
cd copper-rs/templates
  1. Generate a workspace or single-crate project:
# Workspace template
cargo +stable generate \
    --path cu_full \
    --name my_workspace \
    --destination . \
    --define copper_source=local \
    --define copper_root_path=../..

# Single-crate template
cargo +stable generate \
    --path cu_project \
    --name my_project \
    --destination . \
    --define copper_source=local \
    --define copper_root_path=../..
  1. Move into the generated project and run it:
cd ../my_workspace
cargo run -p my-workspace

# or for the single-crate project
cd ../my_project
cargo run

Template variables

  • copper_source=local: use the local copper-rs checkout.
  • copper_root_path=../..: path from the generated project back to the Copper repo root. Adjust if your layout differs.

If you omit --name or --define, cargo-generate will prompt you interactively.

Shortcuts

  • cargo cunew is an alias for cargo generate.
  • The templates/justfile includes just gen-workspace and just gen-project for standard names.