Commands

spin new

Scaffold a new project from a template.

Usage

spin new [<name>] [<template>]
FlagDescription
-t, --templateTemplate spec (git URL, local path, pinned name, or <alias>/<id>).
-d, --destDestination directory (default: ./<name>).
--paramSet a param as key=value (repeatable).
--print-paramsPrint resolved params as JSON and exit.
--dry-runRender to a temp directory and list files without writing.
--verbosePrint hook output.
--print-hooksPrint the template's hooks (pre/post/hook scripts) and exit.
-y, --yesSkip trust and overwrite prompts (non-interactive).
--no-hooksSkip [[pre]] and [[post]] hooks.

Template specs

  • Git URL: https://github.com/example/go-cli-template.git
  • Local path: ~/templates/go-cli or ./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

CodeMeaning
0Success.
1Error.
130User cancelled (SIGINT).