Commands
spin new
Scaffold a new project from a template.
Usage
spin new [<name>] [<template>]
| Flag | Description |
|---|---|
-t, --template | Template spec (git URL, local path, pinned name, or <alias>/<id>). |
-d, --dest | Destination directory (default: ./<name>). |
--param | Set a param as key=value (repeatable). |
--print-params | Print resolved params as JSON and exit. |
--dry-run | Render to a temp directory and list files without writing. |
--verbose | Print hook output. |
--print-hooks | Print the template's hooks (pre/post/hook scripts) and exit. |
-y, --yes | Skip trust and overwrite prompts (non-interactive). |
--no-hooks | Skip [[pre]] and [[post]] hooks. |
Template specs
- Git URL:
https://github.com/example/go-cli-template.git - Local path:
~/templates/go-clior./go-cli - Pinned name:
go-cli-template - Registry shorthand:
official/go-cli
Examples
spin new myapp --template https://github.com/example/go-cli-template.git
spin new myapp --template go-cli-template --param port=8080
spin new myapp go-cli-template --dry-run
spin new ~/templates/go-cli --dry-run # treats path as template, prompts for name
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success. |
| 1 | Error. |
| 130 | User cancelled (SIGINT). |