n8n-nodes-github-codepilot
v0.2.0
Published
n8n community node for GitHub Codepilot - AI-powered vibecoding, workflow building, and MCP integration
Maintainers
Readme
n8n-nodes-github-copilot
An n8n community node for AI-powered vibecoding with GitHub Copilot Chat.
This node integrates GitHub Copilot (via GitHub Models API) into your n8n workflows, enabling automated code generation, review, refactoring, and more.
Features
- Chat Completion - Direct conversation with Copilot AI models
- Code Generation - Generate code from natural language descriptions
- Code Explanation - Get detailed explanations of code
- Code Review - Automated code review with suggestions
- Code Refactor - Improve code quality and structure
- Fix Code - Debug and fix issues in code
- Generate Tests - Create comprehensive unit tests
- Documentation - Auto-generate code documentation
Supported Models
- GPT-4o (Recommended)
- GPT-4o Mini
- Claude 3.5 Sonnet
- o1-preview
- o1-mini
Installation
Community Nodes (Recommended)
- Go to Settings > Community Nodes
- Select Install
- Enter
n8n-nodes-github-copilot - Confirm the installation
Manual Installation
cd ~/.n8n/nodes
npm install n8n-nodes-github-copilotThen restart n8n.
Authentication
This node requires a GitHub Personal Access Token (PAT) with appropriate permissions.
Getting a GitHub Token
- Go to GitHub Settings > Developer settings > Personal access tokens
- Generate a new token (classic) with the following scopes:
read:user- For basic authentication validation- For GitHub Copilot access, you need an active Copilot subscription
- Copy the token and use it in the n8n credentials
Alternative: GitHub Models API
For broader model access, you can use the GitHub Models platform:
- Visit GitHub Models
- Get access to the models you want to use
- Use your GitHub PAT for authentication
Usage Examples
Code Generation
Generate a TypeScript function:
Operation: Code Generation
Language: TypeScript
Description: Create a function that validates email addresses using regex and returns an object with isValid and domain propertiesCode Review
Submit code for automated review:
Operation: Code Review
Code: [paste your code]The node will return detailed feedback on code quality, potential bugs, security issues, and improvement suggestions.
Generate Tests
Automatically create unit tests:
Operation: Generate Tests
Language: JavaScript
Test Framework: Jest
Code: [paste your code]Fix Code
Debug and fix issues:
Operation: Fix Code
Code: [paste buggy code]
Error Description: TypeError: Cannot read property 'length' of undefinedConfiguration Options
| Option | Description | Default | |--------|-------------|---------| | Temperature | Controls creativity (0-2) | 0.7 | | Max Tokens | Maximum response length | 4096 | | System Prompt | Custom AI behavior instructions | (operation-specific) | | Output Format | Code only, with explanation, or full | Code with Explanation |
Workflow Integration
Example: Automated PR Code Review
- GitHub Trigger - Listen for PR events
- GitHub - Fetch PR diff/files
- GitHub Copilot - Review code with "Code Review" operation
- GitHub - Post review comments
Example: Documentation Generator
- Read File - Get source code files
- GitHub Copilot - Generate documentation
- Write File - Save documentation
Example: Test Generation Pipeline
- Watch Folder - Monitor for new code files
- Read File - Get file contents
- GitHub Copilot - Generate tests
- Write File - Save test files
- Execute Command - Run tests
Error Handling
The node includes comprehensive error handling:
- Invalid credentials are caught during execution
- API rate limits are reported with clear messages
- Model-specific errors are passed through
Enable "Continue On Fail" to process multiple items even if some fail.
Limitations
- Requires active GitHub account
- For Copilot-specific models, requires GitHub Copilot subscription
- Rate limits apply based on your GitHub plan
- Maximum context length varies by model
Development
# Clone the repo
git clone https://github.com/your-username/n8n-nodes-github-copilot.git
# Install dependencies
npm install
# Build
npm run build
# Link for local development
npm link
cd ~/.n8n/nodes
npm link n8n-nodes-github-copilotContributing
Contributions are welcome! Please open an issue or PR.
License
MIT License - see LICENSE file.
Credits
Conceived by Romuald Czlonkowski - www.aiadvisors.pl/en
