feat: add CLI binary with comprehensive tests and ~100% coverage#7
Merged
jackspirou merged 2 commits intomasterfrom Jul 23, 2025
Merged
feat: add CLI binary with comprehensive tests and ~100% coverage#7jackspirou merged 2 commits intomasterfrom
jackspirou merged 2 commits intomasterfrom
Conversation
840bda1 to
7e4033c
Compare
- Add complete CLI binary implementation with all commands (encode, decode, key, uuid, apikey, version) - Add comprehensive test suite with 83.4%+ CLI coverage - Fix missing API key support in uuid command - Reorganize tests with clean 1:1 mapping to production files - Fix all golangci-lint issues Key features: - Full Cobra-based CLI with subcommands - JSON and quiet output modes - API key generation with configurable entropy (128/160/256 bits) - UUID generation (v4, v6, v7) and encoding/decoding - Version command with checksum verification - Comprehensive error handling and validation Test improvements: - Table-driven tests throughout - Test isolation to prevent Cobra state pollution - Coverage for all commands and edge cases - Fixed Crockford Base32 validation per official spec
13d544f to
b466af2
Compare
- Add TestMain to properly restore file descriptors after tests - Save original stdout/stderr/stdin at package initialization - Fix potential broken pipe errors in coverage reports - Add proper cleanup with sync and delay before exit - Improve test isolation by using package-level originals - Remove unnecessary COVERAGE_RUN environment variable - Ensure 100% coverage of main.go function These changes address intermittent test failures and improve the reliability of coverage reporting when running tests. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a comprehensive CLI binary for the uuidkey library with full test coverage and professional build/release infrastructure.
Features Added
🎯 CLI Commands
uuidkey uuid- Generate or process UUIDs (v4, v6, v7)uuidkey key- Generate or encode Base32-Crockford keysuuidkey apikey- Generate or parse API keys with configurable entropyuuidkey encode- Explicit UUID to key encodinguuidkey decode- Explicit key to UUID decodinguuidkey version- Version info with checksum verification🧪 Comprehensive Testing
🚀 Build & Release
📚 Documentation
Technical Implementation
RunEpattern for proper error handlingTest Plan
make installChanges from Review
🤖 Generated with Claude Code