DEV Community

Cover image for โœจ A powerful CLI for create a new production-ready project with backend, frontend and deploy automation
Vic Shรณstak
Vic Shรณstak

Posted on • Updated on

โœจ A powerful CLI for create a new production-ready project with backend, frontend and deploy automation


Hello, friends! ๐Ÿ˜‰ Today, I'd like to present you my own CLI for automation many things for starting a new project. I called it Create Go App (or CGAPP for short).

The main idea was to create a universal tool for full automation of the project start when you don't need to install everything you need separately.

What did it come out of? Let's look at it together!

๐Ÿ“ Table of contents

Another CLI?

And yes and no.

When I started this project, I asked ourselves this question too and... came to the conclusion, that approximately 8 out of 10 routine operations at the start of a new project and/or the deployment of an existing one can be automated.

And it would be better to have all the necessary functions inside one CLI. That's why we transferred all our experience to the Create Go App, which we use ourselves!

So, yes, this CLI gives you the ability to prepare everything you need to start a new project (as create-react-app for the React.js ecosystem does) and deploy an existing project to a remote server in configured and fully isolated Docker containers.

Focus on writing code and thinking of business logic! The Create Go App CLI will take care of the rest.

โ†‘ Table of contents

How does it work?

This is a common console utility, written on pure Golang. Therefore, download and install Go. Version 1.11 or higher is required. Next, download the latest version of the Create Go App and install to your system:

# Download
go get

# Install CLI
go build -i -o $GOPATH/bin/cgapp
Enter fullscreen mode Exit fullscreen mode

If you don't want to install Create Go App CLI to your system, you feel free to using the Official Docker image:

docker run --rm -it -v ${PWD}:${PWD} -w ${PWD} koddr/cgapp:latest
Enter fullscreen mode Exit fullscreen mode

With this Docker image, you don't have to worry about installing tools for supported frontend UI libraries or frameworks.

โ†‘ Table of contents

Two modes of work with the CLI

After installation, you will have two modes of work. Choose the one that suits you best, they work equally well.

  • With an interactive console UI (or CUI for short):
cgapp [COMMAND]
Enter fullscreen mode Exit fullscreen mode
  • From configuration file (by default, in .cgapp.yml):
cgapp [COMMAND] --use-config
Enter fullscreen mode Exit fullscreen mode

โ†‘ Table of contents

Available commands

You can see all available commands and options by running cgapp --help.

I'd like to remind you, the best way to better explore all the features of an any tool is to read the Official Documentation.

  • init โ€” command for generate a default .cgapp.yml config file:
cgapp init
Enter fullscreen mode Exit fullscreen mode
  • create โ€” command to create a new project with the choosen configuration for backend (Golang), frontend (JavaScript or TypeScript) and deploy automation (through Ansible playbook and configured Dockerfile) by CUI or config file:
cgapp create
Enter fullscreen mode Exit fullscreen mode
  • deploy โ€” command for deploy Docker containers with your project to a remote server or local machine by CUI or config file:
cgapp deploy
Enter fullscreen mode Exit fullscreen mode

Yes, you can run containers on your local machine too (if you've not skipped Ansible roles at cgapp create step). All you have to do is define localhost as your host.

Warning: deploy command is currently unavailable in Docker image.

โ†‘ Table of contents

Available project templates

At the moment, the official Create Go App templates are as follows:

  • Backend: net/http, Fiber
  • Frontend: React, Preact, Vue.js, Angular, Svelte, Sapper
  • Web server: Nginx

New templates will be added as they are created. Write in comments, what templates you'd like to see in future.

But you can create your own templates and connect them in the configuration file (.cgapp.yml) like this:

    - backend:
    - frontend:
    - webserver:

# ...
Enter fullscreen mode Exit fullscreen mode

โ†‘ Table of contents

Video screencast

To make everything as clear as possible, I recorded a small video for you where I show the main functions and structure of the created project using the CLI:

โ†‘ Table of contents

Your assistance to the project

I'm always open to your suggestions, so please write in comments what to add or change in Create Go App project. This would really help me develop this awesome tool and make it even better and more useful for you!

Also, I'll be glad if you put a start and add this project to the list for notifications on project's GitHub repository:


โ†‘ Table of contents

Photos by


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: 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: Create a new production-ready project with Go backend, frontend and deploy automation by running one CLI command.
  • ๐Ÿƒ yatr: 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: 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: 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: 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.

Top comments (0)