npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-opencode-ai

v0.1.10

Published

n8n node for OpenCode Server API - Session and message management for AI coding assistant

Readme

n8n-nodes-opencode-ai

npm version License: MIT

This is an n8n community node package that provides integration with OpenCode AI Server API.

OpenCode is a powerful terminal-based AI coding assistant. This node enables you to interact with OpenCode Server from your n8n workflows.

Features

  • Session Management: Create, list, get, delete, and abort OpenCode sessions
  • Message Operations: Send messages (sync/async), execute commands, run shell commands
  • AI Agent Integration: LangChain-compatible Tool and ChatModel nodes for n8n AI agents
  • Dynamic Configuration: Auto-load available models, agents, and commands from server

Prerequisites

⚠️ Important: This package requires a running OpenCode Server instance. The node connects to OpenCode Server via REST API, so you must have the server running before using this node.

Installing OpenCode

# Install OpenCode CLI
curl -fsSL https://opencode.ai/install | bash

For other installation methods (npm, Homebrew, Scoop, etc.), see the OpenCode Installation Guide.

Oh My OpenCode (Optional, Recommended)

Oh My OpenCode is a powerful plugin that enhances OpenCode with specialized agents like Sisyphus (Claude Opus 4.5 with extended thinking) and parallel background task execution.

# Install via bunx
bunx oh-my-opencode install

# Or via npm
npm install -g oh-my-opencode

For more details, visit Oh My OpenCode GitHub.

Starting OpenCode Server

# Set authentication credentials via environment variables
OPENCODE_SERVER_USERNAME=your_username OPENCODE_SERVER_PASSWORD=your_password opencode serve --port 4096

You can change the port number as needed. The credentials you set here will be used in the n8n credential configuration.

Security Considerations

🔒 Security Warning: The example above is for development/testing purposes only.

For production deployments:

  • Never hardcode credentials in scripts or command lines
  • Use secure environment variable management (e.g., .env files with proper permissions, secrets managers)
  • Deploy behind a reverse proxy (nginx, Caddy) with HTTPS/TLS encryption
  • Implement network-level security (firewall rules, VPN, private networks)
  • Use strong passwords and consider rotating credentials regularly
  • Monitor access logs and set up alerts for suspicious activity

Example production setup with environment file:

# .env file (chmod 600)
OPENCODE_SERVER_USERNAME=secure_username
OPENCODE_SERVER_PASSWORD=strong_random_password

# Start server
source .env && opencode serve --port 4096

Installation

Community Nodes (Recommended)

  1. Go to Settings > Community Nodes in your n8n instance
  2. Click Install
  3. Enter n8n-nodes-opencode-ai and click Install

Manual Installation

npm install n8n-nodes-opencode-ai

Nodes

| Node | Description | |------|-------------| | OpenCode | Main node for session and message operations | | OpenCode Tool | LangChain tool for AI agent workflows | | OpenCode Chat Model | LangChain chat model for AI agent workflows |

Credentials

This node uses Basic Authentication to connect to OpenCode Server.

| Field | Description | Default | |-------|-------------|---------| | Base URL | OpenCode Server URL | http://127.0.0.1:4096 | | Username | Basic Auth username | - | | Password | Basic Auth password | - |

Operations

Session Resource

  • List: Get all sessions
  • Get: Get a specific session
  • Create: Create a new session
  • Delete: Delete a session
  • Abort: Abort a running session
  • Status: Get status of all sessions

Message Resource

  • Send: Send a message and wait for response
  • Send Async: Send a message without waiting
  • Execute Command: Run a slash command (e.g., /help)
  • Run Shell: Execute a shell command
  • List: Get all messages in a session
  • Get: Get a specific message by ID

Config Resource

  • Get Providers: List available AI providers and models

Usage Examples

Basic Message Send

  1. Add the OpenCode node to your workflow
  2. Select Message resource and Send operation
  3. Choose or create a session
  4. Enter your message
  5. Execute to get AI response

Using with AI Agent

  1. Add OpenCode Chat Model node as the model
  2. Add OpenCode Tool node as a tool
  3. Connect to an AI Agent node
  4. The agent can now use OpenCode for coding tasks

Temporary Session Mode

Enable Temporary Session mode to automatically create and delete sessions per request - useful for stateless operations.

Requirements

  • OpenCode Server running and accessible (see Prerequisites)
  • n8n version 1.0.0 or later
  • Node.js 18.0.0 or later

Related Links

License

This project is licensed under the MIT License.

This is an independent community node and is not officially affiliated with or endorsed by OpenCode. OpenCode is also licensed under the MIT License.


Dante Labs

Developed and maintained by Dante Labs

Support

If you find this project helpful, consider supporting the development!

Buy Me A Coffee

☕ Buy Me a Coffee: https://buymeacoffee.com/dante.labs