A CLI tool for smart template replacement in repositories and directories.
YankRun can run fully non-interactively, prompt in a terminal, or open a local web workbench for previewing template repos before writing files.
Short references:
- Installation
- Quick Start
- Commands
- Interactive Workbench
- Values File Format
- Transformation Functions
- Configuration
- Examples
- Troubleshooting
Linux (AMD64)
curl -L https://github.com/AxeForging/yankrun/releases/latest/download/yankrun-linux-amd64.tar.gz | tar xz
sudo mv yankrun-linux-amd64 /usr/local/bin/yankrun
yankrun versionLinux (ARM64)
curl -L https://github.com/AxeForging/yankrun/releases/latest/download/yankrun-linux-arm64.tar.gz | tar xz
sudo mv yankrun-linux-arm64 /usr/local/bin/yankrunmacOS (Intel)
curl -L https://github.com/AxeForging/yankrun/releases/latest/download/yankrun-darwin-amd64.tar.gz | tar xz
sudo mv yankrun-darwin-amd64 /usr/local/bin/yankrunmacOS (Apple Silicon)
curl -L https://github.com/AxeForging/yankrun/releases/latest/download/yankrun-darwin-arm64.tar.gz | tar xz
sudo mv yankrun-darwin-arm64 /usr/local/bin/yankrunWindows (PowerShell)
# Download
Invoke-WebRequest -Uri https://github.com/AxeForging/yankrun/releases/latest/download/yankrun-windows-amd64.zip -OutFile yankrun.zip
# Extract
Expand-Archive -Path yankrun.zip -DestinationPath .
# Move to PATH (adjust as needed)
Move-Item -Path yankrun-windows-amd64.exe -Destination C:\Windows\yankrun.exe
# Verify
yankrun versionFrom Source (Go 1.25+)
go install github.com/AxeForging/yankrun@latestOr build manually:
git clone https://github.com/AxeForging/yankrun.git
cd yankrun
go build -o yankrun .
sudo mv yankrun /usr/local/bin/# values.yaml
variables:
- key: APP_NAME
value: MyApp
- key: AUTHOR
value: Your Name
- key: VERSION
value: 1.0.0yankrun clone \
--repo https://github.com/AxeForging/template-tester.git \
--input values.yaml \
--outputDir ./my-new-project \
--verboseOr inspect it interactively first:
yankrun serve --dir ./my-new-project --input values.yamlcat ./my-new-project/README.md
# All [[APP_NAME]], [[AUTHOR]], [[VERSION]] placeholders are replaced!Clone a git repository and replace placeholders.
yankrun clone --repo <URL> --outputDir <DIR> [options]All flags
| Flag | Alias | Description | Default |
|---|---|---|---|
--repo |
Git URL (HTTPS or SSH) | required | |
--outputDir |
-o |
Output directory | required |
--input |
-i |
Values file path (JSON/YAML) | - |
--startDelim |
Start delimiter | [[ |
|
--endDelim |
End delimiter | ]] |
|
--fileSizeLimit |
Skip files larger than | 3 mb |
|
--prompt |
-p |
Interactive mode (prompt for values) | false |
--processTemplates |
--pt |
Process .tpl files |
false |
--onlyTemplates |
--ot |
Only process .tpl files |
false |
--branch |
-b |
Branch to clone | default branch |
--verbose |
-v |
Show detailed output | false |
Examples
# Basic clone with values
yankrun clone \
--repo https://github.com/org/template.git \
--input values.yaml \
--outputDir ./new-project
# Interactive mode - will prompt for each placeholder
yankrun clone \
--repo git@github.com:org/template.git \
--outputDir ./new-project \
--prompt
# Clone specific branch with custom delimiters
yankrun clone \
--repo https://github.com/org/template.git \
--branch develop \
--input values.json \
--outputDir ./new-project \
--startDelim "{{" \
--endDelim "}}"
# Clone and process .tpl files
yankrun clone \
--repo https://github.com/org/template.git \
--input values.yaml \
--outputDir ./new-project \
--processTemplates \
--verboseApply replacements to an existing directory.
yankrun template --dir <DIR> [options]All flags
| Flag | Alias | Description | Default |
|---|---|---|---|
--dir |
-d |
Directory to process | required |
--input |
-i |
Values file path (JSON/YAML) | - |
--startDelim |
Start delimiter | [[ |
|
--endDelim |
End delimiter | ]] |
|
--fileSizeLimit |
Skip files larger than | 3 mb |
|
--prompt |
-p |
Interactive mode | false |
--processTemplates |
--pt |
Process .tpl files |
false |
--onlyTemplates |
--ot |
Only process .tpl files |
false |
--verbose |
-v |
Show detailed output | false |
Examples
# Basic templating
yankrun template --dir ./my-project --input values.yaml
# Interactive mode
yankrun template --dir ./my-project --prompt --verbose
# Skip large files
yankrun template --dir ./my-project --input values.yaml --fileSizeLimit "10 mb"
# Only process .tpl files
yankrun template --dir ./my-project --input values.yaml --processTemplates --onlyTemplatesInteractively choose a template from your config and generate a new project.
yankrun generate [options]All flags
| Flag | Alias | Description | Default |
|---|---|---|---|
--template |
-t |
Filter templates by name | - |
--branch |
-b |
Branch to clone | default branch |
--outputDir |
-o |
Output directory | prompted |
--input |
-i |
Values file path | - |
--prompt |
-p |
Interactive mode | false |
--verbose |
-v |
Show detailed output | false |
--noCache |
--nc |
Bypass cache, fetch fresh data | false |
Examples
# Fully interactive
yankrun generate --prompt --verbose
# Filter templates and auto-select
yankrun generate --template "go-service" --outputDir ./new-service
# Dry run - shows cached placeholders without cloning
yankrun generate --template "go-service" --dryRun
# Force fresh data (skip cache)
yankrun generate --template "go-service" --noCache --outputDir ./new-service
# Non-interactive with values
yankrun generate \
--template "api-template" \
--branch main \
--input values.yaml \
--outputDir ./new-apiCaching: The generate command caches GitHub-discovered repos and template variables in ~/.yankrun/cache.yaml. Dry runs use cached data when available, avoiding re-cloning. Use --noCache to force fresh data.
Open a local web workbench for local directories, direct clones, and configured templates.
yankrun serve --dir ./my-project --input values.yamlThe server binds to 127.0.0.1:17817 by default. It is intended for local use and shares the same parser, cloner, and replacer logic as the CLI commands.
All flags
| Flag | Alias | Description | Default |
|---|---|---|---|
--dir |
-d |
Directory for local scan/apply | - |
--input |
-i |
Values file path | - |
--addr |
Listen address | 127.0.0.1:17817 |
|
--startDelim |
--sd |
Template start delimiter | [[ |
--endDelim |
--ed |
Template end delimiter | ]] |
--fileSizeLimit |
--fl |
Skip files larger than this limit | 3 mb |
--processTemplates |
--pt |
Process .tpl files |
false |
--onlyTemplates |
--ot |
Only process .tpl files |
false |
--dryRun |
--dr |
Force preview-only mode | false |
--ignore |
Glob patterns to skip | - | |
--verbose |
-v |
Show detailed output | false |
The workbench provides:
- Local mode for a directory passed with
--dir - Clone mode for SSH or HTTPS repositories
- Generate mode for
~/.yankrun/config.yamltemplates and GitHub-discovered templates - file-level placeholder trees so you can see what will change
- evaluated transform previews, for example
APP_NAME:toUpperCase -> MYAPP - idle refresh after value edits so previews stay current
- editable delimiters in the browser — change the
[[]]pair shown next to the directory path and click Set to rescan the whole workbench (Local, Clone, and Generate) with the new pair, no restart needed - saved presets stored in browser IndexedDB, searchable by repo/template/branch/output/value keys
- preset JSON export/import for moving saved runs between browsers
Open a preview-first terminal workflow for local directory templating.
yankrun tui --dir ./my-project --input values.yaml
yankrun tui --dir ./my-project --dryRunThe TUI is intentionally conservative: it scans, summarizes, previews the replacement count, and respects --dryRun before writing.
Use serve when you want to inspect a template repo before writing it to disk, reuse values across repeated runs, or compare where placeholders appear.
Typical flow:
- Start the server with an optional local directory and values file.
- Use Local, Clone, or Generate mode.
- If your files use a different delimiter pair, edit it next to the directory path and click Set to rescan — no restart needed.
- Click Preview before applying.
- Edit values; evaluated previews refresh after a short idle delay.
- Restore prior work from the left preset rail when repeating a repo/template.
Delimiters set from the browser apply to every mode (Local, Clone, Generate) for the rest of the session; a rejected change (empty, identical, or overlapping delimiters) leaves the previous pair active and shows the reason in the notice banner.
For clone mode:
Repository URL: https://github.com/AxeForging/template-tester.git
Branch: main
Output directory: ./my-new-project
SSH URLs also work when your local environment has the needed SSH key or agent configured:
git@github.com:AxeForging/template-tester.git
Presets stay local to the browser unless exported manually as JSON.
Configure YankRun defaults.
# Interactive setup
yankrun setup
# Show current config
yankrun setup --show
# Reset/delete config
yankrun setup --reset# Directories to skip (optional)
ignore_patterns:
- node_modules
- dist
- .git
- vendor
- __pycache__
# Variables to replace (required)
variables:
- key: APP_NAME
value: MyApplication
- key: PACKAGE_NAME
value: com.example.myapp
- key: AUTHOR_NAME
value: Jane Developer
- key: AUTHOR_EMAIL
value: jane@example.com
- key: VERSION
value: "1.0.0"
- key: DESCRIPTION
value: "A sample application"
- key: LICENSE
value: MIT
- key: YEAR
value: "2024"{
"ignore_patterns": ["node_modules", "dist", ".git"],
"variables": [
{ "key": "APP_NAME", "value": "MyApplication" },
{ "key": "PACKAGE_NAME", "value": "com.example.myapp" },
{ "key": "AUTHOR_NAME", "value": "Jane Developer" },
{ "key": "AUTHOR_EMAIL", "value": "jane@example.com" },
{ "key": "VERSION", "value": "1.0.0" }
]
}- Keys without delimiters are automatically wrapped:
APP_NAME→[[APP_NAME]] - Keys with delimiters are used as-is:
{{APP_NAME}}stays{{APP_NAME}}
Apply transformations to values using the colon syntax:
[[KEY:function]]
[[KEY:function1:function2]]
| Function | Description | Example | Input → Output |
|---|---|---|---|
toUpperCase |
Convert to UPPERCASE | [[NAME:toUpperCase]] |
hello → HELLO |
toLowerCase |
Convert to lowercase | [[NAME:toLowerCase]] |
HELLO → hello |
toDownCase |
Alias for toLowerCase | [[NAME:toDownCase]] |
HELLO → hello |
gsub(a,b) |
Replace a with b |
[[NAME:gsub(-,_)]] |
my-app → my_app |
Functions are applied left-to-right:
[[PROJECT_NAME:gsub( ,-):toLowerCase]]
Input: "My Cool Project"
Step 1: "My-Cool-Project" (gsub replaces spaces with dashes)
Step 2: "my-cool-project" (toLowerCase)
Output: "my-cool-project"
# [[PROJECT_NAME]]
Package: [[PACKAGE_NAME:toLowerCase]]
Constant: [[PACKAGE_NAME:toUpperCase]]
URL Slug: [[PROJECT_NAME:gsub( ,-):toLowerCase]]
Database: [[APP_NAME:gsub(-,_):toLowerCase]]_dbYankRun stores configuration in ~/.yankrun/config.yaml.
# Default delimiters for all commands
start_delim: "[["
end_delim: "]]"
# Default file size limit
file_size_limit: "3 mb"
# Pre-configured templates for `generate` command
templates:
- name: "Go Microservice"
url: "git@github.com:your-org/go-service-template.git"
description: "Production-ready Go microservice"
default_branch: "main"
- name: "React Application"
url: "https://github.com/your-org/react-template.git"
description: "React + TypeScript + Vite starter"
default_branch: "main"
- name: "Python CLI"
url: "git@github.com:your-org/python-cli-template.git"
description: "Click-based Python CLI tool"
default_branch: "main"
# GitHub auto-discovery (optional)
github:
user: "your-username"
orgs:
- "your-org"
- "another-org"
topic: "template" # Only repos with this topic
prefix: "template-" # Only repos starting with this
include_private: true # Include private repositories
token: "ghp_xxxxxxxxxxxx" # Required for private reposCreate a Go project from template
# go-values.yaml
variables:
- key: MODULE_NAME
value: github.com/myorg/myservice
- key: SERVICE_NAME
value: user-service
- key: AUTHOR
value: Platform Team
- key: GO_VERSION
value: "1.22"yankrun clone \
--repo git@github.com:myorg/go-template.git \
--input go-values.yaml \
--outputDir ./user-service \
--verboseCreate a React app from template
# react-values.yaml
variables:
- key: APP_NAME
value: my-dashboard
- key: APP_TITLE
value: My Dashboard
- key: DESCRIPTION
value: Admin dashboard for managing usersyankrun clone \
--repo https://github.com/myorg/react-template.git \
--input react-values.yaml \
--outputDir ./my-dashboard \
--processTemplates \
--verboseUpdate version across a monorepo
# version-bump.yaml
variables:
- key: OLD_VERSION
value: "1.2.3"
- key: VERSION
value: "1.3.0"# First, manually replace OLD_VERSION with [[VERSION]] placeholders
# Then run:
yankrun template \
--dir ./packages \
--input version-bump.yaml \
--verboseCI/CD pipeline usage
# .github/workflows/create-service.yml
name: Create Service
on:
workflow_dispatch:
inputs:
service_name:
description: 'Service name'
required: true
jobs:
create:
runs-on: ubuntu-latest
steps:
- name: Create values file
run: |
cat > values.yaml << EOF
variables:
- key: SERVICE_NAME
value: ${{ github.event.inputs.service_name }}
- key: CREATED_BY
value: ${{ github.actor }}
EOF
- name: Generate service
run: |
yankrun clone \
--repo ${{ secrets.TEMPLATE_REPO }} \
--input values.yaml \
--outputDir ./output \
--verbosePlaceholders not being replaced
- Check delimiters match: Ensure your template uses
[[KEY]](or your custom delimiters) - Check key names match exactly:
APP_NAME≠app_name - Use verbose mode:
--verboseshows which files are processed - Check file size: Files over 3MB are skipped by default
yankrun template --dir ./project --input values.yaml --verboseFile being skipped
Files are skipped if:
- They exceed
--fileSizeLimit(default 3MB) - They're in ignored directories (
.git,node_modules,vendor, etc.) - They're binary files
Increase the limit if needed:
yankrun template --dir ./project --input values.yaml --fileSizeLimit "50 mb"Git clone fails
- Check URL: Ensure the repo URL is correct
- Check authentication: For SSH, ensure your key is loaded (
ssh-add -l) - Check network: Ensure you can reach GitHub/GitLab
# Test git access directly
git clone https://github.com/org/repo.git /tmp/test-clonePermission denied on install
Use sudo or install to a user directory:
# Option 1: Use sudo
sudo mv yankrun /usr/local/bin/
# Option 2: Install to user bin (add to PATH)
mkdir -p ~/.local/bin
mv yankrun ~/.local/bin/
export PATH="$HOME/.local/bin:$PATH"- Documentation: GitHub Repository
- Issues: GitHub Issues
- AI Reference: See docs/AI/README.md for technical details