How jj-h/gitee_cli works
Main Components Identification
The system should be represented with these key components:
a. Command Layer (cmd/)
• Root command handler
• Feature-specific commands (PR, Issues, SSH Keys, etc.)
• Authentication and configuration handlers
b. Internal API Layer (internal/api/)
• API clients for different Gitee services
• Data models and service interfaces
c. Utility Layer (utils/)
• HTTP client utilities
• Git utilities
• Terminal UI components
d. Configuration Management (config/)
• Configuration handling
• YAML configuration storage
e. External Systems
• Gitee API (V5)
• Gitee Enterprise API
• Local Git repository
• User's filesystem (for SSH keys and config)
┌─────────────────────────────────────────────────────────────┐
• Gitee CLI Application │
• ┬─────────────────────────┬──────────────────┤
• Command Layer │ Internal API Layer │ Utility Layer │
• (cmd/) │ (internal/api/) │ (utils/) │
• ┴─────────────────────────┴──────────────────┤
• Configuration Layer │
• (config/) │
• ┤
• External Systems & Services │
• ┘
Component Relationships
• Command Layer → Internal API Layer (command execution flow)
• Internal API Layer → External Gitee APIs (API calls)
• Utility Layer ↔ All Other Layers (utility functions used throughout)
• Configuration Layer ↔ All Other Layers (config access)
Important Details
a. Command Structure:
• Main command groups (PR, Issue, SSH-Key, etc.)
• Subcommand relationships
b. API Integration:
• Separation between V5 API and Enterprise API calls
• Authentication flow
c. Local System Integration:
• Filesystem interactions (config, SSH keys)
• Git repository interactions
Specific Implementation Notes
• Notes for important configuration requirements
• Authentication flow with special emphasis