n8n/packages/@n8n/cli
2026-05-12 10:58:00 +00:00
..
bin feat: Add @n8n/cli: a client CLI to manage n8n from the terminal (#26943) 2026-03-20 14:11:35 +00:00
docs feat: Add @n8n/cli: a client CLI to manage n8n from the terminal (#26943) 2026-03-20 14:11:35 +00:00
skills/n8n-cli feat: Add @n8n/cli: a client CLI to manage n8n from the terminal (#26943) 2026-03-20 14:11:35 +00:00
src chore: Vite 8 upgrade (#27680) 2026-04-02 09:27:10 +03:00
eslint.config.mjs feat: Add @n8n/cli: a client CLI to manage n8n from the terminal (#26943) 2026-03-20 14:11:35 +00:00
LICENSE.md feat: Add @n8n/cli: a client CLI to manage n8n from the terminal (#26943) 2026-03-20 14:11:35 +00:00
package.json chore: Skip scaffolding templates in code-health and swap to catalog refs (no-changelog) (#30297) 2026-05-12 10:58:00 +00:00
README.md docs: Add README for @n8n/cli package (#27510) 2026-03-24 15:05:15 +00:00
tsconfig.build.json feat: Add @n8n/cli: a client CLI to manage n8n from the terminal (#26943) 2026-03-20 14:11:35 +00:00
tsconfig.json chore: Prepare tsconfigs for tsgo (#29230) 2026-04-27 12:30:22 +00:00
vitest.config.ts ci: Improve coverage reports (#27756) 2026-03-31 05:42:44 +00:00

@n8n/cli

Beta — 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.

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

  1. Command-line flags (--url, --api-key)
  2. Environment variables (N8N_URL, N8N_API_KEY)
  3. 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
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.