百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

remote-opencode

> 编程语言
开源

用于远程访问 OpenCode CLI 的 Discord 机器人

197 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

用于远程访问 OpenCode CLI 的 Discord 机器人

remote-opencode

Control your AI coding assistant from anywhere — your phone, tablet, or another computer.

Used by developers worldwide — 2,000+ weekly downloads on npm

New in v1.5! Session management — browse, attach, and manage OpenCode CLI sessions from Discord with /session. Plus: model autocomplete for /model set. See changelog

v1.4: Voice message support — send voice messages that are automatically transcribed and processed. See demo

remote-opencode is a Discord bot that bridges your local OpenCode CLI to Discord, enabling you to interact with your AI coding assistant remotely. Perfect for developers who want to:

  • Code from mobile — Send coding tasks from your phone while away from your desk
  • Access from any device — Use your powerful dev machine from a laptop or tablet
  • Work remotely — Control your home/office workstation from anywhere
  • Collaborate — Share AI coding sessions with team members in Discord
  • Automated Workflows — Queue up multiple tasks and let the bot process them sequentially
  • Voice Messages — Send voice messages that are automatically transcribed and processed as text

How It Works

mermaid
flowchart LR
    A[" Your Phone / Other Device"] |"Discord API"| B[" Discord Bot"]

    subgraph Workflow
        direction TB
        B --> C[" OpenCode CLI"]
        C --> D[" Your Codebase"]
    end

The bot runs on your development machine alongside OpenCode. When you send a command via Discord, it's forwarded to OpenCode, and the output streams back to you in real-time.

Demo

https://github.com/user-attachments/assets/b6239cb6-234e-41e2-a4d1-d4dd3e86c7b9

Voice Mode Demo

https://github.com/user-attachments/assets/59cf162a-ec86-41b5-a1f3-9b1379acd9fd


Table of Contents

  • Installation
  • Quick Start
  • Proxy Support
  • Discord Bot Setup
  • CLI Commands
  • Discord Slash Commands
  • Usage Workflow
  • Access Control
  • Configuration
  • Troubleshooting
  • Development
  • Changelog
  • License

Installation

Prerequisites

  • Node.js 22+ — Download
  • OpenCode CLI — Must be installed and working on your machine
  • Discord Account — With a server where you have admin permissions

Install via npm

bash
# Global installation (recommended)
npm install -g remote-opencode

# Or run directly with npx
npx remote-opencode

Install from source

bash
git clone https://github.com/RoundTable02/remote-opencode.git
cd remote-opencode
npm install
npm run build
npm link  # Makes 'remote-opencode' available globally

Quick Start

bash
# Step 1: Run the interactive setup wizard
remote-opencode setup

# Step 2: Start the Discord bot
remote-opencode start

That's it! Now use Discord slash commands to interact with OpenCode.


Proxy Support

remote-opencode supports HTTP proxy environments for Discord and other external API requests.

Supported environment variables:

  • HTTP_PROXY
  • HTTPS_PROXY
  • ALL_PROXY
  • NO_PROXY

Proxy settings are applied app-wide. Local OpenCode traffic is kept direct automatically, so localhost, 127.0.0.1, and ::1 are always excluded from proxying.

Example

bash
export HTTPS_PROXY=http://proxy.company.local:8080
export NO_PROXY=internal.company.local
remote-opencode start

If your network uses a single proxy for everything, ALL_PROXY is also supported:

bash
export ALL_PROXY=http://proxy.company.local:8080
remote-opencode start

Discord Bot Setup

The setup wizard (remote-opencode setup) guides you through the entire process interactively:

  1. Opens Discord Developer Portal in your browser
  2. Walks you through creating an application, enabling intents, and getting your bot token
  3. Generates the invite link automatically and opens it in your browser
  4. Deploys slash commands to your server

Just run remote-opencode setup and follow the prompts — no manual URL copying needed!

Manual setup reference (click to expand)

If you prefer manual setup or need to troubleshoot:

  1. Create Application: Go to Discord Developer Portal, create a new application
  2. Enable Intents: In "Bot" section, enable SERVER MEMBERS INTENT and MESSAGE CONTENT INTENT
  3. Get Bot Token: In "Bot" section, reset/view token and copy it
  4. Get Guild ID: Enable Developer Mode in Discord settings, right-click your server → Copy Server ID
  5. Invite Bot: Use this URL format:
    https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=2147534848&scope=bot+applications.commands
  6. Check Channel Access: For private or restricted channels, make sure the bot user or bot role can access the channel.

CLI Commands

Command Description
remote-opencode Start the bot (shows setup guide if not configured)
remote-opencode setup Interactive setup wizard — configures bot token, IDs
remote-opencode start Start the Discord bot
remote-opencode deploy Deploy/update slash commands to Discord
remote-opencode undeploy Remove slash commands from Discord
remote-opencode config Display current configuration info
remote-opencode allow add Add a Discord user ID to the allowlist
remote-opencode allow remove Remove a Discord user ID from the allowlist
remote-opencode allow list List all user IDs in the allowlist
remote-opencode allow reset Clear the entire allowlist (removes access control)
remote-opencode voice set Set OpenAI API key for voice message transcription
remote-opencode voice remove Remove the stored OpenAI API key
remote-opencode voice status Show voice transcription status and API key source

Discord Slash Commands

Once the bot is running, use these commands in your Discord server:

/setpath — Register a Project

Register a local project path with an alias for easy reference.

/setpath alias:myapp path:/Users/you/projects/my-app
Parameter Description
alias Short name for the project (e.g., myapp, backend)
path Absolute path to the project on your machine

/projects — List Registered Projects

View all registered project paths and their aliases.

/projects

/use — Bind Project to Channel

Set which project a Discord channel should interact with.

/use alias:myapp

After binding, all /opencode commands in that channel will work on the specified project.

/opencode — Send Command to AI

The main command — sends a prompt to OpenCode and streams the response.

/opencode prompt:Add a dark mode toggle to the settings page

Features:

  • Auto-creates a thread for each conversation
  • ⚡ Real-time streaming — see output as it's generated (1-second updates)
  • ⏸️ Interrupt button — stop the current task if needed
  • Session persistence — continue conversations in the same thread

/work — Create a Git Worktree

Start isolated work on a new branch with its own worktree.

/work branch:feature/dark-mode description:Implement dark mode toggle
/work branch:feature/dark-mode      # description defaults to the branch name
Parameter Description
branch Git branch name (will be sanitized)
description Optional. Defaults to the branch name when omitted.

Features:

  • Creates a new git worktree for isolated work
  • Opens a dedicated thread for the task
  • ️ Delete button — removes worktree and archives thread
  • Create PR button — automatically creates a pull request

This is perfect for working on multiple features simultaneously without branch switching.

/code — Toggle Passthrough Mode

Enable passthrough mode in a thread to send messages directly to OpenCode without slash commands.

/code

How it works:

  1. Run /code in any thread to enable passthrough mode
  2. Type messages naturally — they're sent directly to OpenCode
  3. Run /code again to disable

Example:

You: /code
Bot: ✅ Passthrough mode enabled for this thread.
     Your messages will be sent directly to OpenCode.

You: Add a dark mode toggle to settings
Bot:  Prompt: Add a dark mode toggle to settings
     [streaming response...]

You: Now add a keyboard shortcut for it
Bot:  Prompt: Now add a keyboard shortcut for it
     [streaming response...]

You: /code
Bot: ❌ Passthrough mode disabled.

Features:

  • Mobile-friendly — no more typing slash commands on phone
  • Thread-scoped — only affects the specific thread, not the whole channel
  • ⏳ Busy indicator — shows ⏳ reaction if previous task is still running
  • Safe — ignores bot messages (no infinite loops)

/autowork — Toggle Automatic Worktree Creation

Enable automatic worktree creation for a project. When enabled, new /opencode sessions will automatically create isolated git worktrees.

/autowork

How it works:

  1. Run /autowork in a channel bound to a project
  2. The setting toggles on/off for that project
  3. When enabled, new sessions automatically create worktrees with branch names like auto/abc12345-1738600000000

Features:

  • Automatic isolation — each session gets its own branch and worktree
  • Mobile-friendly — no need to type /work with branch names
  • ️ Delete button — removes worktree when done
  • Create PR button — easily create pull requests from worktree
  • ⚡ Per-project setting — enable/disable independently for each project

/autocode — Toggle Automatic Passthrough Mode

Enable automatic passthrough mode for a project. When enabled, every new thread the bot creates (via /work or /opencode) will already have passthrough mode on, so plain messages are sent to OpenCode without needing to run /code first.

/autocode

How it works:

  1. Run /autocode in a channel bound to a project
  2. The setting toggles on/off for that project
  3. New threads in that project skip the manual /code step

Features:

  • Mobile-friendly — one less command to type per thread
  • Thread-scoped — each new thread starts with passthrough enabled; /code still toggles it within a thread
  • ⚡ Per-project setting — enable/disable independently for each project

/queue — Manage Message Queue

Control the automated job queue for the current thread.

/queue list
/queue clear
/queue pause
/queue resume
/queue settings continue_on_failure:True fresh_context:False

How it works:

  1. Send multiple messages to a thread (or use /opencode multiple times)
  2. If the bot is busy, it reacts with `` and adds the task to the queue
  3. Once the current job is done, the bot automatically picks up the next one

Settings:

  • continue_on_failure: If True, the bot moves to the next task even if the curr

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptdeveloper-toolsopencoderemote

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言