{"id":32789489,"url":"https://github.com/ssccio/n8n-nodes-opencode","last_synced_at":"2026-05-02T22:35:00.931Z","repository":{"id":320658445,"uuid":"1082935608","full_name":"ssccio/n8n-nodes-opencode","owner":"ssccio","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-25T11:06:58.000Z","size":129,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-05T11:02:07.299Z","etag":null,"topics":["ai","ai-agent","automation","chat-model","chatbot","community-node","developer-tools","integration","langchain","llm","llm-integration","low-code","n8n","n8n-nodes","no-code","opencode","typescript","workflow-automation"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ssccio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-25T02:53:03.000Z","updated_at":"2025-10-25T11:07:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4d3a017-079f-4d6d-9895-df70ea035364","html_url":"https://github.com/ssccio/n8n-nodes-opencode","commit_stats":null,"previous_names":["ssccio/n8n-nodes-opencode"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ssccio/n8n-nodes-opencode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssccio%2Fn8n-nodes-opencode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssccio%2Fn8n-nodes-opencode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssccio%2Fn8n-nodes-opencode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssccio%2Fn8n-nodes-opencode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssccio","download_url":"https://codeload.github.com/ssccio/n8n-nodes-opencode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssccio%2Fn8n-nodes-opencode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32552375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T22:28:24.418Z","status":"ssl_error","status_checked_at":"2026-05-02T22:28:14.225Z","response_time":132,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-agent","automation","chat-model","chatbot","community-node","developer-tools","integration","langchain","llm","llm-integration","low-code","n8n","n8n-nodes","no-code","opencode","typescript","workflow-automation"],"created_at":"2025-11-05T11:00:20.072Z","updated_at":"2026-05-02T22:35:00.888Z","avatar_url":"https://github.com/ssccio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# n8n-nodes-opencode\n\nThis is an n8n community node that integrates [OpenCode](https://opencode.ai/) as a chat model for use with n8n's AI Agent and LangChain workflows.\n\n[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.\n\n[OpenCode](https://opencode.ai/) is an open-source AI coding agent built for the terminal with support for multiple LLM providers.\n\n## Installation\n\nFollow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.\n\n### Option 1: npm\n\n```bash\nnpm install n8n-nodes-opencode\n```\n\n### Option 2: Manual Installation\n\n1. Clone this repository\n2. Run `npm install` and `npm run build`\n3. Copy the `dist` folder to `~/.n8n/custom/` (create if it doesn't exist)\n4. Restart n8n\n\n## Prerequisites\n\n- n8n version 1.0.0 or later\n- OpenCode server running (see [OpenCode documentation](https://opencode.ai/docs/))\n\n## OpenCode Server Setup\n\n### Local Development\n\n```bash\n# Install OpenCode CLI\nnpm install -g @opencode-ai/cli\n\n# Start the server\nopencode serve\n```\n\nBy default, OpenCode server runs on `http://localhost:4096`.\n\n## Credentials\n\nThis node requires OpenCode API credentials:\n\n1. In n8n, go to **Credentials** → **New**\n2. Search for \"OpenCode API\"\n3. Configure:\n   - **Base URL**: Your OpenCode server URL (default: `http://localhost:4096`)\n   - **API Key**: (Optional) If your OpenCode instance requires authentication\n\n## Usage\n\n1. Add the **OpenCode Chat Model** node to your workflow\n2. Select or create OpenCode API credentials\n3. Configure the model:\n   - **Agent**: Choose the OpenCode agent type (`build`, `chat`, `debug`)\n   - **Model Provider**: Select provider (Anthropic, OpenAI, Google, Groq, Ollama)\n   - **Model ID**: Specify the model (e.g., `claude-3-5-sonnet-20241022`)\n4. Connect to an **AI Agent** node or other LangChain-compatible nodes\n\n### Example Workflow\n\n```\n┌─────────────────┐     ┌──────────────────┐     ┌────────────────┐\n│  Chat Trigger   │────→│   AI Agent       │────→│  Respond       │\n└─────────────────┘     └──────────────────┘     └────────────────┘\n                               │\n                               ↓\n                        ┌──────────────────┐\n                        │ OpenCode Chat    │\n                        │     Model        │\n                        └──────────────────┘\n```\n\n## Supported Models\n\nThe node supports models from these providers (via [models.dev](https://models.dev)):\n\n### Anthropic\n\n- `claude-sonnet-4-5-20250929` (latest)\n- `claude-sonnet-4-20250514`\n- `claude-3-7-sonnet-20250219`\n- `claude-3-5-sonnet-20241022`\n- `claude-3-5-sonnet-20240620`\n- `claude-opus-4-1-20250805`\n- `claude-opus-4-20250514`\n- `claude-haiku-4-5-20251001`\n- `claude-3-5-haiku-20241022`\n\n### OpenAI\n\n- `gpt-5` (latest)\n- `gpt-5-mini`\n- `gpt-5-nano`\n- `o3`\n- `o3-mini`\n- `gpt-4.1`\n- `gpt-4.1-mini`\n- `gpt-4o`\n- `gpt-4o-mini`\n- `o1`\n- `o1-mini`\n- `gpt-4-turbo`\n\n### Google\n\n- `gemini-2.5-pro` (latest)\n- `gemini-2.5-flash`\n- `gemini-2.5-flash-lite`\n- `gemini-2.0-flash`\n- `gemini-2.0-flash-lite`\n- `gemini-1.5-pro`\n- `gemini-1.5-flash`\n- `gemini-1.5-flash-8b`\n\n### Groq\n\n- `llama-3.3-70b-versatile`\n- `llama3-70b-8192`\n- `llama-3.1-8b-instant`\n- `qwen-qwq-32b`\n- `mistral-saba-24b`\n- `gemma2-9b-it`\n\n### Mistral\n\n- `mistral-large-latest`\n- `mistral-medium-latest`\n- `mistral-small-latest`\n- `pixtral-large-latest`\n- `codestral-latest`\n- `ministral-8b-latest`\n- `ministral-3b-latest`\n\n### Meta (Llama)\n\n- `llama-4-maverick-17b`\n- `llama-4-scout-17b`\n- `llama-3.3-70b-instruct`\n- `llama-3.2-1b-instruct`\n- `llama-3.1-70b-instruct`\n- `llama-3.1-8b-instruct`\n\n### DeepSeek\n\n- `deepseek-chat`\n- `deepseek-reasoner`\n\n### Alibaba (Qwen)\n\n- `qwen3-max`\n- `qwen3-32b`\n- `qwen3-14b`\n- `qwen3-8b`\n- `qwen-max`\n- `qwen-plus`\n\n### Moonshot AI (Kimi)\n\n- `kimi-k2-0905-preview`\n- `kimi-k2-0711-preview`\n\n### Ollama (Self-hosted)\n\n- Any model available in your Ollama instance\n- Examples: `qwen2.5-coder:32b`, `codellama:34b`, `llama3:70b`\n\n## Configuration Options\n\n### Agent Types\n\n- **Build**: Optimized for implementing features and writing code\n- **Chat**: General-purpose conversational agent\n- **Debug**: Specialized for debugging and troubleshooting\n\n### Model Parameters\n\n- **Temperature**: Control randomness (0-2, default: 0.7)\n- **Maximum Tokens**: Limit response length (-1 for unlimited)\n\n## Features\n\n- ✅ Full LangChain integration\n- ✅ Multiple model providers (Anthropic, OpenAI, Google, Groq, Ollama)\n- ✅ Session management with automatic cleanup\n- ✅ Tool calling support (via OpenCode's native capabilities)\n- ✅ Comprehensive error handling and validation\n- ✅ TypeScript support with full type definitions\n\n## Troubleshooting\n\n### Connection Issues\n\n**Problem**: \"Failed to create OpenCode session\"\n**Solution**: Verify OpenCode server is running and accessible at the configured base URL.\n\n```bash\n# Test connection\ncurl http://localhost:4096/app\n```\n\n### Authentication Issues\n\n**Problem**: \"Unauthorized\" errors\n**Solution**: If your OpenCode server requires authentication, ensure the API key is correctly configured in credentials.\n\n### Model Not Available\n\n**Problem**: Model ID not recognized\n**Solution**: Ensure the specified model is configured in your OpenCode server and the corresponding provider API keys are set.\n\n## Development\n\n### Build\n\n```bash\nnpm install\nnpm run build\n```\n\n### Watch Mode\n\n```bash\nnpm run dev\n```\n\n### Lint\n\n```bash\nnpm run lint\nnpm run lintfix\n```\n\n## Architecture\n\nThis node implements a custom LangChain `BaseChatModel` that:\n\n1. **Session Management**: Creates and manages OpenCode sessions via REST API\n2. **Message Handling**: Converts LangChain messages to OpenCode prompt format\n3. **Streaming**: Implements Server-Sent Events (SSE) for real-time responses\n4. **Event Parsing**: Processes `message.part.updated` and `session.updated` events\n\n### Key Components\n\n- `OpenCodeChatModel.ts`: Custom LangChain chat model implementation\n- `LmChatOpenCode.node.ts`: n8n node wrapper\n- `OpenCodeApi.credentials.ts`: Credentials definition\n\n## API Endpoints Used\n\n- `POST /session`: Create new session\n- `POST /session/:id/prompt`: Send prompt with message parts\n- `GET /event`: Server-Sent Events stream for responses\n- `DELETE /session/:id`: Clean up session\n\n## Contributing\n\nContributions are welcome! Please:\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Run tests and linting\n5. Submit a pull request\n\n## License\n\n[MIT](LICENSE)\n\n## Resources\n\n- [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)\n- [OpenCode Documentation](https://opencode.ai/docs/)\n- [OpenCode GitHub](https://github.com/sst/opencode)\n- [LangChain Documentation](https://js.langchain.com/)\n\n## Support\n\nFor issues and questions:\n\n- [GitHub Issues](https://github.com/ssccio/n8n-nodes-opencode/issues)\n- [n8n Community Forum](https://community.n8n.io/)\n- [OpenCode Discord](https://discord.gg/opencode)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssccio%2Fn8n-nodes-opencode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssccio%2Fn8n-nodes-opencode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssccio%2Fn8n-nodes-opencode/lists"}