stamp-cli

Crates.iostamp-cli
lib.rsstamp-cli
version0.3.1
created_at2025-01-06 05:57:06.210738+00
updated_at2026-01-11 01:10:30.10113+00
descriptionA cli tool for applying project templates
homepage
repositoryhttps://github.com/mcmah309/stamp-cli
max_upload_size
id1505324
size79,673
Henry (mcmah309)

documentation

README

stamp-cli

github crates.io docs.rs

stamp-cli is a command-line tool for managing and rendering project templates. It allows you to register, list, remove, and render templates from a registry or directly from a source directory.

A cli tool for applying project templates

Usage: stamp <COMMAND>

Commands:
  use       Render a template in the registry to a destination directory
  from      Render a template from a source directory to a destination directory
  register  Register a template source directory. All templates within this directory (recursive) will be available.
  remove    Remove a registered source directory
  list      List registered templates
  help      Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

.tera

stamp-cli uses tera for templating. Any file including .tera will be treated as a tera template when applying a template through the use or from sub commands. e.g. path/file.tera.json or path/file.json.tera.

Any file name or directory name including a template interpolation ({{ ... }}) will also be treated as a template.

stamp.toml

Add a stamp.toml file to a directory to make the directory a valid template. All fields are optional. Example config:

[meta]
description = "A generic template for devcontainers"
name = "My Template"

# String input
[[questions]]
id = "name"
type = "string"
prompt = "What is the project name?"
default = "my-project"

# Select one from a list
[[questions]]
id = "toolchain"
type = "select"
prompt = "Choose a toolchain:"
options = ["stable", "beta", "nightly"]
default = "stable"

# Multiple selection
[[questions]]
id = "features"
type = "multi-select"
prompt = "Select optional components:"
choices = [
  { id = "rust_support", prompt = "Rust LSP", default = true },
  { id = "sh_support",   prompt = "Shell LSP", default = false },
  { id = "c_support",    prompt = "C LSP",     default = false }
]

Usage Example

root@c-nixos:/workspaces/stamp-cli (master)$ stamp register tests/templates/
Source `/workspaces/stamp-cli/tests/templates` registered successfully
root@c-nixos:/workspaces/stamp-cli (master)$ stamp list
Bash - A scaffold for bash scripts with pre-set options and error handling. Plus a cheatsheet.
  /home/henry/templates/bash_script

Axum server - A rust server template built with axum
  /home/henry/templates/axum_server

Devcontainer - Devcontainer template for containers
  /home/henry/templates/devcontainer

Python - A Python project setup
  /home/henry/templates/python-project

root@c-nixos:/workspaces/stamp-cli (master)$ stamp use devcontainer example_crate
✔ [1/3] Container Name · rust
✔ [2/3] Base Image · rust:latest
? [3/3] Which features would you like to include? ›
⬚ Shell LSP support
⬚ Rust LSP and tools
⬚ C LSP and tools
⬚ Zig LSP and tools
⬚ Python LSP and tools
⬚ Flutter/Dart LSP and tools
⬚ Dioxus support
⬚ Web dev (HTML/CSS/Tailwind)
⬚ USB devices support
⬚ XDG portal support
Template rendered successfully to "example_crate"

See tests/templates/ for more.

Install

Cargo

cargo install stamp-cli
Commit count: 52

cargo fmt