Skip to main content

Rednote platform CLI

Project description

rednote-cli

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

系统要求

  • Python 3.12.x
  • pipx

安装

brew update
brew upgrade python@3.12 pipx
python3.12 --version
pipx --version
pipx ensurepath
exec zsh

pipx install --python python3.12 rednote-cli

升级

pipx upgrade --python python3.12 rednote-cli

如果历史环境用了其他 Python(例如 3.14),先重建:

pipx reinstall --python python3.12 rednote-cli

卸载

pipx uninstall rednote-cli

快速开始

rednote-cli init runtime
rednote-cli doctor run --format json
rednote-cli account login
rednote-cli account status --format json
rednote-cli search note --keyword 旅行 --size 10 --sort-by latest --note-type image_text --format json

常用命令

rednote-cli search note --keyword <kw> [--size N] [--sort-by <comprehensive|latest|most_liked|most_commented|most_favorited>] [--note-type <all|video|image_text>] [--publish-time <all|day|week|half_year>] [--search-scope <all|viewed|unviewed|following>] [--location <all|local|nearby>] [--account <user_id>] [--input <file|->]

rednote-cli note --note-id <id> [--xsec-token t] [--xsec-source src] [--comment-size N] [--sub-comment-size N] [--account <user_id>] [--input <file|->]

rednote-cli search user --keyword <kw> [--size N] [--account <user_id>] [--input <file|->]

rednote-cli user --user-id <id> [--xsec-token t] [--xsec-source src] [--account <user_id>] [--input <file|->]

rednote-cli user self --account <user_id>

rednote-cli publish --target image --account <account_uid> [--image-list csv] [--title t] [--content c] [--tags csv] [--schedule-at rfc3339] [--input <file|->]
rednote-cli publish --target video --account <account_uid> [--video <path-or-url>] [--title t] [--content c] [--tags csv] [--schedule-at rfc3339] [--input <file|->]

JSON 输入模式(--input

参数优先级固定:

  • 显式 CLI 参数 > --input JSON > 默认值

支持 --input 的命令:

  • search note
  • search user
  • note
  • user
  • publish

不支持 --input 的命令:

  • init runtime
  • doctor run
  • account login|status|list|activate|deactivate|delete
  • user self

推荐 Agent 调用模板:

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

输出与退出码

  • 建议自动化调用统一使用 --format json + --trace-id
  • 退出码:0 成功,2 参数错误,3 认证错误,4 风控/限流,5 内部错误,6 超时,7 依赖缺失/未实现

工作区文档

  • Workspace 总览:../../README.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.3.tar.gz (53.5 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.3-py3-none-any.whl (75.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rednote_cli-0.1.3.tar.gz
  • Upload date:
  • Size: 53.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rednote_cli-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1f57294b11b8c78f0713eaadeaa7248de3c74e456e829ea95bbd6f611199f569
MD5 48708c6e3240c352a73cdb74eed3112d
BLAKE2b-256 a3c0155d6f19c3dff967b59b74690dac818a2bef537f347bf968c6d7d3e0dafe

See more details on using hashes here.

Provenance

The following attestation bundles were made for rednote_cli-0.1.3.tar.gz:

Publisher: release-pypi.yml on lofe-w/rednote-scraper-docker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: rednote_cli-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 75.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rednote_cli-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7c5de13c9ef90bba755cab77774ce14352fccdfe0f79a7ac5672d4e97449055b
MD5 8eb6b4c17e22d0f60c7a58ecded34a66
BLAKE2b-256 2edd587266611c18a3e358e23117361c918d04f1024768526e99aa35cf6b522b

See more details on using hashes here.

Provenance

The following attestation bundles were made for rednote_cli-0.1.3-py3-none-any.whl:

Publisher: release-pypi.yml on lofe-w/rednote-scraper-docker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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