Skip to main content
Projgen is a CLI tool for scaffolding new projects from declarative JSON templates. Instead of manually bootstrapping boilerplate every time, you define variables (user prompts) and steps (actions) in a single .json file — then let Projgen handle the rest: running shell commands, writing files, patching text or JSON configs, and cloning setups with a single command. Templates are portable, versionable, and composable. You can store them locally, share them via the official templates registry, or maintain your own private registry. The core CLI is available globally via npm and requires no configuration to get started.

The Projgen ecosystem

Projgen is made up of three layers that work together.

Projgen CLI

The command-line interface. Install it globally and use projgen create, add, list, and remove to run templates and manage your local registry. Currently on v3.

Template Engine

The internal engine that loads, validates, and executes template JSON. It resolves variables, evaluates when conditions, and dispatches steps through typed adapters. Currently on v3.1.

Official Templates

The Projgen/templates repository. A curated registry of ready-to-use templates — from sample starters to full TypeScript CLI setups.
The CLI and the Template Engine are versioned independently. The CLI is currently v3 and the Template Engine is v3.1. Your template’s engineVersion field declares which engine version it targets.

How it works

1

Install the CLI

Install globally with npm or run directly with npx — no config file required.
2

Write (or grab) a template

A template is a .json file with metadata, a variables array (user prompts), and a steps array (actions to run). Here is the minimal structure:
Or use an official template directly from the registry.
3

Run it

Point projgen create at the file path, url or a registry alias. Projgen validates the template, prompts for any declared variables, then executes all steps in order.

What a template can do

A template declares variables that are prompted before any work starts, and steps that consume those values.

Variables

Four types of input are supported: Variables are referenced inside step fields using {{variableName}} — in paths, commands, content, and JSON values.

Steps

Steps run in declaration order after all variables are collected. Any step can be guarded with a when condition array.

run

Execute a shell command. Supports command, args[], and optional cwd.

write

Create or overwrite a file. Content can be inline or fetched from a url.

patch-text

Surgically edit a text file: replace, insert-after, insert-before, append, or prepend.

patch-json

Modify a JSON file at a jsonPath using set, append, or remove.

Jump in

Quickstart

Run your first template in under two minutes.

Template spec

Full reference for variables, steps, and conditions.

Official templates

Browse ready-made templates maintained by the Projgen team.

GitHub

Source code, issues, and contributions.