Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
jackwener avatar

Bilibili Cli

  • 589 installs
  • 957 repo stars
  • Updated March 14, 2026
  • jackwener/bilibili-cli

bilibili-cli is a Claude Code skill that downloads Bilibili videos, fetches metadata, and scrapes public content from the terminal or inside agent workflows for developers automating Bilibili media pipelines.

About

bilibili-cli is a terminal skill from jackwener/bilibili-cli ranked 14 on skills.sh with 455 installs, providing CLI commands to download videos, fetch metadata, and scrape public Bilibili content. Developers invoke bilibili-cli from the shell or embed it in agent workflows when they need programmatic access to Bilibili media without manual browser downloads. The skill suits data collection, archival, and content pipeline automation where Bilibili is the source platform. Reach for bilibili-cli when terminal-based video retrieval or metadata extraction must run inside coding agent sessions or scripted workflows.

  • Terminal-first Bilibili video and metadata downloader
  • Supports batch operations and multiple quality options
  • Integrates cleanly with agentic coding tools and shell scripts
  • 455 installs on skills.sh
  • Lightweight GitHub-hosted CLI with no heavy dependencies

Bilibili Cli by the numbers

  • 589 all-time installs (skills.sh)
  • +16 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #110 of 550 CLI & Terminal skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/jackwener/bilibili-cli --skill bilibili-cli

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs589
repo stars957
Last updatedMarch 14, 2026
Repositoryjackwener/bilibili-cli

How do you download Bilibili videos from CLI?

Download videos, fetch metadata, or scrape public Bilibili content directly from the terminal or inside an agent workflow.

Who is it for?

Developers automating Bilibili video downloads or metadata extraction from the terminal or inside coding agent pipelines.

Skip if: Developers who only need YouTube or Vimeo downloads without any Bilibili-specific public content requirements.

When should I use this skill?

A workflow needs Bilibili video download, metadata fetch, or public content scraping from the terminal or an agent session.

What you get

Downloaded Bilibili video files, extracted metadata records, and scraped public content datasets from terminal commands.

  • Downloaded video files
  • Bilibili metadata JSON

By the numbers

  • 455 installs listed on skills.sh catalog
  • Ranked 14 on skills.sh for jackwener/bilibili-cli

Files

SKILL.mdMarkdownGitHub ↗

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.

Agent Defaults

When you need machine-readable output:

1. Prefer --yaml first because it is usually more token-efficient than pretty JSON. 2. Use --json only when downstream tooling strictly requires JSON. 3. Keep result sets small with --max, --page, or --offset. 4. Prefer specific commands over broad ones. Example: use bili user-videos 946974 --max 3 --yaml instead of fetching large timelines. 5. When summarizing a video, fetch subtitles first. Subtitles usually contain the video's core content and are the best primary source for summaries. 6. Only fall back to --ai, comments, or audio extraction when subtitles are unavailable or clearly insufficient.

Prerequisites

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

# If you need audio extraction support (requires PyAV)
uv tool install "bilibili-cli[audio]"
# Or: pipx install "bilibili-cli[audio]"

# Upgrade to latest (recommended to avoid API errors)
uv tool upgrade bilibili-cli
# Or: pipx upgrade bilibili-cli

Authentication

Most read commands work without login. Subtitles, favorites/following/watch-later/history, feed, and interactions require login.

bili status                    # Check if logged in (exit 0 = yes, 1 = no)
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. Credentials are saved to ~/.bilibili-cli/credential.json.

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 (plain text)
bili video BV1ABcsztEcY --subtitle-timeline   # Show subtitles with timestamps
bili video BV1ABcsztEcY -st --subtitle-format srt  # Export as SRT format
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 --yaml          # Token-efficient YAML output
bili video BV1ABcsztEcY --json          # Structured JSON envelope

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 "影视飓风" --yaml

Search

# Search users (default)
bili search "关键词"

# Search videos
bili search "关键词" --type video

# Pagination and limit
bili search "关键词" --type video --max 5
bili search "关键词" --page 2

Discovery

bili hot                       # Trending/popular videos
bili hot --page 2 --max 10     # Page 2, limit 10
bili rank                      # Site-wide ranking (3-day)
bili rank --day 7 --max 30     # 7-day ranking, top 30
bili feed                      # Dynamic timeline (requires login)
bili feed --offset 1234567890  # Next page via returned cursor
bili my-dynamics               # My posted dynamics (requires login)
bili dynamic-post "hello"      # Publish text dynamic (requires write credential)
bili dynamic-delete 123456789  # Delete one dynamic (requires write credential)

Collections (require login)

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

Audio Extraction

Requires bilibili-cli[audio] extra (PyAV). Install with uv tool install "bilibili-cli[audio]".

# Download audio and split into ASR-ready WAV segments (25s each, 16kHz mono)
bili audio BV1ABcsztEcY                 # Split to /tmp/bilibili-cli/{title}/
bili audio BV1ABcsztEcY --segment 60    # 60s per segment
bili audio BV1ABcsztEcY --no-split      # Full m4a file, no splitting
bili audio BV1ABcsztEcY -o ~/data/      # Custom output directory

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)
bili unfollow 946974           # Unfollow by UID

Account

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

Structured Output

Major query commands support both --yaml and --json for machine-readable output. Prefer YAML for agent use:

bili status --yaml                                # Quick structured auth check
bili video BV1ABcsztEcY --yaml                       # Preferred for AI agents
bili hot --max 5 --yaml                             # Smaller, token-efficient payload
bili user 946974 --json | jq -r '.data.user.name'   # JSON when jq is needed

When stdout is not a TTY, bilibili-cli defaults to YAML automatically. Use OUTPUT=yaml|json|rich|auto to override the default output mode. All machine-readable output uses the envelope documented in SCHEMA.md.

Debugging

bili -v <command>              # Enable verbose/debug logging for any command

Common Patterns for AI Agents

# For video summarization, fetch subtitles first
bili video BV1ABcsztEcY --subtitle

# Only use AI summary as a fallback or secondary signal
bili video BV1ABcsztEcY --ai

# Get comments for sentiment analysis
bili video BV1ABcsztEcY --comments

# Extract audio for speech-to-text (ASR)
# Segments are saved to /tmp/bilibili-cli/{title}/seg_000.wav, seg_001.wav, ...
bili audio BV1ABcsztEcY --segment 25

# Find a user's latest video BV ID with minimal payload
bili user-videos 946974 --max 1 --yaml

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

# Search and inspect the first few results
bili search "topic" --type video --max 3 --yaml

Workflow: Video Content Analysis

# 1. Search for a topic
bili search "AI" --type video --max 5

# 2. Get subtitles first for summarization
bili video BV1xxx --subtitle

# 3. If subtitles are missing or incomplete, try AI summary
bili video BV1xxx --ai

# 4. If there is still not enough content, extract audio for ASR
bili audio BV1xxx --segment 25

# 5. Get comments for audience reaction
bili video BV1xxx --comments

Workflow: UP主 Research

# 1. Look up UP主 profile
bili user "影视飓风"

# 2. Get their recent videos
bili user-videos 946974 --max 10

# 3. Inspect a specific video
bili video BV1xxx --ai --comments

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

Safety Notes

  • Do not ask users to share raw credential/cookie values in chat logs.
  • Prefer local browser cookie extraction over manual secret copy/paste.
  • If auth fails, ask the user to re-login via bili login.

Related skills

How it compares

Choose bilibili-cli for Bilibili-specific terminal automation; general yt-dlp workflows cover broader video sites but lack Bilibili-focused agent skill integration.

FAQ

What can bilibili-cli do from the terminal?

bilibili-cli downloads Bilibili videos, fetches video metadata, and scrapes public Bilibili content from the command line. The skill integrates into shell sessions and coding agent workflows for automated media pipelines.

How popular is bilibili-cli on skills.sh?

bilibili-cli from jackwener/bilibili-cli ranks 14 on skills.sh with 455 installs. Developers use it for terminal-based Bilibili video retrieval and metadata extraction inside agent pipelines.

CLI & Terminalintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.