@n8n/cli 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# @n8n/cli
|
|
2
|
+
|
|
3
|
+
> **Beta** — Client CLI for n8n. Manage workflows, executions, credentials, and more from the terminal.
|
|
4
|
+
|
|
5
|
+
A lightweight, zero-dependency CLI that talks to any n8n instance via its public API. Designed for humans, scripts, and AI coding agents alike.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Use directly with npx (zero install)
|
|
11
|
+
npx @n8n/cli workflow list
|
|
12
|
+
|
|
13
|
+
# Or install globally
|
|
14
|
+
npm install -g @n8n/cli
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
The CLI needs your n8n instance URL and an API key.
|
|
20
|
+
|
|
21
|
+
### Config file (recommended)
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
n8n-cli config set-url https://my-n8n.app.n8n.cloud
|
|
25
|
+
n8n-cli config set-api-key n8n_api_xxxxx
|
|
26
|
+
n8n-cli config show
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Configuration is saved to `~/.n8n-cli/config.json` with restricted file permissions (`0600`).
|
|
30
|
+
|
|
31
|
+
### Environment variables
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
export N8N_URL=https://my-n8n.app.n8n.cloud
|
|
35
|
+
export N8N_API_KEY=n8n_api_xxxxx
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Inline flags
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
n8n-cli --url=https://my-n8n.app.n8n.cloud --api-key=n8n_api_xxxxx workflow list
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Resolution order
|
|
45
|
+
|
|
46
|
+
1. Command-line flags (`--url`, `--api-key`)
|
|
47
|
+
2. Environment variables (`N8N_URL`, `N8N_API_KEY`)
|
|
48
|
+
3. Config file (`~/.n8n-cli/config.json`)
|
|
49
|
+
|
|
50
|
+
## Commands
|
|
51
|
+
|
|
52
|
+
| Topic | Commands |
|
|
53
|
+
|-------|----------|
|
|
54
|
+
| `workflow` | `list`, `get`, `create`, `update`, `delete`, `activate`, `deactivate`, `tags`, `transfer` |
|
|
55
|
+
| `execution` | `list`, `get`, `retry`, `stop`, `delete` |
|
|
56
|
+
| `credential` | `list`, `get`, `schema`, `create`, `delete`, `transfer` |
|
|
57
|
+
| `project` | `list`, `get`, `create`, `update`, `delete`, `members`, `add-member`, `remove-member` |
|
|
58
|
+
| `tag` | `list`, `create`, `update`, `delete` |
|
|
59
|
+
| `variable` | `list`, `create`, `update`, `delete` |
|
|
60
|
+
| `data-table` | `list`, `get`, `create`, `delete`, `rows`, `add-rows`, `update-rows`, `upsert-rows`, `delete-rows` |
|
|
61
|
+
| `user` | `list`, `get` |
|
|
62
|
+
| `config` | `set-url`, `set-api-key`, `show` |
|
|
63
|
+
| `source-control` | `pull` |
|
|
64
|
+
| `skill` | `install` |
|
|
65
|
+
| `audit` | _(top-level)_ |
|
|
66
|
+
| `login` / `logout` | _(top-level)_ |
|
|
67
|
+
|
|
68
|
+
Every command supports `--help` for detailed usage.
|
|
69
|
+
|
|
70
|
+
## Output formats
|
|
71
|
+
|
|
72
|
+
All commands support three output formats via `--format`:
|
|
73
|
+
|
|
74
|
+
| Format | Flag | Use case |
|
|
75
|
+
|--------|------|----------|
|
|
76
|
+
| Table | `--format=table` (default) | Human-readable terminal output |
|
|
77
|
+
| JSON | `--format=json` | Piping to `jq`, programmatic use |
|
|
78
|
+
| ID-only | `--format=id-only` | Piping to `xargs`, scripting |
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Human-readable table
|
|
82
|
+
n8n-cli workflow list
|
|
83
|
+
|
|
84
|
+
# JSON for scripts
|
|
85
|
+
n8n-cli workflow list --format=json | jq '.[] | select(.active) | .id'
|
|
86
|
+
|
|
87
|
+
# Pipe IDs into another command
|
|
88
|
+
n8n-cli workflow list --format=id-only | xargs -I{} n8n-cli workflow deactivate {}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## AI agent integration
|
|
92
|
+
|
|
93
|
+
The CLI ships with a skill file that teaches AI coding agents how to use it.
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Claude Code (project-level)
|
|
97
|
+
n8n-cli skill install
|
|
98
|
+
|
|
99
|
+
# Claude Code (global)
|
|
100
|
+
n8n-cli skill install --global
|
|
101
|
+
|
|
102
|
+
# Cursor
|
|
103
|
+
n8n-cli skill install --target=cursor
|
|
104
|
+
|
|
105
|
+
# Windsurf
|
|
106
|
+
n8n-cli skill install --target=windsurf
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Development
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Build
|
|
113
|
+
pnpm build
|
|
114
|
+
|
|
115
|
+
# Watch mode
|
|
116
|
+
pnpm dev
|
|
117
|
+
|
|
118
|
+
# Run tests
|
|
119
|
+
pnpm test
|
|
120
|
+
|
|
121
|
+
# Lint & typecheck
|
|
122
|
+
pnpm lint
|
|
123
|
+
pnpm typecheck
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
See [LICENSE.md](LICENSE.md) for details.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Client CLI for n8n — manage workflows, executions, and credentials from the terminal",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "[beta] Client CLI for n8n — manage workflows, executions, and credentials from the terminal",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"bin": {
|
|
7
7
|
"n8n-cli": "bin/n8n-cli.mjs"
|