Skip to content

Latest commit

 

History

History
80 lines (57 loc) · 1.84 KB

File metadata and controls

80 lines (57 loc) · 1.84 KB

Features

Version 2.0 - Go Rewrite

Technical Improvements

  • Single Binary: 2.9MB executable, no dependencies
  • 80% Less Code: ~1,800 LOC vs ~2,500 LOC bash
  • Type Safe: Compile-time error checking
  • 10x Faster: <10ms execution time
  • Zero Duplication: Single codebase for all platforms

Architecture

  • Language: Go 1.21+
  • CLI: Cobra framework
  • Build: Cross-platform with build tags
  • Distribution: GoReleaser for multi-platform releases

Core Features

Git includeIf Automation

Automatic profile switching based on directory location. Set up once, works forever.

SSH Multi-Account Support

IdentitiesOnly yes ensures proper key isolation. No key conflicts, no manual switching.

Profile Management

  • Multiple emails per profile
  • GPG signing per profile
  • Import/export for backup
  • Directory-based rules

Platform Support

Native keychain integration:

  • macOS: Keychain
  • Linux: SSH agent
  • Windows: Windows SSH agent

Comparison: v1 (Bash) vs v2 (Go)

Feature v1 v2
Language Bash Go
Lines of Code 2,500 1,800
Files 4 platform scripts 18 organized files
Binary Size N/A 2.9MB
Dependencies bash, jq None
Build Time N/A <1s
Code Duplication 70% 0%
Type Safety None Full
Git includeIf No Yes
Cross-platform Manual Automatic

Advanced Features

Git Configuration

  • Profile-specific .gitconfig-{name} files
  • Global config modification
  • includeIf directive management
  • GPG signing configuration

SSH Configuration

  • Automatic config generation
  • Host alias creation
  • IdentitiesOnly enforcement
  • Key existence validation

Error Handling

  • Comprehensive error messages
  • Input validation (email, GPG key format)
  • Profile conflict detection
  • Configuration backup on changes