remote-opencode 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +68 -4
  3. package/package.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 RoundTable02
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -38,6 +38,12 @@ The bot runs on your development machine alongside OpenCode. When you send a com
38
38
  - [Installation](#installation)
39
39
  - [Quick Start](#quick-start)
40
40
  - [Discord Bot Setup](#discord-bot-setup)
41
+ - [Step 1: Create Discord Application](#step-1-create-discord-application)
42
+ - [Step 2: Create Bot & Get Token](#step-2-create-bot--get-token)
43
+ - [Step 3: Enable Required Intents](#step-3-enable-required-intents)
44
+ - [Step 4: Configure Bot Permissions](#step-4-configure-bot-permissions)
45
+ - [Step 5: Get Your Server (Guild) ID](#step-5-get-your-server-guild-id)
46
+ - [Step 6: Invite Bot to Your Server](#step-6-invite-bot-to-your-server)
41
47
  - [CLI Commands](#cli-commands)
42
48
  - [Discord Slash Commands](#discord-slash-commands)
43
49
  - [Usage Workflow](#usage-workflow)
@@ -131,7 +137,65 @@ Click **"Save Changes"**
131
137
  <!-- ![Enable Intents](./docs/images/03-intents.png) -->
132
138
  *Screenshot placeholder: Intents section with required toggles enabled*
133
139
 
134
- ### Step 4: Get Your Server (Guild) ID
140
+ ### Step 4: Configure Bot Permissions
141
+
142
+ The bot needs specific permissions to function properly. You can configure permissions in two ways:
143
+
144
+ #### Option A: Using OAuth2 URL Generator (Recommended)
145
+
146
+ 1. Navigate to the **"OAuth2"** section in the sidebar
147
+ 2. Click on **"URL Generator"**
148
+ 3. In **"Scopes"**, select:
149
+ - ✅ `bot`
150
+ - ✅ `applications.commands`
151
+ 4. In **"Bot Permissions"**, select only these essential permissions:
152
+
153
+ **General Permissions:**
154
+ - ✅ **View Channels** — Required to access channels
155
+
156
+ **Text Permissions:**
157
+ - ✅ **Send Messages** — Send responses to channels
158
+ - ✅ **Create Public Threads** — Create threads for each `/opencode` session
159
+ - ✅ **Send Messages in Threads** — Reply within threads
160
+ - ✅ **Embed Links** — Send formatted embed messages
161
+ - ✅ **Read Message History** — Access context for conversations
162
+ - ✅ **Add Reactions** — Add buttons (uses emoji reactions internally)
163
+ - ✅ **Use Slash Commands** — Register and use slash commands
164
+
165
+ 5. Copy the generated URL at the bottom — this is your bot invite link!
166
+
167
+ <!-- SCREENSHOT: OAuth2 URL Generator showing selected permissions -->
168
+ <!-- ![OAuth2 Permissions](./docs/images/03b-oauth2-permissions.png) -->
169
+ *Screenshot placeholder: OAuth2 URL Generator with bot permissions selected*
170
+
171
+ #### Option B: Manual Permission Calculation
172
+
173
+ If you're building the URL manually, use this permission value:
174
+
175
+ ```
176
+ https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=343932274624&scope=bot%20applications.commands
177
+ ```
178
+
179
+ **Permission Breakdown (343932274624):**
180
+
181
+ | Permission | Value | Purpose |
182
+ |------------|-------|---------|
183
+ | View Channels | 1024 | Access channels and read messages |
184
+ | Send Messages | 2048 | Send messages to channels |
185
+ | Create Public Threads | 68719476736 | Create threads for each `/opencode` command |
186
+ | Send Messages in Threads | 274877906944 | Reply within created threads |
187
+ | Embed Links | 16384 | Send rich embed messages with formatting |
188
+ | Read Message History | 65536 | Access previous messages for context |
189
+ | Add Reactions | 64 | Add button components (uses emoji reactions) |
190
+ | Use Slash Commands | 2147483648 | Register and respond to slash commands |
191
+
192
+ **Optional Permissions (not required):**
193
+ - **Attach Files** (32768) — Only if you want to upload files
194
+ - **Mention @everyone** (131072) — Only if bot needs to ping everyone
195
+
196
+ **Important:** The URL must include `applications.commands` scope for slash commands to work!
197
+
198
+ ### Step 5: Get Your Server (Guild) ID
135
199
 
136
200
  1. Open Discord and go to **User Settings → Advanced**
137
201
  2. Enable **"Developer Mode"**
@@ -142,12 +206,12 @@ Click **"Save Changes"**
142
206
  <!-- ![Copy Server ID](./docs/images/04-guild-id.png) -->
143
207
  *Screenshot placeholder: Right-click menu showing "Copy Server ID" option*
144
208
 
145
- ### Step 5: Invite Bot to Your Server
209
+ ### Step 6: Invite Bot to Your Server
146
210
 
147
- The setup wizard generates an invite URL, or use this format:
211
+ Use the URL generated in Step 4 (OAuth2 URL Generator), or construct it manually:
148
212
 
149
213
  ```
150
- https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=2147534848&scope=bot
214
+ https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=343932274624&scope=bot%20applications.commands
151
215
  ```
152
216
 
153
217
  1. Replace `YOUR_CLIENT_ID` with your Application ID
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remote-opencode",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Discord bot for remote OpenCode CLI access",
5
5
  "main": "dist/src/index.js",
6
6
  "bin": {