A fast, single-binary CLI for scaffolding files and projects.
new index.html
new my-app --template reactgo install github.com/DevShedLabs/new@latestOr build from source:
git clone https://github.com/DevShedLabs/new
cd new
go build -o new .Detects the file type by extension and generates smart boilerplate automatically.
new index.html # HTML5 skeleton
new main.go # Go package main
new styles.css # CSS reset + box-sizing
new app.ts # TypeScript module stub
new script.sh # Bash shebang + set -euo pipefail
new data.json # Empty JSON object
new notes.md # Markdown heading
new index.php # Empty file (no built-in template)Any extension without a built-in template creates an empty file.
A trailing slash or a name with no extension creates a directory (mkdir -p).
new assets/css/ # creates assets/css/
new src/components/ # creates src/components/
new src/components/Button # no extension — creates a directoryUse --template (or -t) to scaffold a full project from a built-in template or user blueprint.
new my-site --template html
new my-app --template react
new my-app --template my-blueprint # user blueprint from ~/.new/blueprints/The project is created as a subdirectory of the current working directory.
new listShows all built-in templates and any user blueprints in ~/.new/blueprints/, with descriptions.
new blueprint capture <name> # capture current directory
new blueprint capture <name> <path> # capture a specific directorySnapshots a project into ~/.new/blueprints/<name>/ so it can be reused as a template. Build artifacts (node_modules, .git, vendor, dist, build, .next, __pycache__, .venv) are excluded automatically. A blueprint.yaml manifest is generated if one doesn't exist.
new --versionnew updateInstalls the latest tagged release directly from GitHub, bypassing any local cache.
Completion scripts are generated by new completion <shell>. Follow the steps for your shell:
Zsh (macOS with Homebrew)
new completion zsh > /opt/homebrew/share/zsh/site-functions/_newStart a new shell session to activate.
Zsh (Linux)
new completion zsh > ~/.zsh/completions/_new
# Add to ~/.zshrc if not already present:
# fpath=(~/.zsh/completions $fpath)
# autoload -Uz compinit && compinitBash (macOS with Homebrew)
new completion bash > /opt/homebrew/etc/bash_completion.d/newBash (Linux)
new completion bash > /etc/bash_completion.d/newFish
new completion fish > ~/.config/fish/completions/new.fishPowerShell
new completion powershell >> $PROFILE| Flag | Short | Description |
|---|---|---|
--template |
-t |
Template or blueprint name |
--output |
-o |
Output directory (default: current directory) |
--var key=value |
-v |
Pass variables to the template (repeatable) |
Example with variables:
new my-app --template react --var Author="Jeffrey"| Template | Description |
|---|---|
html |
HTML5 project with index.html, css/main.css, js/main.js |
react |
Vite + React + TypeScript starter |
Blueprints are user-defined templates that live in ~/.new/blueprints/. Any blueprint directory placed there is immediately available as a --template value.
Blueprint resolution order:
~/.new/blueprints/<name>/— user blueprints take precedence- Built-in embedded templates
This means you can override any built-in template by creating a blueprint with the same name.
A blueprint is just a folder of files. Template variables are rendered using Go's text/template syntax — {{.Name}}, {{.Author}}, etc.
~/.new/blueprints/
└── my-blueprint/
├── blueprint.yaml # optional manifest
├── index.html
└── src/
└── main.js
Variable names in file paths are also rendered:
src/{{.Name}}.go → src/my-app.go
The manifest is optional but recommended. It documents the blueprint and declares expected variables.
name: my-blueprint
description: My custom project starter.
vars:
- Name
- Author
defaults:
Author: "Your Name"| Variable | Value |
|---|---|
{{.Name}} |
The project name passed as the first argument |
{{.Template}} |
The template/blueprint name |
Any --var flag |
--var Foo=bar → {{.Foo}} |
| Blueprint defaults | Defined in blueprint.yaml under defaults |
- Icon and favicon generation
- Variable prompting for blueprints that declare
vars - Remote blueprint fetching
MIT