Skip to main content

CLI harness for n8n workflow automation — CLI-Anything pattern (n8n API v1.1.1)

Project description

cli-anything-n8n

PyPI Python 3.10+ License: MIT CLI-Anything n8n API v1.1.1

Leer en Español | Read in English


English

Control your n8n instance from the terminal. List workflows, check executions, manage tags — all without opening the browser.

Built with the CLI-Anything pattern, so AI agents can use it too.

Try it now (2 minutes)

# 1. Install
pip install cli-anything-n8n

# 2. Connect to your n8n
export N8N_BASE_URL=https://your-n8n-instance.com
export N8N_API_KEY=your-api-key

# 3. Try it!
cli-anything-n8n workflow list

Where do I get my API key? In n8n, go to Settings > API > Create API Key.

What can I do?

# List your workflows
cli-anything-n8n workflow list

# See only active workflows
cli-anything-n8n workflow list --active

# Check failed executions
cli-anything-n8n execution list --status error

# Get details of a specific workflow
cli-anything-n8n workflow get ABC123

# Create a tag
cli-anything-n8n tag create "production"

# Get JSON output (for scripts or AI agents)
cli-anything-n8n --json workflow list

# Interactive mode — just type commands
cli-anything-n8n
n8n> workflow list
n8n> tag list
n8n> exit

All commands

Group Commands What it does
workflow list, get, create, update, delete, activate, deactivate, tags, set-tags, transfer Manage your workflows
execution list, get, delete, retry Check and retry executions
credential create, delete, schema, transfer Manage credentials
variable list, create, update, delete Manage environment variables
tag list, get, create, update, delete Organize with tags
config show, set Save your connection settings

Save your connection (so you don't type it every time)

cli-anything-n8n config set base_url https://your-n8n-instance.com
cli-anything-n8n config set api_key your-api-key

# Now just use it directly
cli-anything-n8n workflow list

Configuration options

Method Priority Example
CLI flags 1 (highest) --url https://... --api-key xxx
Environment variables 2 N8N_BASE_URL, N8N_API_KEY
Config file 3 cli-anything-n8n config set ...

Extra env vars: N8N_TIMEOUT (default: 30 seconds)

For AI agents and scripts

# Always use --json for machine-readable output
cli-anything-n8n --json workflow list

# Pass complex data from files
cli-anything-n8n workflow create @my-workflow.json

# Check exit codes
cli-anything-n8n workflow get ABC123 && echo "OK" || echo "FAILED"

n8n compatibility

Verified against n8n 2.43.0 (Public API v1.1.1). Works with any n8n >= 1.0.0.

Note: Some n8n features (Data Tables, credential listing, execution stop) are not available through the public API. This CLI only exposes verified, working endpoints.

Development

git clone https://github.com/webcomunicasolutions/cli-n8n.git
cd cli-n8n
pip install -e .

# Run tests (no n8n needed)
pip install pytest
pytest cli_anything/n8n/tests/test_core.py -v

# Run E2E tests (needs a running n8n)
export N8N_BASE_URL=https://your-n8n.com
export N8N_API_KEY=your-key
pytest cli_anything/n8n/tests/test_full_e2e.py -v

Project structure

cli_anything/n8n/
├── n8n_cli.py          # CLI + interactive REPL
├── core/               # API wrappers (one file per resource)
│   ├── workflows.py
│   ├── executions.py
│   ├── credentials.py
│   ├── variables.py
│   ├── tags.py
│   └── project.py      # Config management
├── utils/
│   ├── n8n_backend.py  # HTTP client
│   └── repl_skin.py    # Terminal UI
└── tests/
    ├── test_core.py    # Unit tests (mocked)
    └── test_full_e2e.py # E2E tests (live n8n)

License

MIT - Juan Jose Sanchez Bernal / Webcomunica Soluciones Informaticas


Español

Controla tu instancia de n8n desde la terminal. Lista workflows, revisa ejecuciones, gestiona tags — todo sin abrir el navegador.

Construido con el patron CLI-Anything, para que agentes IA tambien puedan usarlo.

Pruebalo ahora (2 minutos)

# 1. Instalar
pip install cli-anything-n8n

# 2. Conectar a tu n8n
export N8N_BASE_URL=https://tu-instancia-n8n.com
export N8N_API_KEY=tu-api-key

# 3. Probar!
cli-anything-n8n workflow list

Donde consigo mi API key? En n8n, ve a Settings > API > Create API Key.

Que puedo hacer?

# Listar workflows
cli-anything-n8n workflow list

# Solo los activos
cli-anything-n8n workflow list --active

# Ver ejecuciones fallidas
cli-anything-n8n execution list --status error

# Detalle de un workflow
cli-anything-n8n workflow get ABC123

# Crear un tag
cli-anything-n8n tag create "produccion"

# Salida JSON (para scripts o agentes IA)
cli-anything-n8n --json workflow list

# Modo interactivo
cli-anything-n8n
n8n> workflow list
n8n> tag list
n8n> exit

Todos los comandos

Grupo Comandos Que hace
workflow list, get, create, update, delete, activate, deactivate, tags, set-tags, transfer Gestionar workflows
execution list, get, delete, retry Revisar y reintentar ejecuciones
credential create, delete, schema, transfer Gestionar credenciales
variable list, create, update, delete Gestionar variables de entorno
tag list, get, create, update, delete Organizar con tags
config show, set Guardar configuracion de conexion

Guardar conexion (para no escribirla cada vez)

cli-anything-n8n config set base_url https://tu-instancia-n8n.com
cli-anything-n8n config set api_key tu-api-key

# Ahora usalo directamente
cli-anything-n8n workflow list

Compatibilidad con n8n

Verificado contra n8n 2.43.0 (API publica v1.1.1). Funciona con cualquier n8n >= 1.0.0.

Nota: Algunas funcionalidades de n8n (Data Tables, listar credenciales, parar ejecuciones) no estan disponibles via la API publica. Este CLI solo expone endpoints verificados y funcionales.

Desarrollo

git clone https://github.com/webcomunicasolutions/cli-n8n.git
cd cli-n8n
pip install -e .
pip install pytest
pytest cli_anything/n8n/tests/test_core.py -v

Licencia

MIT - Juan Jose Sanchez Bernal / Webcomunica Soluciones Informaticas

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

cli_anything_n8n-1.7.0.tar.gz (37.4 kB view details)

Uploaded Source

Built Distribution

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

cli_anything_n8n-1.7.0-py3-none-any.whl (40.2 kB view details)

Uploaded Python 3

File details

Details for the file cli_anything_n8n-1.7.0.tar.gz.

File metadata

  • Download URL: cli_anything_n8n-1.7.0.tar.gz
  • Upload date:
  • Size: 37.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for cli_anything_n8n-1.7.0.tar.gz
Algorithm Hash digest
SHA256 f6d1ef1fa95de9f574f5d85b51cb2a3e12de6d3f1ff1dbfb5149baf60f5d4f74
MD5 485f80cf9b090cf677446c8f375e45b6
BLAKE2b-256 cb29c1d7449dd4aa1c7618f9e20d23aaacefdecc828a770d1f594e56eba9c7f5

See more details on using hashes here.

File details

Details for the file cli_anything_n8n-1.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cli_anything_n8n-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52642dffcca9a1693aed24645046b54ea63554907f730d009d28dac44b07a113
MD5 63897e2599ac073a2db6c411d64fb9aa
BLAKE2b-256 8229891463c324f4d1c6be58ed139ca7b640849aebd9278bb652108ecf9cae4f

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