@weibo-ai/weibo-cli
v0.9.0
Published
Open-source CLI for Weibo platform capabilities.
Readme
weibo-cli
Open-source CLI for the Weibo Open Platform — for humans and AI agents.
npm install -g @weibo-ai/weibo-cliOperate statuses, comments, friendships, search, users, and more from your terminal — with structured JSON / YAML / table output for scripting and agents.
| | |
| --- | --- |
| Agent-friendly | Machine-readable output; pipe to jq or agents |
| Live command catalog | weibo --help syncs with the platform |
| OAuth built-in | Browser or device-code login; tokens in OS keychain |
| Lightweight | Node.js ≥ 18, no native addons |
Quick start
weibo auth login # browser in a desktop TTY; device flow when stdin is not a TTY
# weibo auth login --device # force device flow for SSH / remote / headless use
weibo auth whoami
weibo statuses friends_timeline/bizAuthentication
| Command | Description |
| --- | --- |
| auth login | Auto-select browser (TTY) or device flow (non-TTY) |
| auth login --device | Force device flow (headless, with human approval) |
| auth whoami | Verify session |
| auth logout | Clear local credentials |
Commands
Pattern: weibo <group> <action> [flags] — actions may contain / (e.g. show_batch/other).
weibo --help
weibo commands list
weibo commands show users show_batch/otherExamples
weibo statuses friends_timeline/biz --count 5
weibo statuses show_batch/biz --ids 1234567890
weibo comments show/biz --id 1234567890
weibo friendships friends/biz
weibo users show/biz
weibo users show_batch/other --screen_name 来去之间
weibo search statuses/limited --q keywordGlobal flags: --output json|table|yaml|raw · --token <token> · -h, --help
--help/-h always prints human-readable help. If combined with --output, help takes precedence and the output format is ignored.
When --output is omitted, each command uses its command-specific default (for example, doctor uses a human-readable readiness report).
Platform groups include statuses, comments, friendships, search, users, attitudes, tags, short_url, wbindex, plus built-ins auth, me, commands, config, version, upgrade.
Output
weibo statuses friends_timeline/biz --output table
weibo statuses friends_timeline/biz --output json | jq '.[] | .text'With an explicit --output, failures also write the API/error body to stderr in that format.
中文文档
微博开放平台命令行工具 — 终端操作微博、评论、关注、搜索等,适合脚本与 AI Agent。
安装与快速开始
npm install -g @weibo-ai/weibo-cli
weibo auth login # 桌面终端默认浏览器;stdin 非 TTY 时自动设备码
# weibo auth login --device # SSH / 远程 / 无图形界面时强制设备码
weibo auth whoami
weibo statuses friends_timeline/biz认证
| 命令 | 说明 |
| --- | --- |
| auth login | 自动选择浏览器(TTY)或设备码(非 TTY) |
| auth login --device | 强制设备码登录(仍需用户在浏览器确认) |
| auth whoami | 验证会话 |
| auth logout | 清除本地凭据 |
命令示例
weibo --help
weibo commands list --group statuses
weibo statuses friends_timeline/biz --count 5
weibo users show_batch/other --screen_name 来去之间
weibo comments to_me/biz用户查询: 已知昵称用 users show_batch/other --screen_name;按关键词搜微博用 search statuses/limited --q。
输出格式: --output json|table|yaml|raw
License
MIT
