Scaffold a project
Quick example
spin new myapp https://github.com/example/go-cli-template.git
spin opens a two-step interactive form: params first, then hook review with Run / Skip / Cancel. It renders the _base/ tree into ./myapp and runs [[post]] steps.

Template specs
--template accepts any of these:
| Spec | Example |
|---|---|
| Git URL | https://github.com/example/go-cli-template.git |
| Local path | ~/code/templates/go-cli or ./go-cli |
| Pinned name | go-cli-template |
| Registry shorthand | official/go-cli |
You can also pass the template positionally:
spin new myapp https://github.com/example/go-cli-template.git
If you pass a single positional argument that looks like a template spec, spin treats it as the template and prompts for the project name:
spin new ~/code/templates/go-cli
Params
Templates declare params in spin.toml. By default spin new opens an interactive form. In scripts or CI, pass every param with --param:
spin new myapp --template go-cli \
--param port=8080 \
--param verbose=true \
--param features=auth,db
Type coercion:
| Param type | CLI format |
|---|---|
| text | --param name=myapp |
| textarea | --param description="A short description" |
| number | --param port=8080 |
| select | --param license=MIT |
| multiselect | --param features=auth,db |
| bool | --param private=true |
| path | --param output_dir=/tmp/out |
| secret | --param api_key=secret |
Preview modes
Print the resolved params without writing files:
spin new myapp --template go-cli --print-params
List the files that would be written:
spin new myapp --template go-cli --print-hooks
spin new myapp --template go-cli --dry-run
--print-hooks shows the hooks without running them. --dry-run renders to a temp
directory and lists the files without writing. Both imply non-interactive and do not
run [[post]] steps.
Destination
By default the project is written to ./<name>. Use --dest to change the directory:
spin new myapp --template go-cli --dest ~/projects/myapp
CI/CD
In CI, pass every param and use --yes to skip prompts. Redirect stdin so spin detects non-interactive mode:
# GitHub Actions
- name: Scaffold project
run: |
curl -sSfL https://spincli.pages.dev/install.sh | sh
spin new myapp --template official/go-cli \
--param project_name=myapp \
--param license=MIT \
--param private=false \
--yes \
--dest ./output \
< /dev/null
# Generic shell
spin new myapp --template official/go-cli \
--param project_name=myapp \
--param license=MIT \
--yes \
< /dev/null
Add --verbose if you want hook output in CI logs. Add --print-params first to preview what will be resolved before committing to a run.