go-cli-builder

Scaffold Go CLI projects with Cobra, Viper, SQLite, and GitHub Actions.

3|Updated Nov 11, 2025
One-click install
npx skills add https://github.com/lmorchard/lmorchard-agent-skills --skill go-cli-builder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-cli-builder
Source: https://github.com/lmorchard/lmorchard-agent-skills/tree/main/go-cli-builder
Command: npx skills add https://github.com/lmorchard/lmorchard-agent-skills --skill go-cli-builder

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Go CLI projects require boilerplate setup, and teams often reinvent patterns for CLI tools. This Skill provides templates, scripts, and patterns to quickly scaffold production-ready Go command-line tools using Cobra, Viper, SQLite, Logrus, and GitHub Actions.

Core Features & Use Cases

  • Cobra-based CLI scaffolding with command wiring and documentation
  • Viper configuration setup with defaults, environment bindings, and YAML config
  • SQLite database scaffolding with migrations and a sample schema
  • GitHub Actions workflows for CI, releases, and rolling releases
  • Makefile, gofumpt formatting, and golangci-lint integration
  • Add commands to existing projects using the provided add_command script

Quick Start

Run the scaffold script to generate a complete Go CLI project, then customize the generated files and run setup to begin.

Frequently Asked Questions about go-cli-builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a Go CLI project with Cobra and Viper?

You scaffold a Go CLI project by running the provided scaffold script, which generates a starter layout with Cobra command wiring and Viper configuration. The output includes defaults, environment bindings, and a YAML setup ready for immediate customization.

Can I add new commands to an existing Go CLI that uses Cobra?

Yes, you can add new commands to an existing Go CLI using the provided add_command script. This script applies standard patterns to integrate new Cobra commands seamlessly into projects that already follow the scaffold's structured layout.

Does the generated Go CLI scaffold include SQLite database setup?

Yes, the scaffolded Go CLI project includes SQLite database setup with migrations and a sample schema. This provides a ready-to-use database layer alongside the Cobra commands and Viper configuration within the generated project structure.

What's the best way to set up GitHub Actions workflows for a Go CLI?

The best way to set up GitHub Actions for a Go CLI is using a scaffold that includes preconfigured workflows for CI, releases, and rolling releases. This ensures the generated project has automated testing and deployment pipelines from the start.

How do I configure Go CLI projects to use Logrus and golangci-lint?

You configure Go CLI projects to use Logrus and golangci-lint by generating a scaffold that integrates both tools by default. The output includes a Makefile with gofumpt formatting and linting setup to maintain production-ready code quality.

Why use a boilerplate scaffold for production-ready Go command-line tools?

Using a boilerplate scaffold for production-ready Go command-line tools eliminates the need to reinvent CLI patterns. It provides a structured layout with Cobra, Viper, SQLite, and CI pipelines, reducing setup time and enforcing standard conventions.