@n8n-as-code/agent-cli
v0.12.0
Published
AI Agent Tools for n8n-as-code (Search, Get Schema)
Readme
@n8n-as-code/agent-cli
Specialized tooling for AI Agents (Cursor, Cline, Copilot) to interact with n8n workflows and nodes.
🛠 Purpose
This package provides a dedicated CLI (n8n-agent) and programmatic tools designed to:
- Provide Context: Help AI agents understand n8n node structures.
- Search Nodes: Find specific n8n nodes and their properties.
- Initialize Context: Bootstrap developer environments with
AGENTS.md, JSON schemas, and snippets.
🚀 Installation
npm install @n8n-as-code/agent-cli📖 CLI Usage
search <query> - 🚀 Deep Unified Search (PRIMARY TOOL)
Deep Full-Text Search with Smart Keyword Matching across 600+ nodes and 1240+ documentation pages. Optimized for natural language queries, technical terms, and capabilities (e.g., "image generation" finds Google Gemini).
KEY FEATURES:
- Comprehensive Keyword Extraction: Finds nodes based on operations (e.g., "generate", "transcribe") and resources (e.g., "image", "video").
- Smart Prioritization: Matches on keywords first, then titles, then content.
- Fuzzy Matching: Handles typos and partial terms ("googl shets").
# Search nodes, docs, and tutorials
n8n-agent search "how to generate images"
n8n-agent search "google sheets"
# Filter by type
n8n-agent search "authentication" --type documentation
n8n-agent search "database" --type node
# Filter by category
n8n-agent search "ai" --category advanced-aiget <nodeName> - 📚 Complete Node Info
Get full node information: schema + documentation + examples.
n8n-agent get googleSheets
n8n-agent get httpRequestIncludes hints for next steps!
schema <nodeName> - ⚡ Quick Parameter Reference
Fast access to technical schema (parameters only).
n8n-agent schema googleSheets
# Returns only properties and required fieldsdocs <title> - 📖 Read Documentation
Read full documentation pages. Use search first to find relevant titles.
# Read a specific page
n8n-agent docs "Google Gemini"
n8n-agent docs "Expressions"
# List categories or stats
n8n-agent docs --listguides [query] - 🎯 Find Guides
Find workflow guides, tutorials, and walkthroughs.
n8n-agent guides "email automation"
n8n-agent guides "ai workflow"
n8n-agent guides --listworkflows - 🌐 Search & Download Community Workflows
Search and download workflows from the n8nworkflows.xyz community repository (7000+ workflows).
workflows search <query>
Search workflows using FlexSearch for high-relevance results.
n8n-agent workflows search "slack notification"
n8n-agent workflows search "AI chatbot telegram"
n8n-agent workflows search "invoice processing" --limit 20
n8n-agent workflows search "google sheets" --jsonworkflows info <id>
Display detailed information about a specific workflow.
n8n-agent workflows info 916
# Shows: name, author, tags, download URLworkflows install <id>
Download a workflow JSON file.
n8n-agent workflows install 916
n8n-agent workflows install 4365 --output my-chatbot.json
n8n-agent workflows install 8088 --force # Overwrite existingworkflows list
List available workflows (newest first).
n8n-agent workflows list
n8n-agent workflows list --limit 50Features:
- 🔍 7000+ workflows indexed from n8nworkflows.xyz
- ⚡ Offline search - FlexSearch powered, < 5ms latency
- 📦 Lightweight - ~6MB index (~500KB compressed)
- 🎯 High relevance - Smart keyword matching and ranking
related <query> - 🔗 Discover Resources
Find related nodes and documentation.
n8n-agent related googleSheets
# Returns: Google Drive, Excel, Airtable, related docs
n8n-agent related "ai agents"
# Returns: AI-related concepts, nodes, exampleslist - 📋 List Resources
List available nodes and documentation categories.
# Summary of nodes and docs
n8n-agent list
# List all node names
n8n-agent list --nodes
# List all doc categories
n8n-agent list --docsvalidate <file> - ✅ Validate Workflows
Validate workflow JSON files.
n8n-agent validate workflow.json
n8n-agent validate workflow.json --strictupdate-ai - 🤖 Update AI Context
Update AI Context (AGENTS.md, rule files, snippets).
n8n-agent update-ai
n8n-agent update-ai --version 1.70.0📁 Data Source
The Agent CLI uses a pre-generated index of n8n nodes from the official n8n source code. The data is stored in dist/assets/ (generated during build):
n8n-knowledge-index.json: Unified FlexSearch index for thesearchcommand.n8n-nodes-technical.json: Detailed technical schemas for thegetcommand.n8n-docs-complete.json: Full documentation content.
🧩 Integration
With @n8n-as-code/cli
The main CLI package (@n8n-as-code/cli) uses this package internally for its init-ai / update-ai commands to generate AI context files.
With VS Code Extension
This package is a core dependency of the n8n-as-code VS Code extension, powering its AI features and node indexing.
📄 License
MIT
