cli module - github.com/create-go-app/cli/v4 - Go Packages (original) (raw)

Create Go App

Create Go App CLI

Go version Go report Code coverage Wiki License

Create a new production-ready project with backend (Golang),frontend (JavaScript, TypeScript) and deploy automation (Ansible, Docker) by running only one CLI command.

Focus on writing your code and thinking of the business-logic! The CLI will take care of the rest.

⚡️ Quick start

First, download and install Go. Version 1.20 or higher is required.

❗️ Note: If you're looking for the Create Go App CLI for other Go versions: 1.16, 1.17.

Installation is done by using the go install command:

go install github.com/create-go-app/cli/v4/cmd/cgapp@latest

Or see the repository's Release page, if you want to download a ready-made deb, rpm, apk or Arch Linux package.

Also, GNU/Linux and macOS users available way to install viaHomebrew:

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

# Installation:
brew install create-go-app/tap/cgapp

Let's create a new project via interactive console UI (or CUI for short) in current folder:

cgapp create

Next, open the generated Ansible inventory file (called hosts.ini) and fill in the variables according to your server configuration. And you're ready to automatically deploy this project:

cgapp deploy

That's all you need to know to start! 🎉

🐳 Docker-way to quick start

If you don't want to install Create Go App CLI to your system, you feel free to using our official Docker image and run CLI from isolated container:

docker run --rm -it -v <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mi>P</mi><mi>W</mi><mi>D</mi></mrow><mo>:</mo></mrow><annotation encoding="application/x-tex">{PWD}:</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mord mathnormal" style="margin-right:0.13889em;">W</span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span></span></span></span>{PWD} -w ${PWD} koddr/cgapp:latest [COMMAND]

🔔 Please note: the deploy command is currently unavailable in this image.

📖 Project Wiki

The best way to better explore all the features of the Create Go App CLIis to read the project Wiki and take part inDiscussions and/or Issues.

Yes, the most frequently asked questions (FAQ) are alsohere.

⚙️ Commands & Options

create

CLI command for create a new project with the interactive console UI.

cgapp create [OPTION]
Option Description Type Default Required?
-t Enables to define custom backend and frontend templates. bool false No

cgapp_create

deploy

CLI command for deploy Docker containers with your project via Ansible to the remote server.

🔔 Make sure that you have Python 3.8+ andAnsible 2.9+ installed on your computer.

cgapp deploy [OPTION]
Option Description Type Default Required?
-k Prompt you to provide the remote user sudo password (a standard Ansible --ask-become-pass option). bool false No

cgapp_deploy

📝 Production-ready project templates

Backend
Frontend

Frontend part will be generated using awesome tool Vite.jsunder the hood.

So, you'll always get the latest version of React, Preact, Vue, Svelte, Solid, Lit, Qwik, or pure JavaScript/TypeScript templates for your project.

Name Description JavaScript Typescript
Pure A pure JavaScript/Typescript app vanilla vanilla-ts
React A common React app react react-ts
React (with SWC) A React app with SWC react-swc react-swc-ts
Preact A common Preact app preact preact-ts
Vue.js A common Vue.js app vue vue-ts
Svelte A common Svelte app svelte svelte-ts
Solid A common Solid app solid solid-ts
Lit A common Lit app lit lit-ts
Qwik A common Qwik app qwik qwik-ts

The Next.js and Nuxt frontend parts will be generated using the latestcreate-next-app and nuxi utilities.

Name Description JavaScript Typescript
Next.js A common Next.js app next next-ts
Nuxt A common Nuxt v3 app - nuxt

❗️ Please make sure that you have npm version 7 or higher installed to create the frontend part of the project correctly. If you run thecgapp -create command using our Docker image, npm of the correct version is already included.

🚚 Pre-configured Ansible roles

Web/Proxy server

✌️ Since Create Go App CLI v2.0.0, we're recommended to use Traefik Proxy as default proxy server for your projects. The main reason: this proxy provides automatic SSL certificates from Let's Encrypt out of the box. Also, Traefik was built on the Docker ecosystem and has a really good-looking and useful Web UI.

Database
Cache (key-value storage)

⭐️ Project assistance

If you want to say thank you or/and support active development ofCreate Go App CLI:

Product Hunt

🏆 A win-win cooperation

And now, I invite you to participate in this project! Let's work together to create the most useful tool for developers on the web today.

Together, we can make this project better every day! 😘

⚠️ License

Create Go App CLI is free and open-source software licensed under the Apache 2.0 License. Official logo was created by Vic Shóstak and distributed underCreative Commons license (CC BY-SA 4.0 International).