KD Gen icon

KD Gen

2

Automates the generation of type-safe Go enum types and helper methods from YAML configuration files.

Acerca de

KD Gen is a powerful command-line interface (CLI) tool designed to significantly enhance Go development by automating the creation of type-safe enums. By defining your enum structures in simple YAML files, KD Gen generates corresponding Go code, complete with essential helper methods. This includes support for JSON marshaling/unmarshaling, `database/sql` integration for persistent storage, and utility functions like `String()`, `Parse()`, and `Normalize()`. It reduces boilerplate code, ensures consistency, and improves code safety, making it ideal for standardizing enumeration patterns across your projects. Furthermore, it integrates with the Model Context Protocol (MCP) to expose its enum generation and configuration management capabilities as interactive tools.

Características Principales

  • Generates type-safe Go enums (int, string, uint64) from YAML configurations.
  • Automates JSON serialization and deserialization (`MarshalJSON`, `UnmarshalJSON`) for generated enums.
  • Provides seamless database integration with `database/sql` (`Scan`, `Value`).
  • Creates essential helper methods including `String()`, `Parse` function, and `Normalize()`.
  • Offers CLI tools for enum configuration management, validation, and example generation.
  • 2 GitHub stars

Casos de Uso

  • Integrating with LLM applications or other systems via MCP to manage and generate enum definitions interactively.
  • Ensuring type safety for application configurations, domain models, and API responses.
  • Streamlining Go backend development by standardizing enum creation and usage.
Advertisement

Advertisement