Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I wanted Copier in Rust, so I wrote rootstock

Description and use

Rootstock is a Rust binary that creates projects from versioned git templates and updates them while preserving local edits via three‑way merge, eliminating the need for Python dependencies.

Problem

Project templates change over time, but tools like Copier are Python-based, requiring Python and pipx on every machine and CI job, which is inconvenient for Rust developers who prefer a single binary.

Outcome

Rootstock enables Rust developers to create and update projects from versioned git templates with a single binary, preserving local edits through three‑way merges and providing automated CI integration.

Workflow

  • 1. Run rootstock new <template> <project> --data <answers> to generate a project and write .rootstock.toml with template source, tag, commit, answers, and file list.
  • 2. When the template updates, run rootstock update to perform a three‑way merge, showing conflicts with Git merge markers.
  • 3. Resolve conflicts, run rootstock check to ensure no leftover markers, commit, and optionally open a PR.
  • 4. For existing projects, use rootstock import-copier to convert a Copier template or project into rootstock format.
  • 5. Automate updates in CI by running rootstock update and handling exit code 2 for conflicts.
  • 6. Use rootstock check in CI to fail on unresolved markers or side files.

Evidence

Project templates were the exception. The best tool I know for them is Copier, and it's genuinely good. But it's Python, so every machine and every CI job that touches a template needs Python and pipx first.

Source

rootstock new renders the template and writes a small record, .rootstock.toml, next to your files: the template source, the tag and exact commit, your answers, and the list of files it wrote.

Source

Later the template ships v1.1.0. It bumps actions/checkout in CI and adds --all-targets to the test and lint targets in the Makefile.

Source

rootstock update updated to v1.1.0 markers Makefile 1 conflict

Source

rootstock check runs in CI without network access and fails on leftover markers or side files, so a half-resolved conflict can't slip into main.

Source

rootstock import-copier converts a Copier template, a project generated by Copier, or both if they live in the same directory.

Source

  • Record date: 2026-11-01T03:43:58.217Z