bootstrap-go-cli

Generate a Go CLI scaffold with Cobra, Viper, and slog logging.

1|Updated May 7, 2026
One-click install
npx skills add https://github.com/agoodway/GoodSkills --skill bootstrap-go-cli
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: bootstrap-go-cli
Source: https://github.com/agoodway/GoodSkills/tree/main/skills/bootstrap-go-cli
Command: npx skills add https://github.com/agoodway/GoodSkills --skill bootstrap-go-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Starting a new Go command-line tool often wastes time on repetitive boilerplate for commands, configuration, logging, releases, and basic project structure.

Core Features & Use Cases

  • Cobra command scaffold: Generates a root command plus stubs for requested subcommands so you can implement behavior quickly.
  • Viper configuration wiring: Sets up a config-file workflow plus environment variable support using an app-derived ENV_PREFIX.
  • slog structured logging: Adds configurable text/JSON logging with a verbose/debug option.
  • Developer-ready project skeleton: Creates justfile and release configuration (goreleaser) and initializes git/build sanity checks.
  • Use case: Build a maintainable internal tool that supports multiple commands (for example: serve, init, sync) with consistent logging and configurable settings.

Quick Start

Ask: "bootstrap go cli for my-tool, module path github.com/acme/my-tool, with subcommands serve init sync".

Frequently Asked Questions about bootstrap-go-cli

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

FAQPage Schema
How do I scaffold a production-ready Go CLI with Cobra and Viper?▼

To scaffold a Go CLI, this tool generates a Cobra command structure with Viper configuration support and slog-based structured logging. You provide a module path and desired subcommands to receive a ready-to-build project skeleton.

What's the best way to set up structured logging and environment variables in a new Go command-line application?▼

Setting up structured logging and environment variables is handled by generating slog configurable text/JSON logging and Viper wiring with an app-derived ENV_PREFIX. This provides a standard config-file workflow and environment variable support out of the box.

Can I generate goreleaser and justfile configurations when bootstrapping a Go CLI project?▼

Yes, generating goreleaser and justfile configurations is a core feature of bootstrapping a Go CLI project. It creates a developer-ready project skeleton that includes release configuration and initializes git/build sanity checks.

Does this Go CLI scaffold support multiple subcommands like serve and sync?▼

Yes, the Go CLI scaffold supports multiple subcommands like serve and sync. You specify the desired subcommands during generation, and it produces a root command plus stubs for each so you can implement behavior quickly.

How do I initialize a Go command-line tool from scratch with standard release tooling?▼

To initialize a Go command-line tool from scratch, you provide a module path and subcommand names. The scaffold produces main/root/subcommand file templates plus goreleaser and justfile build tooling for immediate development.