mirror of
https://github.com/n8n-io/n8n.git
synced 2026-07-28 11:35:03 +02:00
Co-authored-by: Iván Ovejero <ivov.src@gmail.com> Co-authored-by: Stephen Wright <sjw948@gmail.com> Co-authored-by: n8n-assistant[bot] <100856346+n8n-assistant[bot]@users.noreply.github.com> Co-authored-by: Charlie Kolb <charlie@n8n.io> Co-authored-by: Guillaume Jacquart <jacquart.guillaume@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Bernhard Wittmann <bernhard.wittmann@n8n.io> Co-authored-by: Nikhil Kuriakose <nikhil.kuriakose@n8n.io> Co-authored-by: Albert Alises <albert.alises@gmail.com> Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com> Co-authored-by: Andreas Fitzek <andreas.fitzek@n8n.io> Co-authored-by: Elias Meire <elias@meire.dev> Co-authored-by: Robin Braumann <50590409+bjorger@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: yehorkardash <yehor.kardash@n8n.io> Co-authored-by: Mike Repeć <mike.repec@n8n.io> Co-authored-by: Yuliia Pominchuk <31064937+yuliia-pominchuk@users.noreply.github.com> Co-authored-by: RomanDavydchuk <roman.davydchuk@n8n.io> Co-authored-by: Kai <kai.hartlage@n8n.io> Co-authored-by: José Braulio González Valido <jose.gonzalez@n8n.io> Co-authored-by: Michael Drury <me@michaeldrury.co.uk> Co-authored-by: Alex Grozav <alex@grozav.com> Co-authored-by: Lorent Lempereur <looorent@users.noreply.github.com> Co-authored-by: Rodrigo Santos da Silva <rodrigo.silva@n8n.io> Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Co-authored-by: Dmitrii <dmitrii.kulikov@n8n.io> Co-authored-by: Savelii <savelii.sychov@n8n.io> Co-authored-by: Arvin A <51036481+DeveloperTheExplorer@users.noreply.github.com> Co-authored-by: Raúl Gómez Morales <raul00gm@gmail.com> Co-authored-by: multica-agent <github@multica.ai> Co-authored-by: Yen Su <49794855+yens1@users.noreply.github.com> Co-authored-by: Nour Alhadi Mahmoud <nour.mahmoud@n8n.io> Co-authored-by: Eugene <eugene@n8n.io> Co-authored-by: LevSky22 <56281588+LevSky22@users.noreply.github.com> Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Sam Wooler <swooler592@gmail.com> Co-authored-by: Soham Ingle <sohamingle@gmail.com> Co-authored-by: Vishesh Gupta <vishesh.gupta12@outlook.com> Co-authored-by: Declan Carroll <declan@n8n.io> Co-authored-by: Jan Kalkan <jan.kalkan@n8n.io> Co-authored-by: n8n-assistant[bot] <n8n-assistant[bot]@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| bin | ||
| docs | ||
| skills/n8n-cli | ||
| src | ||
| eslint.config.mjs | ||
| LICENSE.md | ||
| package.json | ||
| README.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
| vitest.config.ts | ||
@n8n/cli
Client CLI for n8n. Manage workflows, executions, credentials, and more from the terminal.
A lightweight, zero-dependency CLI that talks to any n8n instance via its public API. Designed for humans, scripts, and AI coding agents alike.
Installation
# Use directly with npx (zero install)
npx @n8n/cli workflow list
# Or install globally
npm install -g @n8n/cli
Configuration
The CLI needs your n8n instance URL and an API key.
Config file (recommended)
n8n-cli config set-url https://my-n8n.app.n8n.cloud
n8n-cli config set-api-key n8n_api_xxxxx
n8n-cli config show
Configuration is saved to ~/.n8n-cli/config.json with restricted file permissions (0600).
Environment variables
export N8N_URL=https://my-n8n.app.n8n.cloud
export N8N_API_KEY=n8n_api_xxxxx
Inline flags
n8n-cli --url=https://my-n8n.app.n8n.cloud --api-key=n8n_api_xxxxx workflow list
Resolution order
- Command-line flags (
--url,--api-key) - Environment variables (
N8N_URL,N8N_API_KEY) - Config file (
~/.n8n-cli/config.json)
Commands
| Topic | Commands |
|---|---|
workflow |
list, get, create, update, delete, activate, deactivate, tags, transfer |
execution |
list, get, retry, stop, delete |
credential |
list, get, schema, create, delete, transfer |
project |
list, get, create, update, delete, members, add-member, remove-member |
tag |
list, create, update, delete |
variable |
list, create, update, delete |
data-table |
list, get, create, delete, rows, add-rows, update-rows, upsert-rows, delete-rows |
user |
list, get |
config |
set-url, set-api-key, show |
source-control |
pull |
package |
export, import (beta) |
skill |
install |
audit |
(top-level) |
login / logout |
(top-level) |
Every command supports --help for detailed usage.
Output formats
All commands support three output formats via --format:
| Format | Flag | Use case |
|---|---|---|
| Table | --format=table (default) |
Human-readable terminal output |
| JSON | --format=json |
Piping to jq, programmatic use |
| ID-only | --format=id-only |
Piping to xargs, scripting |
# Human-readable table
n8n-cli workflow list
# JSON for scripts
n8n-cli workflow list --format=json | jq '.[] | select(.active) | .id'
# Pipe IDs into another command
n8n-cli workflow list --format=id-only | xargs -I{} n8n-cli workflow deactivate {}
AI agent integration
The CLI ships with a skill file that teaches AI coding agents how to use it.
# Claude Code (project-level)
n8n-cli skill install
# Claude Code (global)
n8n-cli skill install --global
# Cursor
n8n-cli skill install --target=cursor
# Windsurf
n8n-cli skill install --target=windsurf
Development
# Build
pnpm build
# Watch mode
pnpm dev
# Run tests
pnpm test
# Lint & typecheck
pnpm lint
pnpm typecheck
License
See LICENSE.md for details.