Libraries are sources of templates. A library can be a Git repository or a local directory, and Boilerplates searches them in priority order.
By default, Boilerplates points to the official template library:
Name: default
URL: https://github.com/christianlempa/boilerplates-library.git
Branch: main
Directory: .
gitstaticlibraries:
- name: default
type: git
url: https://github.com/christianlempa/boilerplates-library.git
branch: main
directory: .
libraries:
- name: local
type: static
path: ~/my-templates
Git libraries are stored under the active config directory's libraries/ folder.
Global-config default:
~/.config/boilerplates/libraries/
If the CLI is using a local ./config.yaml, the library checkout location becomes ./libraries/.
The configured directory is applied inside that checkout. For the official library the directory is ..
By default, Boilerplates uses:
~/.config/boilerplates/config.yaml
If a local ./config.yaml exists in your current working directory, the CLI uses that file instead.
Boilerplates discovers templates by module directory, for example:
compose/
terraform/
ansible/
A directory is treated as a template only when it contains template.json.
Legacy template.yaml and template.yml directories are ignored during discovery.
List configured libraries:
boilerplates repo list
Sync Git libraries:
boilerplates repo update
Add a custom Git library:
boilerplates repo add my-templates \
--library-type git \
--url https://github.com/user/templates \
--directory . \
--branch main
Add a static library:
boilerplates repo add local \
--library-type static \
--path ~/my-templates
Remove a library:
boilerplates repo remove my-templates
Libraries are checked in config order. The first matching template wins when you use a simple ID.
Example:
libraries:
- name: local
type: static
path: ~/my-templates
- name: default
type: git
url: https://github.com/christianlempa/boilerplates-library.git
branch: main
directory: .
Simple ID:
boilerplates compose generate nginx
Qualified ID:
boilerplates compose generate nginx.local
boilerplates compose generate nginx.default
Templates with metadata.draft: true are excluded from normal listings and lookup.
Example:
libraries:
- name: default
type: git
url: https://github.com/christianlempa/boilerplates-library.git
branch: main
directory: .
- name: local
type: static
path: /Users/me/my-templates