npm
npm i -g @vectorx/xhs-cloud-cli
yarn
yarn global add @vectorx/xhs-cloud-cli
pnpm
pnpm add -g @vectorx/xhs-cloud-cli
安装报错:
如果访问官方 npm 源有问题,一般安装过程中报类似 "ETIMEOUT"、"npm ERR! network request to https://registry.npmjs.org/@vectorx%2fxhs-cloud-cli failed" 这种错误,这个时候需要临时指定一个国内 npm 镜像源:
npm i -g @vectorx/xhs-cloud-cli --registry=https://registry.npmmirror.com
yarn global add @vectorx/xhs-cloud-cli --registry=https://registry.npmmirror.com
pnpm add -g @vectorx/xhs-cloud-cli --registry=https://registry.npmmirror.com
安装完成后,您需要先登录才能开始使用小红书云 CLI。小红书云 CLI 提供了 API 密钥授权方式登录。
💡 推荐: 适合个人开发者使用:
rcb login --secretId <secretId> --secretKey <secretKey>
回车后,请按提示输入从小红书小程序开发平台获取的
⚠️ 注意:API 密钥可以操作您名下的所有小红书云服务资源,请妥善保存和定期更换密钥,当您更换密钥后,请及时删除旧密钥。
首先您需要到小红书小程序开发平台获取密钥。
登录成功后会显示:
✓ 正在验证小红书云服务密钥信息... 获取 access_token 成功: xxxxxxxx access_token 过期时间: 2024-12-31 23:59:59 🎉 登录成功!欢迎使用小红书云服务 CLI
使用
rcb -h
运行后会显示:
RedCloudBase CLI 0.4.2 [API Config] Env: production ...