Skip to main content

CLI for managing n8n Cloud workflows

Project description

n8n CLI

A command-line tool for managing n8n Cloud workflows.

Installation

Global Installation (Recommended)

uv tool install .

Configuration

Create a credentials file with your n8n API credentials. The file can be placed in:

  • Your current working directory as .env (project-specific)
  • ~/.config/n8n-cli/config (global configuration)

Project-specific (.env in current directory):

N8N_API_KEY=your-api-key
N8N_INSTANCE_URL=https://your-instance.app.n8n.cloud/api/v1

Global (~/.config/n8n-cli/config):

N8N_API_KEY=your-api-key
N8N_INSTANCE_URL=https://your-instance.app.n8n.cloud/api/v1

Alternatively, set environment variables:

export N8N_API_KEY="your-api-key"
export N8N_BASE_URL="https://your-instance.app.n8n.cloud/api/v1"

Development Installation

For local development:

uv sync

Development

# Install with dev dependencies
uv sync

# Install pre-commit hooks
uv run pre-commit install

# Clean install tool globally (clears cache for fresh build)
uv run poe install

# Quick reinstall without cache clean (faster)
uv run poe reinstall

# Run tests
uv run poe test

# Run code quality checks
uv run poe check        # lint + typecheck + test
uv run poe lint         # just linting
uv run poe typecheck    # just type checking
uv run poe format       # format code

# Run pre-commit hooks manually
uv run pre-commit run --all-files

Usage

n8n --help

Examples

Workflow Management

List all workflows:

n8n workflow list
n8n workflow list -v  # verbose output with more details

View workflow details:

n8n workflow view "My Workflow"

Activate/deactivate workflows:

n8n workflow activate "My Workflow"
n8n workflow deactivate "My Workflow"

Pull workflows to local files:

n8n workflow pull                    # Pull all workflows
n8n workflow pull "My Workflow"      # Pull specific workflow
n8n workflow pull --project "Sales"  # Pull all workflows from a project

Push local workflow to cloud:

n8n workflow push workflow.json
n8n workflow push workflow.json --update  # Update existing workflow

Create new workflow:

n8n workflow create new_workflow.json

Compare local and cloud versions:

n8n workflow diff workflow.json

Move workflow to different project:

n8n workflow move "My Workflow" --project "Marketing"

Open workflow in browser:

n8n workflow open "My Workflow"

Delete workflow:

n8n workflow delete "My Workflow"

Execution Management

List recent executions:

n8n execution list
n8n execution list --workflow "My Workflow"  # Filter by workflow
n8n execution list --limit 50                # Show more results

View execution details:

n8n execution view <execution-id>

Download execution data:

n8n execution download <execution-id>
n8n execution download <execution-id> -o execution.json

Retry failed execution:

n8n execution retry <execution-id>

Project Management

List all projects:

n8n project list

View project details:

n8n project view "Sales"

User & Member Management

List users:

n8n user list

Invite user:

n8n user invite user@example.com --role member
n8n user invite admin@example.com --role admin

Remove user:

n8n user remove user@example.com

List project members:

n8n member list --project "Sales"

Add member to project:

n8n member add user@example.com --project "Sales" --role editor

Remove member from project:

n8n member remove user@example.com --project "Sales"

Shell Completion

Enable tab completion for workflows, projects, and file paths:

Installation

Automatic (recommended):

n8n --install-completion

Follow the shell-specific instructions. You may need to restart your shell.

Manual setup:

Bash:

eval "$(n8n --show-completion bash)"
# Add to ~/.bashrc for persistence

Zsh:

eval "$(n8n --show-completion zsh)"
# Add to ~/.zshrc for persistence

Fish:

n8n --show-completion fish > ~/.config/fish/completions/n8n.fish

What Gets Completed

  • Workflow names: n8n workflow view <TAB> shows your workflows
  • Project names: n8n project view <TAB> shows your projects
  • File paths: n8n workflow diff <TAB> shows .json files

Note: The n8n command must be available in your PATH for completion to work. Either activate the virtual environment (source .venv/bin/activate) or install globally.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

n8nctl-0.1.1.tar.gz (151.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

n8nctl-0.1.1-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

Details for the file n8nctl-0.1.1.tar.gz.

File metadata

  • Download URL: n8nctl-0.1.1.tar.gz
  • Upload date:
  • Size: 151.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for n8nctl-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c28e7e22ca0c02c1ef652e90bde482f49ec51f831fc151dc35b4b099b3f29436
MD5 d74c9aee45651abb6dbd033f01feec90
BLAKE2b-256 74369b5b81804eb1693a0fd9711fc4e30813447537c654ad6ad5b397fd24456d

See more details on using hashes here.

File details

Details for the file n8nctl-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: n8nctl-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 34.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for n8nctl-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 17ad21d17ca85de3f4ae89d74ee98b9c8f66ffe2d5f9134d82777d2b43b23dc0
MD5 9838d65a60e343d88722fea9670c2a2a
BLAKE2b-256 be461952e7ded51712cca1e2a6c194f3740a0d081c096c5d3d93f8268e87f849

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page