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:
justfor 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¶
- Clone the repo and move into the templates directory:
git clone https://github.com/copper-project/copper-rs
cd copper-rs/templates
- 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=../..
- 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 localcopper-rscheckout.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 cunewis an alias forcargo generate.- The
templates/justfileincludesjust gen-workspaceandjust gen-projectfor standard names.