Skip to content

Releases: eugener/clix

Release list

v1.0.1

Choose a tag to compare

@eugener eugener released this 06 Jun 14:24

Add MIT license

v1.0.0

Choose a tag to compare

@eugener eugener released this 06 Jun 14:17

Clix v1.0.0 - Modern Go CLI Framework 🚀

The first stable release of Clix - a modern, type-safe CLI framework for Go!

🎯 What is Clix?

Clix is a developer-friendly CLI framework that reduces boilerplate by 60% while providing
enterprise-grade features. Built with modern Go (generics, slog, context) and designed for
maximum developer happiness.

✨ Key Features

🔥 Fluent API & Smart Defaults

  • Method chaining: cli.New("app").Version("1.0.0").Interactive().Build()
  • Quick builders: Create CLIs in one line with cli.Quick()
  • Smart presets: cli.Dev(), cli.Prod(), cli.Quick() configurations

🛡️ Type Safety & Modern Go

  • Generic commands: Command[T] interface with compile-time type checking
  • Reflection-based: Automatic config struct discovery
  • Go 1.21+ features: Uses generics, slog, and modern patterns

⚙️ Zero-Config Magic

  • Auto configuration: Loads app.yaml/app.json automatically
  • Environment integration: Struct tags for env var binding
  • CLI precedence: CLI args > config files > defaults

🤖 Interactive Experience

  • Smart prompting: Auto-prompt for missing required fields
  • Intelligent errors: Context-aware suggestions using Levenshtein distance
  • Beautiful output: Colored help, errors, and interactive prompts

🏗️ Production Ready

  • POSIX compliance: Full argument parsing with advanced flag handling
  • Middleware pipeline: Recovery, logging, timeout, and custom middleware
  • Shell completion: Bash, zsh, and fish auto-completion
  • Comprehensive validation: Input validation with helpful error messages

📦 Installation

go get github.com/eugener/clix@v1.0.0

🚀 Quick Start

Ultra-Simple (1 line)

  cli.Quick("my-app", cli.Cmd("hello", "Say hello", func() error {
      fmt.Println("Hello, World!")
      return nil
  }))

Fluent API

  app := cli.New("my-app").
      Version("1.0.0").
      Interactive().
      AutoConfig().
      WithCommands(
          cli.Cmd("deploy", "Deploy app", deployHandler),
      ).
      Build()

  app.RunWithArgs(context.Background())

Traditional Struct-Based

  type DeployConfig struct {
      Environment string `flag:"env" required:"true" help:"Target environment"`
      Force       bool   `flag:"force" help:"Force deployment"`
  }

  type DeployCommand struct{}

  func (c *DeployCommand) Run(ctx context.Context, config DeployConfig) error {
      fmt.Printf("Deploying to %s (force: %v)\n", config.Environment, config.Force)
      return nil
  }

  func main() {
      app := cli.New("deploy-tool").
          WithCommands(&DeployCommand{}).
          Build()
      app.RunWithArgs(context.Background())
  }

📁 Examples

This release includes comprehensive examples:

  • Simple: Basic usage patterns
  • Fluent API: Modern builder patterns
  • Interactive: Auto-prompting demo
  • Advanced: Complex applications
  • Config: Configuration file examples

🏗️ Architecture

  • Clean API: Only essential packages exposed, implementation in internal/
  • Modular design: Core, CLI, config, and middleware as separate concerns
  • Extensible: Plugin-friendly architecture for custom middleware

🎯 Why Choose Clix?

Feature Clix Other Frameworks
Type Safety ✅ Generics ❌ Interface{}
Fluent API ✅ Method chaining ❌ Verbose structs
Auto Config ✅ Zero setup ❌ Manual wiring
Interactive ✅ Smart prompts ❌ Manual input
Modern Go ✅ 1.21+ features ❌ Legacy patterns

🛣️ Roadmap

Future releases will include:

  • Testing helpers (app.TestCommand().WithArgs().Run())
  • Magic registration (auto-discover commands)
  • Rich output (progress bars, tables, spinners)
  • Plugin system

📖 Documentation

🙏 Acknowledgments

Built with modern Go best practices and inspired by the need for a more developer-friendly CLI
experience.


Full Changelog: Initial release - all features are new! 🎉

Compatibility: Go 1.21+