Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/n8n_community-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ n8n community-package [flags]
```
n8n community-package list
n8n community-package install n8n-nodes-example
n8n community-package install '@scope/n8n-nodes-example' --yes
n8n community-package update n8n-nodes-example --yes
n8n community-package uninstall n8n-nodes-example --yes
```
Expand Down
14 changes: 7 additions & 7 deletions docs/n8n_community-package_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ Install a community package

Install an npm community node package on the selected n8n instance.

The package name must start with n8n-nodes-. Omit --version to let npm select
the version. Verification against n8n's vetted package list is enabled by
default; --verify=false explicitly permits unverified code when the instance
allows it. Installed package code runs inside n8n.
The package name must have the form n8n-nodes-<name> or the scoped form
@<scope>/n8n-nodes-<name>. --version takes a semver version or an npm dist-tag
such as latest or beta; omit it to let npm select the version. Whether
unverified packages may be installed is an instance setting: when it is off,
only versions verified by n8n install. Installed package code runs inside n8n.

Interactive runs ask before installing. Non-interactive runs fail unless --yes
is passed. Requires API-key authentication and communityPackage:install.
Expand All @@ -24,7 +25,7 @@ n8n community-package install <name> [flags]
```
n8n community-package install n8n-nodes-example
n8n community-package install n8n-nodes-example --version 1.2.3 --yes
n8n community-package install n8n-nodes-example --verify=false --yes --output json
n8n community-package install '@scope/n8n-nodes-example' --version beta --yes --output json
```

### Options
Expand All @@ -34,8 +35,7 @@ n8n community-package install <name> [flags]
-h, --help help for install
--output string output format: text or json (default text; json is stable for scripting) (default "text")
--url string instance URL override, e.g. https://n8n.example.com (falls back to N8N_URL, then the selected context URL)
--verify verify against n8n's vetted package list (default true; --verify=false permits unverified code when allowed) (default true)
--version string npm package version, e.g. 1.2.3 (default: let n8n select the version)
--version string npm semver version or dist-tag, e.g. 1.2.3 or beta (default: let n8n select the version)
--yes confirm the instance-changing action without prompting (required when stdin is not interactive)
```

Expand Down
12 changes: 6 additions & 6 deletions docs/n8n_community-package_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ Update an installed community package

Update one installed community node package on the selected n8n instance.

Omit --version to update to the version selected by n8n. Verification against
n8n's vetted package list is enabled by default; --verify=false explicitly
permits unverified code when the instance allows it. Updating code can change
node behavior in existing workflows, though it does not delete those workflows.
--version takes a semver version or an npm dist-tag such as latest or beta.
Omit it to send no body and update to the latest version n8n allows. Whether
unverified versions may be installed is an instance setting: when it is off,
only versions verified by n8n install. Updating code can change node behavior
in existing workflows, though it does not delete those workflows.

Interactive runs ask before updating. Non-interactive runs fail unless --yes is
passed. Requires API-key authentication and communityPackage:update.
Expand All @@ -34,8 +35,7 @@ n8n community-package update <name> [flags]
-h, --help help for update
--output string output format: text or json (default text; json is stable for scripting) (default "text")
--url string instance URL override, e.g. https://n8n.example.com (falls back to N8N_URL, then the selected context URL)
--verify verify against n8n's vetted package list (default true; --verify=false permits unverified code when allowed) (default true)
--version string npm package version, e.g. 1.2.3 (default: let n8n select the version)
--version string npm semver version or dist-tag, e.g. 1.2.3 or beta (default: let n8n select the version)
--yes confirm the instance-changing action without prompting (required when stdin is not interactive)
```

Expand Down
5 changes: 3 additions & 2 deletions docs/n8n_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ access.

Create accepts a strict JSON array and preserves every per-user success or
error. Role changes and deletion accept the exact user ID or email allowed by
the API. Deletion always requires confirmation.
the API. Deletion always requires confirmation and deletes the user's workflows
and credentials unless --transfer-to-project moves them to a project.

```
n8n user [flags]
Expand All @@ -24,7 +25,7 @@ n8n user [flags]
n8n user get person@example.com --include-role
n8n user create --input users.json
n8n user role set USER_ID global:member
n8n user delete USER_ID --yes
n8n user delete USER_ID --transfer-to-project PROJECT_ID --yes
```

### Options
Expand Down
3 changes: 2 additions & 1 deletion docs/n8n_user_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Invite one or more users
### Synopsis

Create or invite users from a strict JSON array supplied by --input. Each item
requires email and may set a global role slug. Unknown fields, an empty array,
requires email and may set role: global:admin, global:member (the default),
global:chatUser, or a custom global role slug. Unknown fields, an empty array,
invalid emails, and trailing JSON documents are refused before transport.

n8n returns one result per invitation. Output preserves successful users, invite
Expand Down
26 changes: 15 additions & 11 deletions docs/n8n_user_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ Permanently delete a user
### Synopsis

Permanently delete one user using the exact ID or email accepted by the API.
This removes the account and can delete resources owned by its personal project;
the documented endpoint provides no ownership-transfer option. It cannot be
undone and the instance owner cannot be deleted.

Interactive runs ask for confirmation. Non-interactive runs require --yes.
By default n8n also deletes the user's workflows and credentials. Pass
--transfer-to-project with a project ID (sent as the API's transferId) to move
those workflows and credentials to that project instead; find IDs with
'n8n project list'. Deletion cannot be undone and the instance owner cannot be
deleted.

Interactive runs ask for confirmation naming what happens to the user's
workflows and credentials. Non-interactive runs require --yes.
Requires user:delete.

```
Expand All @@ -19,18 +22,19 @@ n8n user delete <user-id-or-email> [flags]
### Examples

```
n8n user delete USER_ID
n8n user delete USER_ID --transfer-to-project PROJECT_ID
n8n user delete person@example.com --yes --output json
```

### Options

```
--context string saved context name to use (falls back to N8N_CONTEXT, then the saved current context; see 'n8n config context list')
-h, --help help for delete
--output string output format: text or json (acknowledgement contains only deleted user identifier) (default "text")
--url string instance URL override, e.g. https://n8n.example.com (falls back to N8N_URL, then the selected context URL)
--yes confirm permanent user and owned-resource deletion without prompting (required when stdin is not interactive)
--context string saved context name to use (falls back to N8N_CONTEXT, then the saved current context; see 'n8n config context list')
-h, --help help for delete
--output string output format: text or json (acknowledgement contains deleted user identifier and any transfer project ID) (default "text")
--transfer-to-project string project ID that receives the user's workflows and credentials (default: none, they are deleted with the user)
--url string instance URL override, e.g. https://n8n.example.com (falls back to N8N_URL, then the selected context URL)
--yes confirm permanent user deletion, and deletion of their workflows and credentials unless transferred, without prompting (required when stdin is not interactive)
```

### SEE ALSO
Expand Down
8 changes: 3 additions & 5 deletions docs/n8n_user_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ List instance or project users

List users visible to the selected credential. Use --project-id to filter to
one project's members and --include-role to request global roles. The API is
cursor-paginated; --offset selects a starting position, while --cursor resumes
a previous response. They cannot be combined.
cursor-paginated: --cursor resumes from the nextCursor of a previous response.

--all follows cursors and collects at most 10,000 users. Instance-wide listing
may require the instance owner. Requires user:list.
Expand All @@ -28,7 +27,7 @@ n8n user list [flags]
```
n8n user list --include-role
n8n user list --project-id PROJECT_ID --limit 50
n8n user list --offset 100 --output json
n8n user list --cursor NEXT_CURSOR --output json
n8n user list --all --include-role --output json
```

Expand All @@ -37,11 +36,10 @@ n8n user list [flags]
```
--all follow every page instead of one (maximum 10,000 users; hitting it warns and sets JSON collection.truncated)
--context string saved context name to use (falls back to N8N_CONTEXT, then the saved current context; see 'n8n config context list')
--cursor string pagination cursor returned by a previous list (default: first page; cannot combine with --offset)
--cursor string pagination cursor returned by a previous list (default: first page)
-h, --help help for list
--include-role include each user's global role (default: role is omitted by API)
--limit int users per API page, 1 to 250 (default: server default of 100)
--offset int users to skip before first page, zero or greater (default: 0; cannot combine with --cursor)
--output string output format: text or json (JSON is a paginated user object, plus collection with --all) (default "text")
--project-id string return members of this project ID (default: all visible instance users)
--url string instance URL override, e.g. https://n8n.example.com (falls back to N8N_URL, then the selected context URL)
Expand Down
7 changes: 4 additions & 3 deletions docs/n8n_user_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Manage users' global roles
### Synopsis

Manage global role assignments for instance users. Use 'set' with a user ID
or email and a role slug discovered through 'n8n role list'. Role changes can
alter instance-wide permissions and may require owner access or licensing.
or email and a role slug: global:admin, global:member, global:chatUser, or a
custom global role discovered through 'n8n role list'. Role changes can alter
instance-wide permissions and may require owner access or licensing.

```
n8n user role [flags]
Expand All @@ -16,7 +17,7 @@ n8n user role [flags]

```
n8n user role set USER_ID global:member
n8n user role set person@example.com global:admin --output json
n8n user role set person@example.com global:chatUser --output json
```

### Options
Expand Down
10 changes: 6 additions & 4 deletions docs/n8n_user_role_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ Set a user's global role
### Synopsis

Change one user's global role using the exact user ID or email accepted by the
API. The role slug must identify an assignable global role; run 'n8n role list'
to inspect licensing and available slugs. This can immediately change the user's
instance permissions. Requires user:changeRole.
API. The role slug must identify an assignable global role: global:admin,
global:member, global:chatUser, or a custom global role slug. Run 'n8n role
list' to inspect licensing and available slugs. This can immediately change the
user's instance permissions. Requires user:changeRole.

```
n8n user role set <user-id-or-email> <role-slug> [flags]
Expand All @@ -17,7 +18,8 @@ n8n user role set <user-id-or-email> <role-slug> [flags]

```
n8n user role set USER_ID global:member
n8n user role set person@example.com global:admin --output json
n8n user role set person@example.com global:chatUser
n8n user role set USER_ID CUSTOM_ROLE_SLUG --output json
```

### Options
Expand Down
45 changes: 27 additions & 18 deletions internal/cli/community_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func newCommunityPackageCommand(opts Options) *cobra.Command {
"installed packages, then install, update or uninstall one package.",
Example: " n8n community-package list\n" +
" n8n community-package install n8n-nodes-example\n" +
" n8n community-package install '@scope/n8n-nodes-example' --yes\n" +
" n8n community-package update n8n-nodes-example --yes\n" +
" n8n community-package uninstall n8n-nodes-example --yes",
Args: cobra.NoArgs,
Expand Down Expand Up @@ -133,30 +134,31 @@ func newCommunityPackageInstallCommand(opts Options) *cobra.Command {
Use: "install <name>",
Short: "Install a community package",
Long: "Install an npm community node package on the selected n8n instance.\n\n" +
"The package name must start with n8n-nodes-. Omit --version to let npm select\n" +
"the version. Verification against n8n's vetted package list is enabled by\n" +
"default; --verify=false explicitly permits unverified code when the instance\n" +
"allows it. Installed package code runs inside n8n.\n\n" +
"The package name must have the form n8n-nodes-<name> or the scoped form\n" +
"@<scope>/n8n-nodes-<name>. --version takes a semver version or an npm dist-tag\n" +
"such as latest or beta; omit it to let npm select the version. Whether\n" +
"unverified packages may be installed is an instance setting: when it is off,\n" +
"only versions verified by n8n install. Installed package code runs inside n8n.\n\n" +
"Interactive runs ask before installing. Non-interactive runs fail unless --yes\n" +
"is passed. Requires API-key authentication and communityPackage:install.\n" +
"Next step: 'n8n community-package list'.",
Example: " n8n community-package install n8n-nodes-example\n" +
" n8n community-package install n8n-nodes-example --version 1.2.3 --yes\n" +
" n8n community-package install n8n-nodes-example --verify=false --yes --output json",
" n8n community-package install '@scope/n8n-nodes-example' --version beta --yes --output json",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runCommunityPackageInstall(cmd.Context(), opts, args[0], f)
},
}
registerCommunityPackageMutationFlags(cmd, &f, true)
registerCommunityPackageMutationFlags(cmd, opts, &f, true)
return cmd
}

func runCommunityPackageInstall(ctx context.Context, opts Options, name string, f communityPackageMutationFlags) error {
if err := validateOutput(f.output); err != nil {
return err
}
request := n8n.InstallCommunityPackageRequest{Name: name, Version: f.version, Verify: n8n.Bool(f.verify)}
request := n8n.InstallCommunityPackageRequest{Name: name, Version: f.version}
if err := request.Validate(); err != nil {
return err
}
Expand Down Expand Up @@ -191,10 +193,11 @@ func newCommunityPackageUpdateCommand(opts Options) *cobra.Command {
Use: "update <name>",
Short: "Update an installed community package",
Long: "Update one installed community node package on the selected n8n instance.\n\n" +
"Omit --version to update to the version selected by n8n. Verification against\n" +
"n8n's vetted package list is enabled by default; --verify=false explicitly\n" +
"permits unverified code when the instance allows it. Updating code can change\n" +
"node behavior in existing workflows, though it does not delete those workflows.\n\n" +
"--version takes a semver version or an npm dist-tag such as latest or beta.\n" +
"Omit it to send no body and update to the latest version n8n allows. Whether\n" +
"unverified versions may be installed is an instance setting: when it is off,\n" +
"only versions verified by n8n install. Updating code can change node behavior\n" +
"in existing workflows, though it does not delete those workflows.\n\n" +
"Interactive runs ask before updating. Non-interactive runs fail unless --yes is\n" +
"passed. Requires API-key authentication and communityPackage:update.\n" +
"Next step: run 'n8n community-package list' and test affected workflows.",
Expand All @@ -206,15 +209,15 @@ func newCommunityPackageUpdateCommand(opts Options) *cobra.Command {
return runCommunityPackageUpdate(cmd.Context(), opts, args[0], f)
},
}
registerCommunityPackageMutationFlags(cmd, &f, true)
registerCommunityPackageMutationFlags(cmd, opts, &f, true)
return cmd
}

func runCommunityPackageUpdate(ctx context.Context, opts Options, name string, f communityPackageMutationFlags) error {
if err := validateOutput(f.output); err != nil {
return err
}
request := n8n.UpdateCommunityPackageRequest{Version: f.version, Verify: n8n.Bool(f.verify)}
request := n8n.UpdateCommunityPackageRequest{Version: f.version}
if err := validateCommunityPackageArgument(name); err != nil {
return err
}
Expand All @@ -228,7 +231,7 @@ func runCommunityPackageUpdate(ctx context.Context, opts Options, name string, f
if err := requireAPIKey(resolution, "community-package"); err != nil {
return err
}
target := "the version selected by n8n"
target := "the latest version n8n allows"
if f.version != "" {
target = "version " + f.version
}
Expand Down Expand Up @@ -266,7 +269,7 @@ func newCommunityPackageUninstallCommand(opts Options) *cobra.Command {
return runCommunityPackageUninstall(cmd.Context(), opts, args[0], f)
},
}
registerCommunityPackageMutationFlags(cmd, &f, false)
registerCommunityPackageMutationFlags(cmd, opts, &f, false)
return cmd
}

Expand Down Expand Up @@ -301,11 +304,17 @@ func runCommunityPackageUninstall(ctx context.Context, opts Options, name string
return nil
}

func registerCommunityPackageMutationFlags(cmd *cobra.Command, f *communityPackageMutationFlags, withPackageOptions bool) {
func registerCommunityPackageMutationFlags(cmd *cobra.Command, opts Options, f *communityPackageMutationFlags, withPackageOptions bool) {
f.instance.register(cmd)
if withPackageOptions {
cmd.Flags().StringVar(&f.version, "version", "", "npm package version, e.g. 1.2.3 (default: let n8n select the version)")
cmd.Flags().BoolVar(&f.verify, "verify", true, "verify against n8n's vetted package list (default true; --verify=false permits unverified code when allowed)")
// Deprecation notices go to the flag set output; cobra would otherwise
// print them on stdout, which carries the result or JSON document.
cmd.Flags().SetOutput(opts.Streams.Err)
cmd.Flags().StringVar(&f.version, "version", "", "npm semver version or dist-tag, e.g. 1.2.3 or beta (default: let n8n select the version)")
// The API dropped the verify field; the flag still parses so existing
// scripts keep working, but its value is never sent.
cmd.Flags().BoolVar(&f.verify, "verify", true, "ignored; the instance setting for unverified packages now controls verification (default true)")
_ = cmd.Flags().MarkDeprecated("verify", "it is ignored: the instance setting for unverified community packages now controls verification")
}
cmd.Flags().BoolVar(&f.yes, "yes", false, "confirm the instance-changing action without prompting (required when stdin is not interactive)")
cmd.Flags().StringVar(&f.output, "output", outputText, "output format: text or json (default text; json is stable for scripting)")
Expand Down
Loading
Loading