$ show mritd/idgen
The idgen application is a Go-based tool for generating Chinese identity information (name, ID number, mobile number, bank card number, email, and address) for testing purposes. It provides both a command-line interface (CLI) with subcommands for each data type and an HTTP server mode that serves a web interface and API endpoints. The core data generation is handled by the github.com/mritd/chinaid/v2 dependency, while the application itself focuses on command parsing, output formatting, and server logic. The CLI uses Cobra for command structure and supports output in table, JSON, or CSV formats with optional clipboard copying. The server mode uses Go's embed package to bundle static files and provides REST endpoints for generating data in JSON or CSV format.
The LLM identified 1 files worth highlighting for reuse:
This package provides a flexible formatter for outputting data in table, JSON, or CSV formats. It handles the complexities of displaying CJK characters correctly in tables by calculating display width, which is a non-obvious detail for proper alignment. The formatter is used by all CLI commands to present generated identity data and is completely independent of the application's business logic, making it easily reusable in other projects that need to format tabular data.