npx skills add ...
npx skills add n8n-io/n8n --skill n8n-cli
Use the n8n CLI to manage workflows, credentials, executions, and more on an n8n instance. Use when the user asks to interact with n8n, automate workflows, manage credentials, or operate their instance from the command line.
npx skills add n8n-io/n8n --skill n8n-cli
The n8n-cli command-line tool manages an n8n instance via its REST API.
It auto-detects piped output and switches to JSON, making it composable for scripts and LLM tool use.
Every command supports these flags:
| Flag | Short | Description |
|---|---|---|
--url | -u | Instance URL (overrides config/env) |
--apiKey | -k | API key (overrides config/env) |
--format | -f | Output format: table, json, id-only |
--json | Shorthand for --format=json | |
--jq | jq-style filter (implies --json), e.g. '.[0].id', '.[].name' | |
--quiet | -q | Suppress output |
--no-header | Hide table headers (for awk/cut parsing) | |
--debug | Print HTTP details to stderr |
Auto-JSON: When stdout is piped (not a TTY), output defaults to JSON automatically.
Tip: Use credential schema <type> to discover required fields before creating.
Move projects between instances through a Git repository. A provider holds
the credentials, a connection names the repository, and a configuration
sets up one direction on it: promote pushes to Git, apply imports from Git.
Connection JSON for step 2:
Key points:
--stdin or --file, never through a flag. This
keeps credentials off the command line.authType is ssh-key or token. token means an HTTP(S) username and
password, not a Git host API token. publicKey is null for a token provider.createBranchOnPromotion is always required in a promote configuration.promote and apply work on the instance connection only, and need their
direction cloned first. Cloning one direction does not make the other ready.gitConnection:*. promote also needs
variable:list when the workflows reference variables.The CLI is designed to be piped and composed:
When creating or updating workflows, the JSON follows this structure:
Key points:
nodes[].type follows the pattern n8n-nodes-base.<nodeName> for built-in nodesconnections is keyed by source node name, with main output arraysnode, type (usually main), and output indexworkflow get <id> --json to see real examples from the instance