Package Information
Available Nodes
Documentation generating…
Documentation
n8n-nodes-ai-cli
An n8n community node that runs your locally-installed, already-logged-in AI coding CLIs from inside a workflow:
- Claude Code (
claude -p) — uses your Claude Pro/Max subscription - OpenAI Codex (
codex exec) — uses your ChatGPT subscription
Because it drives the official first-party CLIs (which you log into with your normal account), it uses your existing subscription quota — no API key and no separate per-token billing. This only works on a machine where the CLI is installed and you've already run its login flow.
⚠️ Security: this node executes the CLI as the same OS user running n8n. With Skip Permission Prompts enabled the model can run commands and edit files on that machine. Only use it in workflows you trust, and never expose the n8n instance to the internet without authentication.
Prerequisites
- n8n running via a direct (npm) install, not the locked-down Docker/Cloud image, so it can execute host binaries.
- The CLI(s) installed and authenticated for the user running n8n:
- Claude Code: https://docs.anthropic.com/en/docs/claude-code
- OpenAI Codex: https://github.com/openai/codex
Installation
Community Nodes (recommended): Settings → Community Nodes → Install → n8n-nodes-ai-cli.
Local development (this repo):
npm install
npm run build
# link into n8n's custom extensions dir
npm link
mkdir -p ~/.n8n/custom && cd ~/.n8n/custom && npm link n8n-nodes-ai-cli
# restart n8n
Node: AI CLI
| Field | Description |
|---|---|
| Provider | Claude Code or OpenAI Codex |
| Prompt | The prompt sent to the CLI |
| Model | Optional model override (e.g. claude-sonnet-4-5, gpt-5-codex) |
| Binary Path | Optional absolute path to the CLI; auto-resolved from PATH otherwise |
| Working Directory | Directory to run in (for file-aware tasks) |
| System Prompt | Claude: --append-system-prompt; Codex: prepended to the prompt |
| JSON Output | Request structured JSON and parse it into data |
| Skip Permission Prompts | Let the CLI run tools/edit files unattended (trusted workflows only) |
| Extra Arguments | Raw extra flags (space-split) |
| Timeout (ms) | Kill the CLI after N ms (default 300000) |
Output
{
"provider": "claude",
"model": "default",
"stdout": "…model response…",
"stderr": "",
"exitCode": 0
}
License
MIT