Brick Building With Mason CLI
So you're a Software Engineer - Now lets look at making life a little easier with a new tool!
As software engineers, we are (or at least should be) constantly looking for ways to improve our efficiency. Creating software is a difficult craft to master, and takes a great deal of time.
Enter Mason CLI.  mason 
is a code generation tool created by Felix Angelov, a developer who works at Shorebird. Shorebird was started by Eric Seidel, one of the driving forces and lead developers for Google's Flutter project. It should then come as no surprise that it is written in the Dart programming language. However, its utility is not limited to Dart projects, you can use it to create templates for any type of text-based project.
First, you will need to install Dart. Instructions for that can be found here. Once  dart 
is installed then you can use it to install the Mason CLI globably using the following command:
$ dart pub globbl activate mason_cli
Now that we have the Mason CLI installed, we can create our own templates! First we create a folder where you want to use Mason and run the `init` command:
 mason init 
will create a `mason.yml` file within the current directory. As mentioned in the generated file, you can import bricks from the [Brickhub website](https://brickhub.dev) which allows you to search for bricks that you can import by adding it to our `mason.yaml` file and running the `bricks get` command.
For the purposes of this post, I am more interested in creating our own bricks that we can then use for code generation. For a simple example, let's create a new brick that will create a markdown file that gives a header, author name, and date.
Run the `mason new` command to create a new brick.
$ mason new blog_post_md
Now you should have a new directory named `blog_post_md` which contains the files `brick.yml`, `README.md`, `CHANGELOG.md`, and `LICENSE`, there is also a directory named `__brick__`, which is where our template lives. The templating engine that is used is called `mustache` which you can learn more about here. Within the `__brick__` folder, it has created a file for us called `HELLO.md`. The `brick.yml` file is where we can define variables for our template, contained within that file there is some information about what variables can be defined and an example variable given. Now lets add our own variables, we'll add three variables all of `type` `string`, those variables will be `filename`, `title`, `author`, and `date`.
Now that we have our variables in place, we can modify the `HELLO.md` file that was created for us so that it will be populated with the variables that we have specified. First, we will change the name of our file to  {{filename}}.md 
so that it will use the variable given by the user of our brick. We will then change the contents of our markdown file to use the variables `title`, `author`, and `date`.
Great! We now have a brick that can be used and then re-used. Now we go back out to the first directory that we created, and modify our `mason.yml` file to use our newly created brick. Within the `bricks` block, we'll add the name of our brick, I called mine `blog_post_md` it is contained within the same directory so the path is just `blog_post_md`.
We can then `get` our brick and any other bricks registered in our `mason.yaml` file by running the `mason get` command:
$ mason get
We then use it using the `make` command
mason make blog_post_md
Mason then prompts for the defined variables, and outputs our markdown file with the given filename and contents with our variables in the desired locations.
Here we have just scratched the surface of the capabilities of Mason. Besides the `brick.yml` file, you can also provide pre- and post-scripts written in Dart. Currently, I am just getting my feet wet with the tool as well, so I am going to create a starter template for our companies development stack Lightning Server, and KiteUI based on the current starter repo LS KiteUI Starter. As of this writing my template is not very complete, but I will be making updates to it in order to provide a lot more utility, perhaps add options where you have no server component. I will be adding other templates, such as a feature template that will generate the necessary boilerplate / structure for a new feature using best practices for our development stack. Those templates will exist here LK Bricks!