Retool CLI
$ retool 官方出品 中风险Retool CLI(@tryretool/cli,命令为 retool)支持将 Retool 原生 React 应用克隆到本地(clone)、离线执行类型与结构校验(retool check)、推送预览构建(push)以及发布上线(publish)。支持 --token 无头登录与 retool skill install,但缺少 --json 输出且强制要求 Node 22+、pnpm 与 git。
npm install -g @tryretool/cli 本地 retool check 离线校验以及基于 Git 仓库的 React 应用 push/publish 直接在本地执行更高效。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
支持 retool skill install、auth login --token 与非交互式 check/push/publish,但缺少 --json 输出与 --dry-run。
retool skill installand--tokenauth- No global
--jsonoutput format
将离线 retool check、预览 retool push 与生产 retool publish 清晰分离,降低误发布风险。
- Offline
retool checkvalidation - Preview
pushseparated from livepublish
通过 @tryretool/cli 安装,但强依赖 Node.js 22+、pnpm 与 git。
- Requires Node 22+,
pnpm, andgit
顺畅覆盖本地 React 应用拉取、离线校验、预览构建与上线发布流程。
- Supports
init,clone,check,push,publish, andapps
新版 @tryretool/cli 已替代处于废弃状态的旧版 tryretool/retool-cli 仓库。
- Active
@tryretool/clinpm package; classic repo deprecated
在 docs.retool.com/build/apps/guides/create/cli 与 @tryretool/cli 的 README 中均有详细说明。
- Official Retool CLI documentation
安全边界、鉴权与放权指南
通过 retool auth login --host <org>.retool.com 登录,也可使用具备 react_apps:write 权限的 retool auth login --token <token> 或 --device 无头认证。
MIT 协议的 @tryretool/cli;需配合 Retool 组织账号使用(提供免费版)。
# Retool CLI Agent Rules - Always run `retool check` locally before `retool push`. - Never run `retool publish` without explicit human approval; keep automated runs on preview `retool push`.
Agent 高频安全命令配方
只读查询(安全推荐)
retool check
离线验证本地 React/TypeScript Retool 应用代码,不消耗服务端构建资源。
retool apps
只读列出当前已认证组织下的 Retool 应用列表。
受控写入与预演
retool push -m "Update dashboard layout"
上传已校验的本地变更并触发预览构建,暂不直接发布到生产环境。
核心优势
- + 离线
retool check可在推送预览前拦截类型与结构错误。 - + 区分预览
retool push与正式retool publish,并内置retool skill install。
注意事项与踩坑点
- ! 缺少
--json结构化输出,且要求本地安装 Node 22+、pnpm与git。 - ! 旧版
tryretool/retool-cli仓库已废弃,新项目应使用@tryretool/cli。