ai-cli

n8n community node that runs your locally-installed, already-logged-in Claude Code and OpenAI Codex CLIs — use your existing Claude Pro/Max or ChatGPT subscription from a workflow without an API key.

Package Information

Released: 3 mo ago
Downloads: 0 weekly / 0 monthly
Latest Version: 0.2.0

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

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

Discussion