DEV Community

Cover image for 🎉 The Gowebly CLI has grown to v2.0.0
Vic Shóstak
Vic Shóstak

Posted on • Updated on

🎉 The Gowebly CLI has grown to v2.0.0

Introduction

Happy New Year, my DEV friends! 🎊

While everyone was relaxing and thinking about Christmas, I was hard at work in my studio to prepare a massive update for the Gowebly CLI number v2.

I don't like to drag out the intro, so here we go! 😉

📝 Table of contents

What is Gowebly?

A next-generation CLI tool that makes it easy to create amazing web applications with Go on the backend, using htmx & hyperscript and the most popular CSS frameworks on the frontend.

GitHub logo gowebly / gowebly

🔥 A next-generation CLI tool that makes it easy to create amazing web applications with Go on the backend, using htmx, hyperscript or Alpine.js and the most popular CSS frameworks on the frontend.

gowebly logo

The Gowebly CLI

A next-generation CLI tool that makes it easy to create amazing web applications
with Go on the backend, using htmx, hyperscript or Alpine.js
and the most popular CSS frameworks on the frontend.

Go version Go report License

↘  The official Gowebly CLI documentation  ↙

English · Русский · 简体中文 · Español

↘  Share the project's link to your friends  ↙

Share on X Share on Telegram Share on WhatsApp Share on Reddit

gowebly create command

✨ Features

  • 100% free and open source under the Apache 2.0 license;
  • For any developer's level of knowledge and technical expertise, as the intelligent CLI does most of the routine project setup for you, creates an understandable structure, and prepares code for use and deployment in production;
  • Cross-platform and multi-architecture allows successful running on any GNU/Linux distros, Microsoft Windows (including WSL) and Apple macOS;
  • Well-documented, includes translations in many other languages (Русский, 简体中文, Español);
  • Enables you to start a new project faster with Go, htmx

↑ Table of contents

Breaking changes

After gathering the opinion of the most active users and based on the experience of my other successful CLI project Create Go App, I decided to remove the possibility of configuring with a YAML file.

✨ Yes, .gowebly.yml is no longer needed!

The handy and incredibly beautiful huh library from the Charm team is now in charge of that. Just upgrade to the latest version of the Gowebly and type the familiar command in the terminal:

gowebly create
Enter fullscreen mode Exit fullscreen mode

And just look at this:

new gowebly create

The same thing happened with the unknown and the doctor commands, which now look (and feel) completely different:

gowebly doctor
Enter fullscreen mode Exit fullscreen mode

new gowebly doctor

↑ Table of contents

Live reload mode on code updates

It was highly anticipated, and I decided not to delay and make it as soon as possible. Since version v2.0.0, the Gowebly CLI supports reloading a project running in development mode if changes are made to it:

  1. Go code;
  2. Templ or HTML templates;
  3. SASS/CSS styles;
  4. TypeScript/JavaScript files;
  5. Frontend part settings (JSON).

This is made possible thanks to the Air tool, which now comes with every project you create. The configuration is as follows:

# .air.toml

root = "."
tmp_dir = "tmp"

[build]
pre_cmd = ["bun run build"]
cmd = "templ generate && go build -o ./tmp/gowebly_default ."
bin = "tmp/gowebly_default"
include_ext = ["go", "templ", "html", "json", "js", "ts", "css", "scss"]
exclude_dir = [".parcel-cache", "bin", "dist", "node_modules", "static", "tmp", "tests", "vendor"]
exclude_regex = ["_test\\.go", "_templ\\.go"]
exclude_unchanged = false
follow_symlink = false
log = "build-errors-air.log"
poll = false
poll_interval = 500
delay = 1000
stop_on_error = true
send_interrupt = false
kill_delay = 500
rerun = false
rerun_delay = 500

# ...
Enter fullscreen mode Exit fullscreen mode

If you don't want to use Air, when creating a new project, select "No" when the CLI prompts you to use the tool. In this case, this Makefile will be created.

↑ Table of contents

Other notable improvements

The backend has been completely reimagined:

  1. Repetitive elements in templates have been removed;
  2. The configs for creating a Docker container have been simplified;
  3. Add the htmx-go package to simplify the htmx handling at the server layer of the application.

The frontend part has received the following refresh:

  1. Repetitive elements in templates have been removed;
  2. Add a ./assets/scripts.js file for your reactive logic;
  3. Add the Flowbite components library for the Tailwind CSS;
  4. Add the Prettier for code formatting.

And not only that! 😊 Keep an eye out for updates and new releases on the project's GitHub page and official documentation.

↑ Table of contents

Photos and videos by

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 main projects that need your help (and stars) 👇

  • 🔥 Gowebly: A next-generation CLI tool to easily build amazing web applications with Go on the backend, using htmx & hyperscript and the most popular 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.

Other my small projects: yatr, gosl, json2csv, csv2api.

Top comments (0)