Xpersona
B

bilibili-cli

CLAWHUB · Unverified

CLI skill for Bilibili (哔哩哔哩, B站) with token-efficient YAML output for AI agents to browse videos, users, search, trending, dynamics, favorites, and interact... Skill: bilibili-cli Owner: jackwener Summary: CLI skill for Bilibili (哔哩哔哩, B站) with token-efficient YAML output for AI agents to browse videos, users, search, trending, dynamics, favorites, and interact... Tags: latest:0.6.0 Version history: v0.6.0 | 2026-03-10T16:30:53.890Z | user Release 0.6.0 v0.5.0 | 2026-03-10T07:34:06.326Z | user Release 0.5.0 v0.4.1 | 2026-03-08T18:15:27.325Z | user Sync SKILL.md: add Chinese

62
Rank
84
Safety
1.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s176j4v65c2r3ydppd13q6pm0h885k6x:bilibili-cli
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-jackwener-bilibili-cli/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

99,233 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
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: "1.0.0"
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]"
```

## 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
```

### Search

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

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

# 

README.md

# bilibili-cli

[![CI](https://github.com/jackwener/bilibili-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/jackwener/bilibili-cli/actions/workflows/ci.yml)
[![PyPI version](https://img.shields.io/pypi/v/bilibili_cli.svg)](https://pypi.org/project/bilibili-cli/)
[![Python versions](https://img.shields.io/pypi/pyversions/bilibili_cli.svg)](https://pypi.org/project/bilibili-cli/)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](./LICENSE)

A CLI for Bilibili — browse videos, users, favorites from the terminal 📺

[English](#features) | [中文](#功能特性)

## More Projects

- [xhs-cli](https://github.com/jackwener/xhs-cli) — Xiaohongshu CLI tooling
- [twitter-cli](https://github.com/jackwener/twitter-cli) — Twitter/X CLI tooling
- [discord-cli](https://github.com/jackwener/discord-cli) — Discord CLI for local-first chat sync and search
- [tg-cli](https://github.com/jackwener/tg-cli) — Telegram CLI for local-first sync, search, and export

## Features

- 🎬 **Video** — details, subtitles, AI summary, comments, related videos
- 🎵 **Audio** — extract audio and split into ASR-ready WAV segments
- 👤 **User** — profile, video list, following list
- 🔍 **Search** — search users or videos by keyword
- 🔥 **Trending** — hot videos and site-wide ranking
- 📰 **Feed** — dynamic timeline from your follows
- 📂 **Favorites** — browse favorite folders, watch-later, and watch history
- 👍 **Interactions** — like, coin, triple (一键三连)
- 🔐 **Smart auth** — auto-extracts cookies from Chrome/Firefox, or QR code login
- 📊 **Structured output** — major query commands support `--yaml` and `--json`
- 🤖 **Agent-friendly defaults** — non-TTY stdout defaults to YAML; override with `OUTPUT=yaml|json|rich|auto`
- 📦 **Stable envelope** — see [SCHEMA.md](./SCHEMA.md) for `ok/schema_version/data/error`
- 🧱 **Normalized payloads** — command-layer output is normalized instead of leaking raw upstream SDK responses

## Installation

```bash
# Recommended: uv tool (fast, isolated)
uv tool install bilibili-cli

# Or: pipx
pipx install bilibili-cli

# If you need audio extraction support
uv tool install "bilibili-cli[audio]"
# or
pipx install "bilibili-cli[audio]"
```

Or from source:

```bash
git clone git@github.com:jackwener/bilibili-cli.git
cd bilibili-cli
uv sync
```

Run tests in the project environment:

```bash
uv sync --extra dev
uv run pytest -q
uv run ruff check .
uv run python -m mypy bili_cli
```

If the project directory was moved and stale virtualenv wrappers remain, rerun:

```bash
uv sync --extra dev --reinstall
```

## Usage

```bash
# Login & account
bili status                    # Check login status
bili status --yaml             # Structured auth status
bili login                     # QR code login
bili whoami                    # Detailed profile (level, coins, followers)
bili whoami --yaml             # Structured profile

# Videos
bili video BV1ABcsztEcY                 # Video details
bili video BV1ABcsztEcY --subtitle      

_meta.json

{
  "ownerId": "kn757vsv03fbpevrxybjc424wh828377",
  "slug": "bilibili-cli",
  "version": "0.6.0",
  "publishedAt": 1773160253890
}

CHANGELOG.md

# Changelog

## 0.5.0

- Add subtitle timeline output via `bili video --subtitle-timeline` / `-st`
- Add `--subtitle-format timeline|srt`
- Keep subtitle timeline compatible with current `--yaml` / `--json` command surface
- Ensure subtitle timeline requests load optional credentials like plain subtitles
- Restore README badges and fix CI type-checking with `types-PyYAML`

SCHEMA.md

# Structured Output Schema

`bilibili-cli` uses a shared agent-friendly envelope for machine-readable output.

## Success

```yaml
ok: true
schema_version: "1"
data: ...
```

## Error

```yaml
ok: false
schema_version: "1"
error:
  code: api_error
  message: 未找到用户: foo
```

## Notes

- `--yaml` and `--json` both use this envelope
- non-TTY stdout defaults to YAML
- command payloads are normalized at the CLI layer
- list-like results are typically returned under `data.items`
- `status` returns `data.authenticated` plus `data.user`
- `whoami` returns `data.user` and `data.relation`
- `video` returns `data.video`, `data.subtitle`, `data.ai_summary`, `data.comments`, `data.related`, and `data.warnings`
- write commands return normalized action payloads with `data.success` and `data.action`

## Error Codes

Common structured error codes:

- `not_authenticated`
- `permission_denied`
- `invalid_input`
- `network_error`
- `upstream_error`
- `not_found`
- `internal_error`

Sponsored

Ads related to bilibili-cli and adjacent AI workflows.