sorftime-cli
v1.0.0
Published
Sorftime 命令行工具 - 多账户管理与API接口调用
Readme
sorftime-cli
Sorftime 命令行工具 - 多账户管理与API接口调用
安装
🔒 安全说明:本工具完全开源,代码可公开审计
- 开源仓库地址:https://github.com/sorftime/sorftime-cli
- npm 官方包主页:https://www.npmjs.com/package/sorftime-cli
- 发布者为 Sorftime 官方认证账号,无恶意代码
方式1:全局安装(推荐)
npm install -g sorftime-cli方式2:本地编译安装(适合安全要求高的用户)
git clone https://github.com/sorftime/sorftime-cli.git
cd sorftime-cli
npm install && npm run build
npm link使用
账户管理
# 添加账户(保存Account-SK)
# profile-name: 账户名称,可自定义。如 sorftime-cli
# your-account-sk: 账户的Account-SK。Sorftime API 和 CLI 公用Key,开通后API Key 同时可用于CLI。 获取方式详见:https://www.sorftime.com/cli
sorftime add <profile-name> <your-account-sk>
# 列出所有账户
sorftime list / sorftime ls
# 切换当前活跃账户
sorftime use <profile-name>
# 查看当前活跃账户
sorftime whoami
# 删除账户
sorftime remove <profile-name>API调用
# 调用API接口
# endpoint: API接口名称,参考文档 https://www.sorftime.com/cli
# domain: 站点ID, 例如:1: us | 2: gb | 3: de | ......
sorftime api <endpoint> [params] --domain 1
# 示例:调用类目查询接口
sorftime api categoryrequest '{"nodeid": "3743561"}' --domain 1
# 示例:调用产品详情接口
sorftime api productrequest '{"asin": "B0CVM8TXHP", "trend":1}' --domain 1功能特性
- ✅ 已上线电商平台数据:亚马逊、Shopee、Walmart、 更多平台即将开放:Tiktok、Temu、1688、MercadoLibre
- ✅ 多账户Profile管理
- ✅ 自动处理API认证
- ✅ 自动解码解压Shopee/Walmart接口返回结果
- ✅ JSON格式输入输出,适合脚本和管道调用
- ✅ 友好的命令行交互和错误提示
