npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@deluxebear/bilibilicli

v0.1.0

Published

Local CLI for browser-assisted Bilibili video uploads.

Downloads

29

Readme

bilibilicli

Browser-assisted local CLI for Bilibili video submission.

This project keeps login in a real browser, stores cookies under ~/.bilibilicli, and replays the upload/submission API from the CLI. Do not commit files from ~/.bilibilicli; they contain private account material.

Install

Published package:

npx @deluxebear/bilibilicli --help
npm install -g @deluxebear/bilibilicli
bilibilicli --help

Local package before publishing:

npm install
npm link

Or install the packed tarball globally:

npm pack
npm install -g ./deluxebear-bilibilicli-0.1.0.tgz
bilibilicli --help

To publish to npm:

npm login
npm publish --access public

npx @deluxebear/bilibilicli ... works after the package is published. npm install -g @deluxebear/bilibilicli installs the global bilibilicli command permanently.

Login

bilibilicli auth login --profile default
bilibilicli auth status --profile default
bilibilicli doctor --profile default

auth login opens Bilibili's member upload page with a persistent browser profile at:

~/.bilibilicli/browser-profiles/default/

After logging in, press Enter in the terminal. Cookies are saved to:

~/.bilibilicli/profiles/default/auth.json

Capture Requests

Use this when Bilibili changes fields or when you need to compare the CLI with the website:

bilibilicli auth capture --profile default --url https://member.bilibili.com/platform/upload/video/frame

Perform the website workflow in the opened browser, then press Enter. A redacted request summary is saved to:

~/.bilibilicli/profiles/default/capture-summary.json

Commands

Read-only:

bilibilicli commands list
bilibilicli config list
bilibilicli auth status --profile default
bilibilicli doctor --profile default

Upload a file but do not submit an archive:

bilibilicli upload file --profile default --file ./video.mp4

Upload a cover image:

bilibilicli cover upload --profile default --file ./cover.jpg

Upload and attach a subtitle draft to an uploaded video cid:

bilibilicli subtitle save \
  --profile default \
  --cid "<cid returned by upload file>" \
  --file ./subtitle.en.srt \
  --lan en

Save an uploaded file as a draft:

bilibilicli draft save \
  --profile default \
  --filename "<filename returned by upload file>" \
  --cid "<cid returned by upload file>" \
  --title "投稿标题" \
  --tid 27 \
  --tags "学习" \
  --subtitle-lan en \
  --description "简介"

Delete a draft by draft id:

bilibilicli draft delete --profile default --id 3399934

Mark an existing draft as having subtitles:

bilibilicli draft subtitle --profile default --id 3399965 --lan en

Submit an uploaded file:

bilibilicli archive submit \
  --profile default \
  --filename "<filename returned by upload file>" \
  --title "投稿标题" \
  --tid 17 \
  --tags "标签1,标签2" \
  --description "简介"

Upload and submit in one command:

bilibilicli video draft \
  --profile default \
  --file ./video.mp4 \
  --cover-file ./cover.jpg \
  --subtitle-file ./subtitle.en.srt \
  --subtitle-lan en \
  --title "投稿标题" \
  --tid 27 \
  --tags "学习" \
  --description "简介"

The currently verified website path is "upload and save draft". Direct archive submission is kept as a low-level command and may need another capture of the final submit button before use.

Upload and submit in one command:

bilibilicli video run \
  --profile default \
  --file ./video.mp4 \
  --title "投稿标题" \
  --tid 17 \
  --tags "标签1,标签2" \
  --description "简介"

upload file, draft save, video draft, archive submit, and video run are state-changing commands. They upload media, save drafts, and/or create a Bilibili submission.

Known Protocol

The first implementation uses these web endpoints:

  • GET https://api.bilibili.com/x/web-interface/nav for read-only account diagnostics.
  • POST https://member.bilibili.com/upload/multipart/new for current video upload initialization.
  • POST https://member.bilibili.com/upload/multipart/part, signed PUT, and POST https://member.bilibili.com/upload/multipart/complete for current video bytes.
  • POST https://member.bilibili.com/x/vu/web/cover/up for optional cover upload.
  • POST https://api.bilibili.com/x/upload/web/image with bucket=subtitle for subtitle file upload.
  • POST https://api.bilibili.com/x/v2/dm/subtitle/draft/preSave for attaching subtitle drafts.
  • POST https://member.bilibili.com/x/vupre/web/draft/add for saving an upload as a draft.
  • POST https://member.bilibili.com/x/vupre/web/draft/update for marking a saved draft subtitle language.
  • POST https://member.bilibili.com/x/vupre/web/draft/delete for deleting a draft by id.
  • Legacy GET https://member.bilibili.com/preupload and Upos multipart helpers are retained in code for older upload paths.
  • POST https://member.bilibili.com/x/vu/web/add/v3 for archive submission.

Bilibili can change required fields, CDN choices, or anti-abuse checks. If a command fails, run auth capture, perform the same action on the website, and compare the redacted capture with the CLI request shape.