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

I wanted Copier in Rust, so I wrote rootstock

说明与用途

Rootstock 是一个 Rust 二进制工具,能够从版本化的 Git 模板创建项目,并通过三方合并保留本地修改,消除了对 Python 依赖的需求。

问题

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.

结果

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.

工作流

  • 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.

证据

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.

来源

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.

来源

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.

来源

rootstock update updated to v1.1.0 markers Makefile 1 conflict

来源

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.

来源

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

来源

  • 记录日期: 2026-11-01T03:43:58.217Z