Template Sources
The cre templates commands manage the GitHub repository sources that cre init uses to discover workflow templates.
The CLI always includes two built-in Hello World templates (hello-world-go, hello-world-ts) that are embedded in the binary and available without an internet connection. All other templates are fetched dynamically from GitHub. The Chainlink official template repository (smartcontractkit/cre-templates) is configured as the default source — you only need these commands if you want to add custom or third-party template sources.
cre templates list
Fetches and displays all templates available from your configured repository sources. Results are cached locally; use --refresh to fetch the latest data from GitHub.
Usage:
cre templates list [flags]
Flags:
| Flag | Description |
|---|---|
--refresh | Bypass the local cache and fetch fresh data from GitHub |
Each entry shows the template title, ID, language, and a short description. Use the ID with cre init --template=<id> to scaffold a project from that template.
For the current list of available templates, run cre templates list or visit docs.chain.link/cre-templates.
cre templates add
Adds one or more GitHub repositories as template sources. Sources are saved to ~/.cre/template.yaml and made available in cre init.
Usage:
cre templates add <owner/repo[@ref]>... [flags]
The @ref portion is optional and specifies a branch, tag, or commit. If omitted, the repository's default branch is used.
Examples:
# Add a single repository (uses default branch)
cre templates add myorg/my-templates
# Add at a specific branch
cre templates add myorg/my-templates@main
# Add multiple repositories at once
cre templates add myorg/my-templates anotherorg/more-templates
Example output:
✓ Added myorg/my-templates@main
Configured repositories:
- smartcontractkit/cre-templates@main
- myorg/my-templates@main
cre templates remove
Removes one or more template repository sources from ~/.cre/template.yaml. The @ref portion of a repo string is optional and ignored during matching — only the owner/repo is used to identify the source to remove.
Usage:
cre templates remove <owner/repo>... [flags]
Examples:
# Remove a single repository
cre templates remove myorg/my-templates
# Remove multiple repositories at once
cre templates remove myorg/my-templates anotherorg/more-templates
Example output:
✓ Removed myorg/my-templates@main
Remaining repositories:
- smartcontractkit/cre-templates@main
Learn more
- CRE Templates — Browse available Building Blocks and Starter Templates
- Project Setup Reference — Full reference for
cre init