How public-clis/bilibili-cli works
bilibili-cli is a terminal interface to Bilibili: a user invokes a registered command, the command validates inputs and authentication as needed, fetches or changes Bilibili data through the API client, then renders it or emits normalized structured output. Major branches cover account/authentication, video and audio, discovery/search, collections and dynamics, and interactions. Shared command helpers bridge async calls and handle errors; payload and formatter modules shape results. The graph reflects the provided excerpts and README; some command-to-client details rely on documented capabilities rather than sampled implementation.
Main entry points: cli.py Command registry · client.py Bilibili API client · video.py Video commands · payloads.py Payload normalization
Components 19
CLI entry
- Command registry
bili_cli/cli.py
Account and auth
- Account commands
bili_cli/commands/account.py - Credential strategy
bili_cli/auth.py - Saved credentials
bili_cli/auth.py - Browser cookies
- QR login service
Video and audio
- Video commands
bili_cli/commands/video.py - Audio extraction
bili_cli/commands/audio.py - Audio processing
Discovery and users
- User and search
bili_cli/commands/user_search.py - Hot and ranking
bili_cli/commands/discovery.py
Collections and actions
- Collections and dynamics
bili_cli/commands/collections.py - User interactions
bili_cli/commands/interactions.py
Shared services
- Command helpers
bili_cli/commands/common.py - Bilibili API client
bili_cli/client.py - Payload normalization
bili_cli/payloads.py - Output formatting
bili_cli/formatter.py
Other components
- Terminal user
- Bilibili services
Connections 31
- Terminal user → Command registry: invokes
README.md - Command registry → Account commands: registers
bili_cli/cli.py - Command registry → Video commands: registers
bili_cli/cli.py - Command registry → Audio extraction: registers
bili_cli/cli.py - Command registry → User and search: registers
bili_cli/cli.py - Command registry → Hot and ranking: registers
bili_cli/cli.py - Command registry → Collections and dynamics: registers
bili_cli/cli.py - Command registry → User interactions: registers
bili_cli/cli.py - Account commands → Command helpers: uses helpers
bili_cli/commands/account.py - Account commands → Credential strategy: requests credentials
- Credential strategy → Saved credentials: loads and saves
bili_cli/auth.py - Credential strategy → Browser cookies: extracts cookies
bili_cli/auth.py - Account commands → QR login service: starts login
bili_cli/commands/account.py - Credential strategy → QR login service: generates QR
bili_cli/auth.py - Video commands → Bilibili API client: fetches video data
bili_cli/commands/video.py - Video commands → Command helpers: runs requests
bili_cli/commands/video.py - Video commands → Payload normalization: normalizes results
bili_cli/commands/video.py - Audio extraction → Bilibili API client: downloads audio
README.md - Audio extraction → Audio processing: extracts segments
README.md - User and search → Bilibili API client: searches and fetches
bili_cli/commands/user_search.py - User and search → Payload normalization: normalizes results
bili_cli/commands/user_search.py - Hot and ranking → Bilibili API client: fetches rankings
bili_cli/commands/discovery.py - Hot and ranking → Payload normalization: normalizes results
bili_cli/commands/discovery.py - Collections and dynamics → Bilibili API client: fetches and changes
README.md - Collections and dynamics → Payload normalization: normalizes results
bili_cli/commands/collections.py - User interactions → Bilibili API client: submits actions
bili_cli/commands/interactions.py - User interactions → Payload normalization: normalizes results
bili_cli/commands/interactions.py - Bilibili API client → Bilibili services: calls API
README.md - Command helpers → Output formatting: formats output
bili_cli/commands/common.py - Video commands → Output formatting: renders output
bili_cli/commands/video.py - Bilibili API client → Command helpers: raises errors
bili_cli/commands/common.py