Blue is a .NET global tool for instantiating .NET templates directly from GitHub, GitLab or any Git repository.
It works like dotnet new, but unlike the latter, it does not require templates to be installed from NuGet beforehand.
.NET ships with a powerful template engine that makes it easy to scaffold new projects.
However, creating and distributing a template involves several tedious steps — packing, publishing to NuGet and installing. And repeating the whole cycle every time you update your template.
Blue eliminates all these steps. Any Git repository becomes a template you can instantly create a project from — no packing, no publishing, no prior installation required.
Install the one of the currently supported .NET SDKs and run:
dotnet tool install blue --global
If you already have a previous version installed, you can upgrade to the latest version using:
dotnet tool update blue --global
You will also need Git installed.
Usage is similar to dotnet new. To instantiate a template, run:
blue new <template> <template-args>
template specifies the source Git repository and can be one of the following:
{url}— full URL of the repository, e.g.https://github.com/npgsql/npgsql{url}@{version}— full URL with a specific branch or tag, e.g.https://github.com/npgsql/npgsql@v10.0.0{owner}/{repo}— shorthand for a GitHub repository, e.g.npgsql/npgsql{owner}/{repo}@{version}— GitHub repository with a specific branch or tag, e.g.npgsql/npgsql@v10.0.0
template-args are any additional template arguments typically passed to dotnet new, such as --name for the
project name.
For example, to create a project from the npgsql/npgsql repository:
blue new npgsql/npgsql --name MyNpgsql --output "my-npgsql"
Blue builds on top of .NET template engine, so all its capabilities are fully supported.
TODO...