π³ Mirror
A command-line utility that creates projects from mirrors
(project templates)
Table of Contents
Features
- No dependencies (NodeJS, Python Interpreter etc.) - Mirror is a single statically linked binary.
Grab the one that fits your architecture, and you're all set to save time by using templates!
- Full Power of Golang Templates - Golang has powerful templating
constructs which are very easy to learn and powerful.
- Dead-Simple Template Creation - Creating boilerplate templates are very easy, check out
the license template to see a simple, but very useful template for
adding licenses to new projects with a single command.
Installation
Our home management system, Casa, is shipped with the most recent version of Mirror
via lunarispkgs
Binaries for Windows, Mac, and Linux are officially supported. You can download them directly, from the release page, or run the installation script.
Please see Installation page for more information.
Getting Started
To see all available options:
mirror help
Download a Mirror
In order to download a mirror from a github repository, use the following command:
mirror download <github-repo-path> <mirror-tag>
mirror download lunaris-studios/mirror-license license
The downloaded template will be saved to local mirror
registry.
Save a Local Template
In order to save a template from filesystem to the template registry use the following command:
mirror save <mirror-path> <mirror-tag>
mirror save ~/mirror-license license
The saved template will be saved to local mirror
registry.
Create a template
For a mirror template with the given directory structure:
.
βββ project.json
βββ README.md
βββ template
βββ LICENSE
And the following project.json
context file:
{
"Author": "John Doe",
"Year": "2020",
"License": ["Apache Software License 2.0", "MIT", "GNU GPL v3.0"]
}
When using the mirror with the following command:
mirror use <mirror-tag> <target-dir>
mirror use license /workspace/lunaris-studios/example-project/
The user will be prompted as follows:
[?] Please choose an option for "License"
1 - "Apache Software License 2.0"
2 - "MIT"
3 - "GNU GPL v3.0"
Select from 1..3 [default: 1]: 2
[?] Please choose a value for "Year" [default: "2015"]:
[?] Please choose a value for "Author" [default: "Tamer Tas"]:
[β] Created /workspace/lunaris-studios/example-project/LICENSE
[β] Successfully executed the project license in /workspace/lunaris-studios/example-project
For more information please take a look at Usage and Creating Templates pages in the wiki.
List of Templates
Take a look at the Templates page for an index of project templates, examples, and more information.