Skip to content

Configuration

Logan McDuffie edited this page Dec 19, 2025 · 2 revisions

Before using the CLI, configure your n8n instance credentials.

Interactive Setup

n8n-cli configure

This prompts for:

  • n8n API URL - Your n8n instance URL (e.g., http://localhost:5678)
  • API Key - Your n8n API key

Configuration is saved to ~/.config/n8n-cli/.env with secure permissions.

Non-Interactive Setup (CI/CD)

n8n-cli configure --url http://localhost:5678 --api-key your-api-key

Environment Variable Override

Environment variables take precedence over saved configuration:

export N8N_API_URL=http://localhost:5678
export N8N_API_KEY=your-api-key
n8n-cli workflows

Configuration File Location

Platform Location
Linux/macOS ~/.config/n8n-cli/.env
Windows %USERPROFILE%\.config\n8n-cli\.env

Getting an API Key

  1. Open your n8n instance
  2. Go to Settings > API
  3. Click Create API Key
  4. Copy the generated key
  5. Run n8n-cli configure and paste the key when prompted

Verifying Configuration

After configuring, verify your setup:

n8n-cli workflows

If successful, you'll see a list of workflows (or an empty array if none exist).

Clone this wiki locally