Skip to main content

Rednote platform CLI

Project description

rednote-cli

Rednote 平台专用 CLI 包(独立安装、独立升级)。

安装

pipx install rednote-cli

快速开始

rednote-cli init runtime
rednote-cli doctor run --format json
rednote-cli account login
rednote-cli account status --format json
rednote-cli account list --only-active true
rednote-cli account list --only-active false
rednote-cli search note --keyword 旅行 --size 10 --sort-by latest --note-type image_text --format json
rednote-cli publish --target image --account user_001 --image-list /abs/a.jpg,/abs/b.jpg --title 标题 --content 正文 --format json
rednote-cli publish --target video --account user_001 --video /abs/demo.mp4 --title 标题 --content 正文 --format json

命令结构(当前版本):

  • note / user 作为详情查询入口,search note|user 作为统一搜索入口。
  • 旧层级 note get|searchuser get|search 已移除。

空参数行为(统一约定):

  • rednote-cli noterednote-cli publishrednote-cli account activate 等缺少业务参数时,输出帮助文本并返回退出码 0
  • 非空调用但参数非法时,返回 JSON INVALID_ARGS(退出码 2)。

account status 会实时打开浏览器检查登录态并刷新账号存储(is_logged_in/check_time/storage_state),输出结构与 account list --only-active false 对齐。

account list--only-active 支持显式 true|false(默认 true)。

发布能力说明:

  • publish --target image:图文发布,支持本地/URL 图片,--account 必填。
  • publish --target video:视频发布,支持本地/URL 视频(仅 mp4/mov),--account 必填。

自动化建议

rednote-cli --format json --trace-id req-001 <command> ...

--input(面向 AI/Agent):

  • 作用:从 JSON 文件或 stdin 读取参数,适合复杂命令的程序化调用。
  • 优先级:显式 CLI 参数 > --input JSON > 默认值。
  • 范围:--input 不是全局参数,仅 search note|usernoteuserpublish 支持。

示例:

rednote-cli --format json --trace-id req-001 search note --input payload.json
cat payload.json | rednote-cli --format json --trace-id req-002 publish --input - --account user_001

文档

完整文档请查看仓库根目录:

  • README.md
  • DESIGN.md
  • DEV.md
  • USER_GUIDE.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rednote_cli-0.1.0.tar.gz (53.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rednote_cli-0.1.0-py3-none-any.whl (75.8 kB view details)

Uploaded Python 3

File details

Details for the file rednote_cli-0.1.0.tar.gz.

File metadata

  • Download URL: rednote_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 53.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for rednote_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 159073aa4ca36bdfee80b37318e3fac947d232ad07dee439241e4ae4be1951a7
MD5 571929eeaf76fb656a0ed55fe84663e4
BLAKE2b-256 340a13bd83816174c677317f42c828f2bdac8b68981fd27a416d2c7c34f1e366

See more details on using hashes here.

File details

Details for the file rednote_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rednote_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 75.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for rednote_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45d1e1cb8357046b38b5f75859cb14aa1ed9719523947bd060eddae271fe95da
MD5 0a0e03addc481f357de113cea361a9c0
BLAKE2b-256 34be91afcd5b40060038d1419f5a7558062a6e1f8e59f19ba7325c35ac298daf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page