An opinionated Copier template for Rust projects.
- CLI and autocompletion with clap.
- Logs with tracing.
- Pre-configured tools for code formatting, quality analysis, documentation and testing:
- Task automation with just.
- Nix flake.
- Support for GitHub actions and GitHub pages.
First, install Copier.
Then, to create a new project based on this template, run the following command and fill in the form:
copier copy 'https://github.com/vivienm/copier-rust' path/to/your/projectGo to the project directory and initialize a Git repository:
cd path/to/your/project
git initIf you enabled nix_flake, use Nix with flakes enabled. Track the generated files and enter the development shell, which provides Rust and all required development tools:
git add .
nix developOtherwise, install Rust using rustup, then install the required components and development tools (cargo-edit provides cargo upgrade):
rustup component add rustfmt clippy
cargo install --locked cargo-edit just cargo-audit typos-cliUpdate the dependencies and format the code:
cargo upgrade --incompatible
cargo update
cargo fmtRun the tests:
just ciIf you enabled github_pages, configure your GitHub repository before the first push to its default branch: in Settings → Pages → Build and deployment, set Source to GitHub Actions. The generated workflow will then publish the library documentation.
You are now ready to start coding!
Later, to update your project as this template evolves, run:
copier update --skip-answered