| name | bilibili-cli |
| description | Bilibili video platform CLI. TRIGGER when user mentions B站/Bilibili/哔哩哔哩, asks to search videos, check trending/hot/rank, look up UP主, view video details/subtitles/comments, manage watch history/favorites/watch-later, interact with videos (like/coin/triple), post/delete dynamics, or download audio for transcription. |
bilibili-cli
Bilibili platform CLI — search, browse, interact, and download audio.
Tool
export PATH="$HOME/.local/bin:$PATH"
bili <command> [args]
Always use --yaml flag for structured output (agent-friendly).
Commands
Search
bili search "keyword"
bili search "keyword" --type video
bili search "keyword" --type video -n 10
bili search "keyword" --page 2 --yaml
Video Details
bili video BV1xxx --yaml
bili video BV1xxx -s
bili video BV1xxx -st
bili video BV1xxx --subtitle-format srt
bili video BV1xxx -c
bili video BV1xxx --ai
bili video BV1xxx -r
bili video "https://bilibili.com/video/BV1xxx"
Trending & Rankings
bili hot --yaml
bili hot -n 10 -p 2
bili rank --yaml
bili rank --day 7 -n 10
User / UP主
bili user 12345 --yaml
bili user "username" --yaml
bili user-videos 12345 -n 20 --yaml
Browse (requires login)
bili feed --yaml
bili feed --offset <cursor>
bili favorites --yaml
bili favorites <fav_id> -p 2 --yaml
bili history -n 50 --yaml
bili watch-later --yaml
bili my-dynamics --yaml
bili following --yaml
Interact (requires login)
bili like BV1xxx
bili coin BV1xxx
bili triple BV1xxx
bili dynamic-post "text content"
bili dynamic-post --from-file ./post.txt
bili dynamic-delete <dynamic_id>
bili unfollow <uid>
Audio Download
bili audio BV1xxx
bili audio BV1xxx --segment 60
bili audio BV1xxx --no-split
bili audio BV1xxx -o ~/data/
Output: /tmp/bilibili-cli/{title}/ by default. WAV segments are ASR-ready.
Account
bili login
bili status
bili whoami --yaml
bili logout
Auth
bili login generates a QR code in terminal for Bilibili app scan
- Credentials are saved locally after first login
- Browse/interact commands require login; search/video/hot/rank work without login
- Login is interactive (QR scan) — only works in SSH CLI, not in automated pipelines
Output
- Default: human-readable table/text
--json: JSON output
--yaml: YAML output (recommended for agent consumption)
- Always prefer
--yaml when parsing results programmatically
Behavior Notes
BV_OR_URL accepts both BV numbers (BV1xxx) and full Bilibili URLs
UID_OR_NAME accepts numeric UID or username string (auto-searches first match)
- Pagination: most list commands support
-p/--page and -n/--max
feed uses cursor-based pagination (--offset), not page numbers
audio requires ffmpeg installed for audio extraction and splitting
- Subtitle availability depends on the video (uploader or AI-generated)
--ai summary is Bilibili's built-in AI summary, not always available