| name | bilibili-cli |
| description | Interact with Bilibili (B站/哔哩哔哩) via CLI — fetch video info, subtitles, comments, download audio, search users/videos, browse trending rankings, manage favorites, and perform interactions like likes and triple-clicks |
bilibili-cli Skill
A CLI tool for interacting with Bilibili (哔哩哔哩). Use it to fetch video info, search content, browse user profiles, download audio, and perform interactions like liking or triple-clicking.
Prerequisites
pip install bilibili-cli
Authentication
Most read commands work without login. Subtitles, favorites/following/watch-later/history, feed, and interactions require login.
bili status
bili login
Authentication auto-detects local browser cookies (Chrome/Firefox/Edge/Brave). If cookies are found and valid, no manual login needed.
Command Reference
Video
bili video BV1ABcsztEcY
bili video https://www.bilibili.com/video/BV1ABcsztEcY
bili video BV1ABcsztEcY --subtitle
bili video BV1ABcsztEcY --ai
bili video BV1ABcsztEcY --comments
bili video BV1ABcsztEcY --related
bili video BV1ABcsztEcY --json
User
bili user 946974
bili user "影视飓风"
bili user-videos 946974 --max 20
bili user-videos "影视飓风" --json
Search
bili search "关键词"
bili search "关键词" --type video
Discovery
bili hot
bili hot --max 10
bili rank
bili feed
Collections (require login)
bili favorites
bili favorites <ID> --page 2
bili following
bili watch-later
bili history
Audio Extraction
bili audio BV1ABcsztEcY
bili audio BV1ABcsztEcY --segment 60
bili audio BV1ABcsztEcY --no-split
bili audio BV1ABcsztEcY -o ~/data/
Interactions (require login)
bili like BV1ABcsztEcY
bili like BV1ABcsztEcY --undo
bili coin BV1ABcsztEcY
bili coin BV1ABcsztEcY -n 2
bili triple BV1ABcsztEcY
Account
bili status
bili whoami
bili whoami --json
bili login
bili logout
JSON Output
Major query commands support --json for machine-readable output:
bili video BV1ABcsztEcY --json | python3 -c "import sys,json; print(json.load(sys.stdin)['stat']['view'])"
bili hot --json | python3 -c "import sys,json; print(json.load(sys.stdin)['list'][0]['title'])"
bili user 946974 --json | python3 -c "import sys,json; print(json.load(sys.stdin)['user_info']['name'])"
Common Patterns for AI Agents
bili video BV1ABcsztEcY --subtitle
bili audio BV1ABcsztEcY --segment 25
bili user-videos 946974 --max 1 --json | python3 -c "import sys,json; print(json.load(sys.stdin)[0]['bvid'])"
bili status && bili like BV1ABcsztEcY
bili search "topic" --type video --json | python3 -c "import sys,json; r=json.load(sys.stdin); print(r[0]['bvid'] if r else 'not found')"
Error Handling
- Commands exit with code 0 on success, non-zero on failure
- Error messages are prefixed with ❌
- Login-required commands show ⚠️ with instruction to run
bili login
- Invalid BV IDs show a clear error message