Agent skill

Bilibili CLI

by public-clis in public-clis/bilibili-cli

CLI skill for Bilibili (哔哩哔哩, B站) with token-efficient YAML output for AI agents to browse videos, users, search, trending, dynamics, favorites, and interactions from the terminal

Apache-2.0Auto-check: warningsMedia & Creative

Install Bilibili CLI

The automated check flagged lines worth reading first. See the safety section below.

skills CLI
$ npx skills add public-clis/bilibili-cli --skill bilibili-cli -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install public-clis/bilibili-cli bilibili-cli --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bilibili-cli
GitHub stars
1.1k
Token cost
~2k tokens
SKILL.md length
316 words
Files
37
Skills in repo
1
Repo updated
First seen
Licence
Apache-2.0

At a glance

CLI skill for Bilibili (哔哩哔哩, B站) with token-efficient YAML output for AI agents to browse videos, users, search, trending, dynamics, favorites, and interactions from the terminal

  • Works in 6 steps: Prefer --yaml first because it is… → Use --json only when downstream tooling… → Keep result sets small with --max,… → …
  • Media & Creative work in your project
  • SKILL.md covers Agent Defaults, Prerequisites, Authentication and Command Reference, plus 5 more sections
  • Runs Python scripts from its folder; calls uv and jq; reaches bilibili.com

What it does

Bilibili CLI is an agent skill from public-clis/bilibili-cli. CLI skill for Bilibili (哔哩哔哩, B站) with token-efficient YAML output for AI agents to browse videos, users, search, trending, dynamics, favorites, and interactions from the terminal

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 41 other files (for example `.github/ISSUE_TEMPLATE/bug_report.yml`, `.github/ISSUE_TEMPLATE/feature_request.yml` and `.github/workflows/ci.yml`).

It sits in Media & Creative. It works with Bilibili. The repository describes itself as: A CLI for Bilibili — browse videos, users, search, and feeds from the terminal. The licence is Apache-2.0.

When your agent uses it

  • Media & Creative work in your project

Example prompts

  • “/bilibili-cli”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  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…
  6. Only fall back to --ai, comments, or audio extraction when subtitles are unavailable or clearly insufficient.

What it can do on your machine

Read from SKILL.md and the folder at commit dbe2855. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • uv
    • jq

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • bilibili.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bilibili CLI loads about 2k tokens when it runs. Until then it costs about 48 tokens; SKILL.md has 316 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~48
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: warnings

The automated check found patterns that need a careful read before installing.

  • WarningMentions a credentials file (SSH keys, cloud or package-manager tokens)SKILL.md:55
    ion auto-detects local browser cookies (Chrome/Firefox/Edge/Brave). If cookies are found and valid, no manual login need

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from public-clis/bilibili-cli at commit dbe2855, republished under its Apache-2.0 licence (© public-clis). 316 words, ~1,989 tokens.

Download SKILL.mdSave it as .claude/skills/bilibili-cli/SKILL.md (or your agent's skills folder). This skill also uses 36 other files; get the full folder from GitHub.
name
bilibili-cli
description
CLI skill for Bilibili (哔哩哔哩, B站) with token-efficient YAML output for AI agents to browse videos, users, search, trending, dynamics, favorites, and interactions from the terminal
author
jackwener
version
0.6.2
tags
bilibili, 哔哩哔哩, b站, video, social-media, cli

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

bash
# 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.

bash
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
bash
# 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
bash
# 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
bash
# 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
bash
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)
bash
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]".

bash
# 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)
bash
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
bash
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:

bash
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

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

Common Patterns for AI Agents

bash
# 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
bash
# 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
bash
# 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.

© public-clis, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 36 other files in the repository root of public-clis/bilibili-cli.

  • SKILL.md
  • .github/ISSUE_TEMPLATE/bug_report.yml
  • .github/ISSUE_TEMPLATE/feature_request.yml
  • .github/workflows/ci.yml
  • .github/workflows/publish.yml
  • .gitignore
  • CHANGELOG.md
  • LICENSE
  • README.md
  • SCHEMA.md
  • bili_cli/__init__.py
  • bili_cli/auth.py
  • bili_cli/cli.py
  • bili_cli/client.py
  • bili_cli/commands/__init__.py
  • bili_cli/commands/account.py
  • … and 21 more

Open the folder on GitHubat commit dbe2855

Compare with similar skills

Bilibili CLI next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bilibili CLI compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bilibili CLI this skillpublic-clis/bilibili-cli1.1k—~2kAutomated safety check: WarnApache-2.0
Bilibili Transcribechubbyguan/chubbyskills1.2k—~578Automated safety check: NotesMIT
VideoiBigQiang/feedgrab614—~1.6kAutomated safety check: PassMIT
Bilibili Sourcedaymade/claude-code-skills1.4k—~2.2kAutomated safety check: PassMIT
BibiJimmyLv/BibiGPT-v16.2k—~885Automated safety check: PassGPL-3.0
Video Podcast MakerAgents365-ai/video-podcast-maker1.7k—~4.9kAutomated safety check: PassMIT

Similar skills

  • Bilibili Transcribe

    chubbyguan/chubbyskills

    哔哩哔哩视频 → 下载 → 转录 → 存为 Markdown 的完整工作流. An agent skill from chubbyguan/chubbyskills.

    1.2k GitHub stars~578 tokensUpdated yesterday
    Media & CreativeAuto-check: notes
  • Video

    iBigQiang/feedgrab

    Video & Podcast Digest — send a video/podcast link, get full transcript + structured summary.

    614 GitHub stars~1.6k tokensUpdated 1 mo ago
    Media & CreativeAuto-check passed
  • Bilibili Source

    daymade/claude-code-skills

    Fetches real, citable Bilibili (B站) video data — stats, metadata, tags, and full danmaku text — via login-free API calls, never hand-typed or estimated.

    1.4k GitHub stars~2.2k tokensUpdated today
    Media & CreativeAuto-check passed
  • Bibi

    JimmyLv/BibiGPT-v1

    BibiGPT CLI for summarizing videos, audio, and podcasts directly in the terminal.

    6.2k GitHub stars~885 tokensUpdated 5 mo ago
    Media & CreativeAuto-check passed
  • Video Podcast Maker

    Agents365-ai/video-podcast-maker

    A skill your agent uses when the user gives a topic and wants an automated topic-driven narrated explainer, podcast, or knowledge-summary video (Bilibili / YouTube / Xiaohongshu / Douyin / WeChat…

    1.7k GitHub stars~4.9k tokensUpdated 8 days ago
    Media & CreativeAuto-check passed
  • Video Transcribe

    wendy7756/AI-Video-Transcriber

    Transcribe and summarize a video or podcast from a URL (YouTube, TikTok, Bilibili, Apple Podcasts, SoundCloud, 30+ platforms) or from a local media/.txt file.

    3.3k GitHub stars~937 tokensUpdated 24 days ago
    Media & CreativeAuto-check: notes

Works with

Questions about Bilibili CLI

What does Bilibili CLI do?

CLI skill for Bilibili (哔哩哔哩, B站) with token-efficient YAML output for AI agents to browse videos, users, search, trending, dynamics, favorites, and interactions from the terminal. Bilibili CLI is an agent skill from public-clis/bilibili-cli.

When should I use Bilibili CLI?

Bilibili CLI fits situations like: media & Creative work in your project.

How do I install Bilibili CLI in Claude Code?

Run `npx skills add public-clis/bilibili-cli --skill bilibili-cli -a claude-code`. Or copy the skill folder (the public-clis/bilibili-cli repository) into .claude/skills/bilibili-cli in your project. Claude Code loads it when a task matches its description.

How do I install Bilibili CLI in Codex?

Run `npx skills add public-clis/bilibili-cli --skill bilibili-cli -a codex`. Or copy the skill folder (the public-clis/bilibili-cli repository) into .agents/skills/bilibili-cli in your project. Codex loads it when a task matches its description.

Can I use Bilibili CLI in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add public-clis/bilibili-cli --skill bilibili-cli -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bilibili-cli, .gemini/skills/bilibili-cli, .github/skills/bilibili-cli and .opencode/skills/bilibili-cli in your project.

What does Bilibili CLI need to run?

Going by SKILL.md and its folder, Bilibili CLI needs Python for the scripts in its folder and the command-line tools its instructions call (uv and jq). Our summary lists: Python 3.

Does Bilibili CLI access the network?

SKILL.md names 1 domain. In commands or code: bilibili.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Bilibili CLI safe to install?

Our automated static check of SKILL.md flagged 1 warning(s): mentions a credentials file (ssh keys, cloud or package-manager tokens). Read the flagged lines before installing; the check is not a guarantee either way.

What licence does Bilibili CLI use?

Bilibili CLI is published under the Apache-2.0 licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bilibili CLI use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bilibili CLI?

Skills that share tags, products or a category with Bilibili CLI: Bilibili Transcribe (chubbyguan/chubbyskills, 1.2k stars), Video (iBigQiang/feedgrab, 614 stars), Bilibili Source (daymade/claude-code-skills, 1.4k stars) and Bibi (JimmyLv/BibiGPT-v1, 6.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bilibili CLI?

public-clis (a GitHub organization) maintains it in public-clis/bilibili-cli, which has 1,070 GitHub stars. The repository was last updated on March 14, 2026.

Source: public-clis/bilibili-cli on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.