You can use a variety of different templates when creating new spike projects, and these templates can be controlled through a set of CLI options under
spike tpl (see CLI docs for more details). Let's go over a couple of the tools you can use to use and manipulate templates.
Writing your own project template is super simple. Take a look at the spike default template, and read over sprout's short guide to writing your own templates. You can publish and load your templates directly through github.
To add a new template, you can use the add template command. For example:
$ spike tpl add mytemplate https://github.com/user/repo
As long as you have entered in a valid clone-able URL as the template source, it should work out fine. To view all your existing templates, you can run
spike tpl list, and verify that it has been added.
So you have added your custom template, now it's time to fire it up! To create a new project, you can use the new command and pass a
--template flag (or
-t for short) with the name of your template. For example:
$ spike new testproject -t mytemplate
That's all it takes! As long as your template is valid, the project will be created with yours instead of the default template
Perhaps you don't really like our default template, and you have your own custom one. You can set your custom template as the default for new projects so you don't need to use the
-t option every time using the default template command. For example:
$ spike tpl default mytemplate
Now the next time you run
spike new, it will use your custom template as the default.
Sometimes you want to get rid of a template that you are replacing or no longer need. This is fairly simple, just use the remove template command. For example:
$ spike tpl remove mytemplate
As long as the template has been added in the past, it should now be removed from your list, which you can verify with
spike tpl list.
If something has gone really wrong with your templates, or you would just like to wipe the slate clean, and start from the defaults, you use the reset template command. For example:
$ spike tpl reset
This will remove all templates and default preferences, like when spike was first installed.
Updated less than a minute ago