|
1 | 1 | # spin |
2 | 2 |
|
3 | | -Scaffolder that doesn't care what language or framework you use. Point it |
4 | | -at a template directory with a `spin.toml` and a `_base/` tree, it asks |
5 | | -the template's questions, renders the files, runs the hooks. Done. |
| 3 | +A project scaffolding CLI for any language, framework, or stack, enabling developers to bootstrap fully configured projects from reusable templates sourced from GitHub, local directories, or template registries. |
6 | 4 |
|
7 | | -```sh |
8 | | -spin new myapp https://github.com/spin-templates/charm-tui.git |
| 5 | +```bash |
| 6 | +spin new myapp https://github.com/user/spin-template.git |
9 | 7 | ``` |
10 | 8 |
|
11 | | - |
12 | | - |
13 | 9 | ## Install |
14 | 10 |
|
15 | | -```sh |
| 11 | +```bash |
16 | 12 | go install github.com/N1xev/spin@latest |
17 | | - |
18 | | -# or |
19 | | - |
20 | 13 | curl -sSfL https://spincli.pages.dev/install.sh | sh |
21 | 14 | ``` |
22 | 15 |
|
23 | | -Needs `git` on `$PATH`. Single static binary, nothing else. |
24 | | - |
25 | | -## Use |
26 | | - |
27 | | -```sh |
28 | | -spin new myapp ./templates/go-cli # local path |
29 | | -spin new myapp https://github.com/me/repo.git # git URL |
30 | | -spin new myapp go-cli-template # pinned name |
31 | | -spin new myapp official/go-cli # registry shorthand |
32 | | - |
33 | | -spin add https://github.com/me/repo.git # pin for offline |
34 | | -spin list # show pins |
35 | | -spin update go-cli-template # refresh cache |
36 | | -spin remove go-cli-template # unpin |
37 | | -spin search tui # search registries |
38 | | -spin registry add official https://... # register a registry |
39 | | -spin init my-tpl # create a template |
40 | | -``` |
41 | | - |
42 | | -Non-interactive: |
43 | | - |
44 | | -```sh |
45 | | -spin new myapp go-cli --param port=8080 --param name=myapp |
46 | | -spin new myapp go-cli --print-params # show params, no write |
47 | | -spin new myapp go-cli --dry-run # show files, no write |
48 | | -spin new myapp go-cli --no-hooks # skip hooks |
| 16 | +Single static binary. Needs git on $PATH. |
| 17 | + |
| 18 | +## Commands |
| 19 | + |
| 20 | +| Command | Description | |
| 21 | +| -------------------------------- | -------------------------------------- | |
| 22 | +| `spin new [name] [template]` | Scaffold a project from a template | |
| 23 | +| `spin add [spec]` | Pin a template locally for offline use | |
| 24 | +| `spin list` | Show pinned templates | |
| 25 | +| `spin update [name]` | Refresh a pin's cache | |
| 26 | +| `spin remove [name]` | Remove a pin (--purge deletes cache) | |
| 27 | +| `spin search [query]` | Search registered registries | |
| 28 | +| `spin registry add [name] [url]` | Register a registry | |
| 29 | +| `spin registry list` | Show registries | |
| 30 | +| `spin init [name]` | Scaffold a new template directory | |
| 31 | + |
| 32 | +## Template Specs |
| 33 | + |
| 34 | +```txt |
| 35 | +./templates/go-cli local path |
| 36 | +https://github.com/me/repo.git git URL |
| 37 | +go-cli-template pinned name |
| 38 | +official/go-cli registry shorthand |
49 | 39 | ``` |
50 | 40 |
|
51 | | -## Template |
| 41 | +## Template Anatomy |
52 | 42 |
|
53 | | -``` |
| 43 | +```txt |
54 | 44 | my-template/ |
55 | | - spin.toml # params, hooks, include rules |
56 | | - _base/ # file tree → project |
| 45 | + spin.toml params, hooks, include/exclude rules |
| 46 | + _base/ directory tree rendered into the project |
| 47 | + _pre/ scripts run before rendering |
| 48 | + _post/ scripts run after rendering |
57 | 49 | ``` |
58 | 50 |
|
59 | | -`spin init my-template` writes a starter. Full docs: https://spincli.pages.dev |
60 | | - |
61 | 51 | ## License |
62 | 52 |
|
63 | | -[Apache 2.0](./LICENSE) |
64 | | - |
| 53 | +Spin is licensed under [Apache 2.0](./LICENSE) |
0 commit comments