@atom8n/node-cli 0.17.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 +289 -0
- package/bin/n8n-node.mjs +5 -0
- package/dist/build.tsbuildinfo +1 -0
- package/dist/commands/build.d.ts +8 -0
- package/dist/commands/build.js +61 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/cloud-support.d.ts +14 -0
- package/dist/commands/cloud-support.js +136 -0
- package/dist/commands/cloud-support.js.map +1 -0
- package/dist/commands/dev/index.d.ts +10 -0
- package/dist/commands/dev/index.js +103 -0
- package/dist/commands/dev/index.js.map +1 -0
- package/dist/commands/dev/utils.d.ts +27 -0
- package/dist/commands/dev/utils.js +462 -0
- package/dist/commands/dev/utils.js.map +1 -0
- package/dist/commands/lint.d.ts +13 -0
- package/dist/commands/lint.js +124 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/new/index.d.ts +14 -0
- package/dist/commands/new/index.js +141 -0
- package/dist/commands/new/index.js.map +1 -0
- package/dist/commands/new/prompts.d.ts +3 -0
- package/dist/commands/new/prompts.js +42 -0
- package/dist/commands/new/prompts.js.map +1 -0
- package/dist/commands/new/utils.d.ts +1 -0
- package/dist/commands/new/utils.js +13 -0
- package/dist/commands/new/utils.js.map +1 -0
- package/dist/commands/prerelease.d.ts +8 -0
- package/dist/commands/prerelease.js +20 -0
- package/dist/commands/prerelease.js.map +1 -0
- package/dist/commands/release.d.ts +7 -0
- package/dist/commands/release.js +52 -0
- package/dist/commands/release.js.map +1 -0
- package/dist/configs/eslint.d.ts +3 -0
- package/dist/configs/eslint.js +65 -0
- package/dist/configs/eslint.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/template/core.d.ts +29 -0
- package/dist/template/core.js +55 -0
- package/dist/template/core.js.map +1 -0
- package/dist/template/templates/declarative/custom/ast.d.ts +17 -0
- package/dist/template/templates/declarative/custom/ast.js +110 -0
- package/dist/template/templates/declarative/custom/ast.js.map +1 -0
- package/dist/template/templates/declarative/custom/ast.ts +161 -0
- package/dist/template/templates/declarative/custom/prompts.d.ts +3 -0
- package/dist/template/templates/declarative/custom/prompts.js +80 -0
- package/dist/template/templates/declarative/custom/prompts.js.map +1 -0
- package/dist/template/templates/declarative/custom/prompts.ts +87 -0
- package/dist/template/templates/declarative/custom/template/README.md +46 -0
- package/dist/template/templates/declarative/custom/template/nodes/Example/Example.node.json +18 -0
- package/dist/template/templates/declarative/custom/template/nodes/Example/Example.node.ts +50 -0
- package/dist/template/templates/declarative/custom/template/nodes/Example/example.dark.svg +13 -0
- package/dist/template/templates/declarative/custom/template/nodes/Example/example.svg +13 -0
- package/dist/template/templates/declarative/custom/template/nodes/Example/resources/company/getAll.ts +61 -0
- package/dist/template/templates/declarative/custom/template/nodes/Example/resources/company/index.ts +34 -0
- package/dist/template/templates/declarative/custom/template/nodes/Example/resources/user/create.ts +26 -0
- package/dist/template/templates/declarative/custom/template/nodes/Example/resources/user/get.ts +17 -0
- package/dist/template/templates/declarative/custom/template/nodes/Example/resources/user/index.ts +60 -0
- package/dist/template/templates/declarative/custom/template/package.json +48 -0
- package/dist/template/templates/declarative/custom/template/tsconfig.json +25 -0
- package/dist/template/templates/declarative/custom/template.d.ts +2 -0
- package/dist/template/templates/declarative/custom/template.js +83 -0
- package/dist/template/templates/declarative/custom/template.js.map +1 -0
- package/dist/template/templates/declarative/custom/template.ts +121 -0
- package/dist/template/templates/declarative/custom/types.d.ts +9 -0
- package/dist/template/templates/declarative/custom/types.js +3 -0
- package/dist/template/templates/declarative/custom/types.js.map +1 -0
- package/dist/template/templates/declarative/custom/types.ts +8 -0
- package/dist/template/templates/declarative/github-issues/template/README.md +73 -0
- package/dist/template/templates/declarative/github-issues/template/credentials/GithubIssuesApi.credentials.ts +45 -0
- package/dist/template/templates/declarative/github-issues/template/credentials/GithubIssuesOAuth2Api.credentials.ts +54 -0
- package/dist/template/templates/declarative/github-issues/template/icons/github.dark.svg +3 -0
- package/dist/template/templates/declarative/github-issues/template/icons/github.svg +3 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/GithubIssues.node.json +18 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/GithubIssues.node.ts +96 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/listSearch/getIssues.ts +49 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/listSearch/getRepositories.ts +50 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/listSearch/getUsers.ts +49 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/resources/issue/create.ts +74 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/resources/issue/get.ts +14 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/resources/issue/getAll.ts +124 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/resources/issue/index.ts +75 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/resources/issueComment/getAll.ts +65 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/resources/issueComment/index.ts +47 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/shared/descriptions.ts +151 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/shared/transport.ts +32 -0
- package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/shared/utils.ts +14 -0
- package/dist/template/templates/declarative/github-issues/template/package.json +51 -0
- package/dist/template/templates/declarative/github-issues/template/tsconfig.json +25 -0
- package/dist/template/templates/declarative/github-issues/template.d.ts +1 -0
- package/dist/template/templates/declarative/github-issues/template.js +14 -0
- package/dist/template/templates/declarative/github-issues/template.js.map +1 -0
- package/dist/template/templates/declarative/github-issues/template.ts +9 -0
- package/dist/template/templates/index.d.ts +15 -0
- package/dist/template/templates/index.js +28 -0
- package/dist/template/templates/index.js.map +1 -0
- package/dist/template/templates/index.ts +35 -0
- package/dist/template/templates/programmatic/example/template/README.md +46 -0
- package/dist/template/templates/programmatic/example/template/nodes/Example/Example.node.json +18 -0
- package/dist/template/templates/programmatic/example/template/nodes/Example/Example.node.ts +78 -0
- package/dist/template/templates/programmatic/example/template/nodes/Example/example.dark.svg +13 -0
- package/dist/template/templates/programmatic/example/template/nodes/Example/example.svg +13 -0
- package/dist/template/templates/programmatic/example/template/package.json +48 -0
- package/dist/template/templates/programmatic/example/template/tsconfig.json +25 -0
- package/dist/template/templates/programmatic/example/template.d.ts +1 -0
- package/dist/template/templates/programmatic/example/template.js +14 -0
- package/dist/template/templates/programmatic/example/template.js.map +1 -0
- package/dist/template/templates/programmatic/example/template.ts +9 -0
- package/dist/template/templates/shared/credentials/apiKey.credentials.ts +42 -0
- package/dist/template/templates/shared/credentials/basicAuth.credentials.ts +50 -0
- package/dist/template/templates/shared/credentials/bearer.credentials.ts +42 -0
- package/dist/template/templates/shared/credentials/custom.credentials.ts +48 -0
- package/dist/template/templates/shared/credentials/oauth2AuthorizationCode.credentials.ts +51 -0
- package/dist/template/templates/shared/credentials/oauth2ClientCredentials.credentials.ts +45 -0
- package/dist/template/templates/shared/default/.github/workflows/ci.yml +28 -0
- package/dist/template/templates/shared/default/.prettierrc.js +51 -0
- package/dist/template/templates/shared/default/.vscode/launch.json +12 -0
- package/dist/template/templates/shared/default/CHANGELOG.md +0 -0
- package/dist/template/templates/shared/default/eslint.config.mjs +3 -0
- package/dist/utils/ast.d.ts +11 -0
- package/dist/utils/ast.js +32 -0
- package/dist/utils/ast.js.map +1 -0
- package/dist/utils/child-process.d.ts +17 -0
- package/dist/utils/child-process.js +65 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/command-suggestions.d.ts +6 -0
- package/dist/utils/command-suggestions.js +30 -0
- package/dist/utils/command-suggestions.js.map +1 -0
- package/dist/utils/filesystem.d.ts +12 -0
- package/dist/utils/filesystem.js +105 -0
- package/dist/utils/filesystem.js.map +1 -0
- package/dist/utils/git.d.ts +7 -0
- package/dist/utils/git.js +36 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/json.d.ts +1 -0
- package/dist/utils/json.js +12 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/package-manager.d.ts +4 -0
- package/dist/utils/package-manager.js +48 -0
- package/dist/utils/package-manager.js.map +1 -0
- package/dist/utils/package.d.ts +15 -0
- package/dist/utils/package.js +53 -0
- package/dist/utils/package.js.map +1 -0
- package/dist/utils/prompts.d.ts +5 -0
- package/dist/utils/prompts.js +65 -0
- package/dist/utils/prompts.js.map +1 -0
- package/dist/utils/validation.d.ts +3 -0
- package/dist/utils/validation.js +23 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +77 -0
package/README.md
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
# @n8n/node-cli
|
|
2
|
+
|
|
3
|
+
Official CLI for developing community nodes for n8n.
|
|
4
|
+
|
|
5
|
+
## 🚀 Getting Started
|
|
6
|
+
|
|
7
|
+
**To create a new node**, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm create @n8n/node@latest # or pnpm/yarn/...
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This will generate a project with `npm` scripts that use this CLI under the hood.
|
|
14
|
+
|
|
15
|
+
## 📦 Generated Project Commands
|
|
16
|
+
|
|
17
|
+
After creating your node with `npm create @n8n/node`, you'll use these commands in your project:
|
|
18
|
+
|
|
19
|
+
### Development
|
|
20
|
+
```bash
|
|
21
|
+
npm run dev
|
|
22
|
+
# Runs: n8n-node dev
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Building
|
|
26
|
+
```bash
|
|
27
|
+
npm run build
|
|
28
|
+
# Runs: n8n-node build
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Linting
|
|
32
|
+
```bash
|
|
33
|
+
npm run lint
|
|
34
|
+
# Runs: n8n-node lint
|
|
35
|
+
|
|
36
|
+
npm run lint:fix
|
|
37
|
+
# Runs: n8n-node lint --fix
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Publishing
|
|
41
|
+
```bash
|
|
42
|
+
npm run release
|
|
43
|
+
# Runs: n8n-node release
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 🛠️ CLI Reference
|
|
47
|
+
|
|
48
|
+
> **Note:** These commands are typically wrapped by `npm` scripts in generated projects.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
n8n-node [COMMAND] [OPTIONS]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Commands
|
|
55
|
+
|
|
56
|
+
#### `n8n-node new`
|
|
57
|
+
|
|
58
|
+
Create a new node project.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
n8n-node new [NAME] [OPTIONS]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Flags:**
|
|
65
|
+
| Flag | Description |
|
|
66
|
+
|------|-------------|
|
|
67
|
+
| `-f, --force` | Overwrite destination folder if it already exists |
|
|
68
|
+
| `--skip-install` | Skip installing dependencies |
|
|
69
|
+
| `--template <template>` | Choose template: `declarative/custom`, `declarative/github-issues`, `programmatic/example` |
|
|
70
|
+
|
|
71
|
+
**Examples:**
|
|
72
|
+
```bash
|
|
73
|
+
n8n-node new
|
|
74
|
+
n8n-node new n8n-nodes-my-app --skip-install
|
|
75
|
+
n8n-node new n8n-nodes-my-app --force
|
|
76
|
+
n8n-node new n8n-nodes-my-app --template declarative/custom
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
> **Note:** This command is used internally by `npm create @n8n/node` to provide the interactive scaffolding experience.
|
|
80
|
+
|
|
81
|
+
#### `n8n-node dev`
|
|
82
|
+
|
|
83
|
+
Run n8n with your node in development mode with hot reload.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
n8n-node dev [--external-n8n] [--custom-user-folder <value>]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Flags:**
|
|
90
|
+
| Flag | Description |
|
|
91
|
+
|------|-------------|
|
|
92
|
+
| `--external-n8n` | Run n8n externally instead of in a subprocess |
|
|
93
|
+
| `--custom-user-folder <path>` | Folder to use to store user-specific n8n data (default: `~/.n8n-node-cli`) |
|
|
94
|
+
|
|
95
|
+
This command:
|
|
96
|
+
- Starts n8n on `http://localhost:5678` (unless using `--external-n8n`)
|
|
97
|
+
- Links your node to n8n's custom nodes directory (`~/.n8n-node-cli/.n8n/custom`)
|
|
98
|
+
- Rebuilds on file changes for live preview
|
|
99
|
+
- Watches for changes in your `src/` directory
|
|
100
|
+
|
|
101
|
+
**Examples:**
|
|
102
|
+
```bash
|
|
103
|
+
# Standard development with built-in n8n
|
|
104
|
+
n8n-node dev
|
|
105
|
+
|
|
106
|
+
# Use external n8n instance
|
|
107
|
+
n8n-node dev --external-n8n
|
|
108
|
+
|
|
109
|
+
# Custom n8n extensions directory
|
|
110
|
+
n8n-node dev --custom-user-folder /home/user
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### `n8n-node build`
|
|
114
|
+
|
|
115
|
+
Compile your node and prepare it for distribution.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
n8n-node build
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Flags:** None
|
|
122
|
+
|
|
123
|
+
Generates:
|
|
124
|
+
- Compiled TypeScript code
|
|
125
|
+
- Bundled node package
|
|
126
|
+
- Optimized assets and icons
|
|
127
|
+
- Ready-to-publish package in `dist/`
|
|
128
|
+
|
|
129
|
+
#### `n8n-node lint`
|
|
130
|
+
|
|
131
|
+
Lint the node in the current directory.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
n8n-node lint [--fix]
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Flags:**
|
|
138
|
+
| Flag | Description |
|
|
139
|
+
|------|-------------|
|
|
140
|
+
| `--fix` | Automatically fix problems |
|
|
141
|
+
|
|
142
|
+
**Examples:**
|
|
143
|
+
```bash
|
|
144
|
+
# Check for linting issues
|
|
145
|
+
n8n-node lint
|
|
146
|
+
|
|
147
|
+
# Automatically fix fixable issues
|
|
148
|
+
n8n-node lint --fix
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### `n8n-node cloud-support`
|
|
152
|
+
|
|
153
|
+
Manage n8n Cloud eligibility.
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
n8n-node cloud-support [enable|disable]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Arguments:**
|
|
160
|
+
| Argument | Description |
|
|
161
|
+
|----------|-------------|
|
|
162
|
+
| _(none)_ | Show current cloud support status |
|
|
163
|
+
| `enable` | Enable strict mode + default ESLint config |
|
|
164
|
+
| `disable` | Allow custom ESLint config (disables cloud eligibility) |
|
|
165
|
+
|
|
166
|
+
Strict mode enforces the default ESLint configuration and community node rules required for n8n Cloud verification. When disabled, you can customize your ESLint config but your node won't be eligible for n8n Cloud verification.
|
|
167
|
+
|
|
168
|
+
#### `n8n-node release`
|
|
169
|
+
|
|
170
|
+
Publish your community node package to npm.
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
n8n-node release
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Flags:** None
|
|
177
|
+
|
|
178
|
+
This command handles the complete release process using [release-it](https://github.com/release-it/release-it):
|
|
179
|
+
- Builds the node
|
|
180
|
+
- Runs linting checks
|
|
181
|
+
- Updates changelog
|
|
182
|
+
- Creates git tags
|
|
183
|
+
- Creates GitHub releases
|
|
184
|
+
- Publishes to npm
|
|
185
|
+
|
|
186
|
+
## 🔄 Development Workflow
|
|
187
|
+
|
|
188
|
+
The recommended workflow using the scaffolding tool:
|
|
189
|
+
|
|
190
|
+
1. **Create your node**:
|
|
191
|
+
```bash
|
|
192
|
+
npm create @n8n/node my-awesome-node
|
|
193
|
+
cd my-awesome-node
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
2. **Start development**:
|
|
197
|
+
```bash
|
|
198
|
+
npm run dev
|
|
199
|
+
```
|
|
200
|
+
- Starts n8n on `http://localhost:5678`
|
|
201
|
+
- Links your node automatically
|
|
202
|
+
- Rebuilds on file changes
|
|
203
|
+
|
|
204
|
+
3. **Test your node** at `http://localhost:5678`
|
|
205
|
+
|
|
206
|
+
4. **Lint your code**:
|
|
207
|
+
```bash
|
|
208
|
+
npm run lint
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
5. **Build for production**:
|
|
212
|
+
```bash
|
|
213
|
+
npm run build
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
6. **Publish**:
|
|
217
|
+
```bash
|
|
218
|
+
npm run release
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## 📁 Project Structure
|
|
222
|
+
|
|
223
|
+
The CLI expects your project to follow this structure:
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
my-node/
|
|
227
|
+
├── src/
|
|
228
|
+
│ ├── nodes/
|
|
229
|
+
│ │ └── MyNode/
|
|
230
|
+
│ │ ├── MyNode.node.ts
|
|
231
|
+
│ │ └── MyNode.node.json
|
|
232
|
+
│ └── credentials/
|
|
233
|
+
├── package.json
|
|
234
|
+
└── tsconfig.json
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## ⚙️ Configuration
|
|
238
|
+
|
|
239
|
+
The CLI reads configuration from your `package.json`:
|
|
240
|
+
|
|
241
|
+
```json
|
|
242
|
+
{
|
|
243
|
+
"name": "n8n-nodes-my-awesome-node",
|
|
244
|
+
"n8n": {
|
|
245
|
+
"n8nNodesApiVersion": 1,
|
|
246
|
+
"nodes": [
|
|
247
|
+
"dist/nodes/MyNode/MyNode.node.js"
|
|
248
|
+
],
|
|
249
|
+
"credentials": [
|
|
250
|
+
"dist/credentials/MyNodeAuth.credentials.js"
|
|
251
|
+
]
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## 🐛 Troubleshooting
|
|
257
|
+
|
|
258
|
+
### Development server issues
|
|
259
|
+
```bash
|
|
260
|
+
# Clear n8n custom nodes cache
|
|
261
|
+
rm -rf ~/.n8n-node-cli/.n8n/custom
|
|
262
|
+
|
|
263
|
+
# Restart development server
|
|
264
|
+
npm run dev
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Build failures
|
|
268
|
+
```bash
|
|
269
|
+
# Run linting first
|
|
270
|
+
npm run lint
|
|
271
|
+
|
|
272
|
+
# Clean build
|
|
273
|
+
npm run build
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## 📚 Resources
|
|
277
|
+
|
|
278
|
+
- **[Creating Nodes Guide](https://docs.n8n.io/integrations/creating-nodes/)** - Complete documentation
|
|
279
|
+
- **[Node Development Reference](https://docs.n8n.io/integrations/creating-nodes/build/reference/)** - API specifications
|
|
280
|
+
- **[Community Forum](https://community.n8n.io)** - Get help and showcase your nodes
|
|
281
|
+
- **[@n8n/create-node](https://www.npmjs.com/package/@n8n/create-node)** - Recommended scaffolding tool
|
|
282
|
+
|
|
283
|
+
## 🤝 Contributing
|
|
284
|
+
|
|
285
|
+
Found an issue? Contribute to the [n8n repository](https://github.com/n8n-io/n8n) on GitHub.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
**Happy node development! 🎉**
|