🗞 What's new and special in Create Go App CLI v1.7.0?
Tags: go, news, productivity, cli
Published: 2021-02-26 10:38:05

## Introduction

Hey, DEV friends! 👋 Today, I'd like to introduce a new version of my own project [Create Go App CLI](https://github.com/create-go-app/cli), that changes some fundamental things.

[![Create Go App CLI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5xvj98txra1ne8x9m4r.png)](https://github.com/create-go-app/cli)

<a name="toc"></a>
### 📝 Table of contents

- [A new way to install and update CLI](#ch-1)
  - [How to install older versions?](#ch-1-1)
  - [Roadmap for improve this process](#ch-1-2)
- [Switch from my own realization for embed files to built-in feature in Go 1.16.x](#ch-2)
- [Switch from Taskfile.yml to simple `Makefile`s](#ch-3)
- [Add support for Apple Silicon CPUs](#ch-4)

<a name="#ch-1"></a>
## A new way to install and update CLI

Since `v1.7.0`, I dropped support Golang versions `1.11.x`, `1.12.x`, `1.13.x`, `1.14.x` and `1.15.x`. A minimal Go version for build CLI from a source is now `1.16.x` (and higher). Therefore, old way to install by `go build -i ...` command isn't relevant. 

Please, use this command to install or update to a latest version:

```bash
go install -ldflags="-s -w" github.com/create-go-app/cli@latest
```

Next, just rename binary, like this:

```bash
mv $GOPATH/bin/cli $GOPATH/bin/cgapp
```

Also, macOS and GNU/Linux users available way to install via [Homebrew](https://brew.sh/):

```bash
# Tap a new formula:
brew tap create-go-app/cli

# Installation:
brew install create-go-app/cli/cgapp
```

[↑ Table of contents](#toc)

<a name="#ch-1-1"></a>
### How to install older versions?

You can do it by using a version suffix in `go install` command:

```bash
# With an indication of the exact versions:
go install github.com/create-go-app/cli@1.6.0
```

Don't forget to **rename** binary after installation, according to the version you have installed! This must be done to avoid confusion with the latest version.

For example: 

```bash
mv $GOPATH/bin/cli $GOPATH/bin/cgapp_v1_6_0
```

And run it by `cgapp_v1_6_0 [COMMAND]`.

> ☝️ Found all available CLI versions on [pkg.go.dev](https://pkg.go.dev/github.com/create-go-app/cli?tab=versions) page.

[↑ Table of contents](#toc)

<a name="#ch-1-2"></a>
### Roadmap for improve this process

- TODO: Add version for [Snapcraft](https://snapcraft.io/) (for GNU/Linux users).
- TODO: Add version for [Scoop](https://scoop.sh/) (for MS Windows users).

> It would be great to read in the comments about what other installation method would be convenient for you! 😌

[↑ Table of contents](#toc)

<a name="#ch-2"></a>
## Switch from my own realization for embed files to built-in feature in Go 1.16.x 

Previously, to implement embedded configuration files, I used this method I described in this article in great detail:

{% post koddr/the-easiest-way-to-embed-static-files-into-a-binary-file-in-your-golang-app-no-external-dependencies-43pc %}

But, a new package [embed](https://pkg.go.dev/embed) in Golang `1.16.x` standard library, can do it natively, with a maximum smooth and fully DX (developer experience). So, personally, I was very much looking forward to this opportunity and immediately took advantage of it!

> 👉 Look at how much easily this code looks [now](https://github.com/create-go-app/cli/blob/master/pkg/registry/defaults.go#L86-L108) and how it looked in the [past](https://github.com/create-go-app/cli/tree/v1.6.12/pkg/embed). At the same time, this code performs the same function: it adds the config files to the binary. How magical it is!

[↑ Table of contents](#toc)

<a name="#ch-3"></a>
## Switch from Taskfile.yml to simple `Makefile`s

Yes, I thought I could replace the good old `Makefile` with some modern solution for automating commonly used commands for a project... but I was wrong! So, I made the willful decision to go back to the roots.

[![Makefile](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w4ni3zt6a4uu0ako2nrf.png)](https://github.com/create-go-app/cli/blob/master/Makefile)

In this version (and later), support for [Taskfile](https://taskfile.dev/) will be dropped throughout the Create Go App project (both in the CLI and in production-ready templates).

> Make a `make run` not a `task run` now.

I say "thank you" to the [developers](https://github.com/go-task/task/graphs/contributors) of this tool, but habit is much stronger! 😉

[↑ Table of contents](#toc)

<a name="#ch-4"></a>
## Add support for Apple Silicon CPUs

Now, in assets of every release (at GitHub repository), I put special binary version for beautiful working Create Go App CLI on the Mac computers with Apple-designed processors (`M1` and higher).

[![version for Apple Silicon CPUs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lu8sf35edt733gzmi2u0.png)](https://github.com/create-go-app/cli/releases/tag/v1.7.0)

> [Wikipedia](https://en.wikipedia.org/wiki/Apple-designed_processors#M_series): The M1 chip, Apple's first processor designed for use in Macs, is manufactured using TSMC's 5 nm process. It was announced on November 10, 2020, and is used in the M1 MacBook Air, Mac mini, and MacBook Pro (2020).

[↑ Table of contents](#toc)

<a name=""></a>
## Photos by

- Tim Mossholder https://unsplash.com/photos/H6eaxcGNQbU

<a name=""></a>
## P.S.

If you want more articles (like this) on this blog, then post a comment below and subscribe to me. Thanks! 😻

And of course, you can help me make developers' lives even better! Just connect to one of my projects as a contributor. It's easy!

My projects that need your help (and stars) 👇

- 🔥 [gowebly][gowebly_url]: A next-generation CLI tool for easily build amazing web applications with Go on the backend, using htmx & hyperscript and the most popular atomic/utility-first CSS frameworks on the frontend.
- ✨ [create-go-app][cgapp_url]: Create a new production-ready project with Go backend, frontend and deploy automation by running one CLI command.
- 🏃 [yatr][yatr_url]: Yet Another Task Runner allows you to organize and automate your routine operations that you normally do in Makefile (or else) for each project.
- 📚 [gosl][gosl_url]: The Go Snippet Library provides snippets collection for working with routine operations in your Go programs with a super user-friendly API and the most efficient performance.
- 🏄‍♂️ [csv2api][csv2api_url]: The parser reads the CSV file with the raw data, filters the records, identifies fields to be changed, and sends a request to update the data to the specified endpoint of your REST API.
- 🚴 [json2csv][json2csv_url]: The parser can read given folder with JSON files, filtering and qualifying input data with intent & stop words dictionaries and save results to CSV files by given chunk size.

<!-- Footer links -->

[gowebly_url]: https://github.com/gowebly
[cgapp_url]: https://github.com/create-go-app
[yatr_url]: https://github.com/koddr/yatr
[gosl_url]: https://github.com/koddr/gosl
[csv2api_url]: https://github.com/koddr/csv2api
[json2csv_url]: https://github.com/koddr/json2csv