๋ณธ๋ฌธ์œผ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ
ๅฐ้พ™่™พๅฐ้พ™่™พAI
๐Ÿค–

bilibili-cli

Browse Bilibili (B็ซ™) from the terminal โ€” videos, users, search, trending, interactions

ไธ‹่ฝฝ130
ๆ˜Ÿๆ ‡0
็‰ˆๆœฌ0.4.0
ๅ›พๅƒ่ง†้ข‘
ๅฎ‰ๅ…จ้€š่ฟ‡
๐Ÿ’ฌPrompt

ๆŠ€่ƒฝ่ฏดๆ˜Ž


name: bilibili-cli description: Browse Bilibili (B็ซ™) from the terminal โ€” videos, users, search, trending, interactions

bilibili-cli Skill

A CLI tool for interacting with Bilibili (ๅ“”ๅ“ฉๅ“”ๅ“ฉ). Use it to fetch video info, search content, browse user profiles, and perform interactions like liking or triple-clicking.

Prerequisites

# Install (requires Python 3.10+)
pipx install bilibili-cli
# Or: uv tool install bilibili-cli

Authentication

Most read commands work without login. Subtitles, favorites, feed, and interactions require login.

bili status                    # Check if logged in
bili login                     # QR code login (if not authenticated)

Authentication auto-detects local browser cookies (Chrome/Firefox/Edge/Brave). If cookies are found and valid, no manual login needed.

Command Reference

Video

# Get video details (accepts BV ID or full URL)
bili video BV1ABcsztEcY
bili video https://www.bilibili.com/video/BV1ABcsztEcY

# Options
bili video BV1ABcsztEcY --subtitle      # Show subtitles (AI or uploaded)
bili video BV1ABcsztEcY --ai            # Show B็ซ™ AI summary
bili video BV1ABcsztEcY --comments      # Show top comments
bili video BV1ABcsztEcY --related       # Show related videos
bili video BV1ABcsztEcY --json          # Raw JSON output

User

# Look up user profile (by UID or username)
bili user 946974
bili user "ๅฝฑ่ง†้ฃ“้ฃŽ"

# List user's videos
bili user-videos 946974 --max 20
bili user-videos "ๅฝฑ่ง†้ฃ“้ฃŽ" --json

Search

# Search users (default)
bili search "ๅ…ณ้”ฎ่ฏ"

# Search videos
bili search "ๅ…ณ้”ฎ่ฏ" --type video

Discovery

bili hot                       # Trending/popular videos
bili hot --max 10               # Limit results
bili rank                      # Site-wide ranking
bili feed                      # Dynamic timeline (requires login)

Collections (require login)

bili favorites                 # List favorite folders
bili favorites <ID> --page 2   # Videos in a folder
bili following                 # Following list
bili history                   # Watch later list

Interactions (require login)

bili like BV1ABcsztEcY         # Like a video
bili like BV1ABcsztEcY --undo  # Unlike
bili coin BV1ABcsztEcY         # Give 1 coin
bili coin BV1ABcsztEcY -n 2    # Give 2 coins
bili triple BV1ABcsztEcY       # ไธ€้”ฎไธ‰่ฟž (like + coin + favorite)

Account

bili status                    # Quick login check
bili whoami                    # Detailed profile info
bili whoami --json              # Profile as JSON
bili login                     # QR code login
bili logout                    # Clear credentials

JSON Output

All read commands support --json for machine-readable output:

bili video BV1ABcsztEcY --json | jq '.stat.view'    # Get view count
bili hot --json | jq '.list[0].title'                # First trending title
bili user 946974 --json | jq '.user_info.name'       # Username

Common Patterns for AI Agents

# Get a video's subtitle text for summarization
bili video BV1ABcsztEcY --subtitle

# Find a user's latest video BV ID
bili user-videos 946974 --max 1 --json | python3 -c "import sys,json; print(json.load(sys.stdin)[0]['bvid'])"

# Check if logged in before performing actions
bili status && bili like BV1ABcsztEcY

# Search and get first result
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

ๅฆ‚ไฝ•ไฝฟ็”จใ€Œbilibili-cliใ€๏ผŸ

  1. ๆ‰“ๅผ€ๅฐ้พ™่™พAI๏ผˆWeb ๆˆ– iOS App๏ผ‰
  2. ็‚นๅ‡ปไธŠๆ–นใ€Œ็ซ‹ๅณไฝฟ็”จใ€ๆŒ‰้’ฎ๏ผŒๆˆ–ๅœจๅฏน่ฏๆก†ไธญ่พ“ๅ…ฅไปปๅŠกๆ่ฟฐ
  3. ๅฐ้พ™่™พAI ไผš่‡ชๅŠจๅŒน้…ๅนถ่ฐƒ็”จใ€Œbilibili-cliใ€ๆŠ€่ƒฝๅฎŒๆˆไปปๅŠก
  4. ็ป“ๆžœๅณๆ—ถๅ‘ˆ็Žฐ๏ผŒๆ”ฏๆŒ็ปง็ปญๅฏน่ฏไผ˜ๅŒ–

็›ธๅ…ณๆŠ€่ƒฝ