How schlibra/op-cli works
op-cli is a Go terminal client for OpenList, offering both a Cobra command interface and an interactive menu. Users configure a server URL, authenticate, then query account information or browse files and metadata; the interactive browser can download files with progress reporting. The graph follows documented capabilities and sampled call sites. Some command and menu implementations were not sampled, so their internal wiring is shown only where the README or sampled entry points support it.
Main entry points: root.go Cobra commands · request.go File API calls · config.go Config operations · home.go Interactive home
Components 23
User interfaces
- Program entry
main.go - Cobra commands
cmd/root.go - URL commands
cmd/url.go - User commands
cmd/user.go - List command
cmd/ls.go - File command
cmd/file.go - Download command
cmd/download.go - Version command
cmd/version.go - Interactive home
tui/home.go - Server settings
tui/server.go - Account menu
tui/auth.go
Configuration and account
- Authentication actions
cmd/user.go
File operations
- File browser
tui/file.go - Progress downloader
utils/download.go
API and local state
- Account API calls
utils/request.go - File API calls
utils/request.go - API data models
model/file.go - Auth data models
model/auth.go - Config operations
utils/config.go - Local config
Other components
- Terminal user
- Downloaded files
- OpenList server
Connections 31
- Terminal user → Program entry: starts
- Program entry → Interactive home: opens without arguments
- Program entry → Cobra commands: dispatches arguments
- Terminal user → Cobra commands: runs commands
- Cobra commands → URL commands: registers commands
- Cobra commands → User commands: registers commands
- Cobra commands → List command: registers commands
- Cobra commands → File command: registers commands
- Cobra commands → Download command: registers commands
- Cobra commands → Version command: registers commands
- Interactive home → Server settings: opens settings
- Interactive home → Account menu: opens account menu
- Interactive home → File browser: opens browser
- Server settings → Config operations: loads and saves URL
- URL commands → Config operations: loads and saves URL
- User commands → Authentication actions: invokes
- Account menu → Account API calls: requests account actions
- Authentication actions → Account API calls: requests account actions
- Account API calls → Auth data models: encodes login data
- Account API calls → OpenList server: calls account endpoints
- Account API calls → Config operations: reads token and clears logout token
- Config operations → Local config: reads and writes
- List command → File API calls: lists path
- File command → File API calls: gets metadata
- Download command → File API calls: requests file data
- File browser → File API calls: lists and gets metadata
- File API calls → OpenList server: calls filesystem endpoints
- File API calls → Config operations: reads token and URL
- File API calls → API data models: encodes requests and decodes results
- File browser → Progress downloader: downloads raw URL
- Progress downloader → Downloaded files: writes stream