cli-anything-n8n 是做什么的?
用于 n8n 工作流自动化的 CLI 工具——基于 CLI-Anything 模式构建。 已根据 n8n OpenAPI 规范 v1.1.1 进行验证。
安装
pip install cli-anything-n8n
配置
cli-anything-n8n config set base_url https://your-n8n-instance.com
cli-anything-n8n config set api_key your-api-key
# 或者使用环境变量
export N8N_BASE_URL=https://your-n8n-instance.com
export N8N_API_KEY=your-api-key
export N8N_TIMEOUT=60 # 可选,默认 30 秒
命令组
| 命令组 | 命令 |
|---|---|
| workflow | list, get, create, update, delete, activate, deactivate, tags, set-tags, transfer |
| execution | list, get, delete, retry |
| credential | create, delete, schema, transfer |
| variable | list, create, update, delete |
| tag | list, get, create, update, delete |
| config | show, set |
针对 AI 代理
- 始终使用
--json标志以获取结构化输出 - 使用
@file.json从文件传递复杂 JSON - 检查返回码:0 = 成功,非零 = 错误
- 所有 ID 均为字符串,而非整数
- 在
config show输出中,API 密钥始终被屏蔽 - 公开 API 中不可用:数据表、凭证列表、执行停止