How passbolt/go-passbolt-cli works
Main Components
a. CLI Interface Layer:
• Main entry point (main.go)
• To the command structure (cmd/* files)
• Core commands (create, delete, get, list, move, share, update)
b. Domain Logic Layer:
• Four main entity handlers:
• Resource (passwords)
• Folder
• User
• Group
• Each entity should show its standard operations (create, delete, get, list, update)
c. Utility Layer:
• Util package components:
• HTTP client
• Context management
• CEL (Common Expression Language) handling
d. External Integration:
• Passbolt Server connection
• Configuration management
• Authentication/MFA handling
[CLI Layer (Top)]
• ↓
[Command Router]
• ↓
[Domain Logic Layer]
• ↓
[Utility Layer]
• ↓
[External Systems (Bottom)]
Key Relationships
a. Command Flow:
• User input → CLI commands → Entity handlers
• Entity handlers → Utility layer → External API
b. Cross-cutting Concerns:
• Configuration management affecting all layers
• Authentication/MFA verification flow
• Server verification process
Important Details
a. Security Features:
• MFA handling (TOTP modes)
• Server verification
• Private key management
b. Data Flows:
• JSON output capability for scripting
• Resource sharing permissions (1, 7, 15, -1)
Specific Implementation Notes
• How the cmd package orchestrates operations
• How entity packages (resource, folder, user, group) interact
• Demonstrate utility package's supporting role
• Configuration flow (configure command)