hivecode-mcp 0.14.1 → 0.14.3
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.
- package/HIVE_RULES.md +98 -98
- package/LICENSE +21 -21
- package/README.md +421 -421
- package/core.js +91 -91
- package/docs/ALWAYS_ON.md +310 -310
- package/docs/GITHUB_WORKFLOW.md +394 -394
- package/docs/HIVE_RULES.md +41 -41
- package/docs/MCP.md +157 -157
- package/docs/QUICKSTART.md +266 -266
- package/docs/SELF_HOSTING.md +256 -256
- package/docs/SLACK_SETUP.md +474 -474
- package/docs/TROUBLESHOOTING.md +106 -105
- package/hive-activity.js +336 -336
- package/hive-authors.js +46 -44
- package/hive-await.js +230 -230
- package/hive-branch.js +674 -607
- package/hive-busy.js +88 -88
- package/hive-coord.js +110 -110
- package/hive-gate.js +135 -135
- package/hive-github.js +3 -1
- package/hive-hook-install.js +179 -179
- package/hive-instructions.js +74 -74
- package/hive-land.js +709 -691
- package/hive-listen.js +81 -81
- package/hive-mailbox.js +520 -520
- package/hive-mcp-http.js +591 -591
- package/hive-mcp.js +92 -12
- package/hive-mux-proto.js +58 -58
- package/hive-mux.js +354 -351
- package/hive-notify.js +234 -233
- package/hive-obligations.js +247 -247
- package/hive-poll-proto.js +50 -50
- package/hive-pr-staleness.js +189 -189
- package/hive-pr.js +637 -512
- package/hive-privacy.js +327 -327
- package/hive-receipts.js +233 -233
- package/hive-relay-health.js +234 -234
- package/hive-repos.js +430 -430
- package/hive-room-key.js +210 -210
- package/hive-room-mode.js +1761 -1668
- package/hive-room-watcher.js +623 -561
- package/hive-secrets.js +89 -89
- package/hive-session.js +114 -114
- package/hive-setup.js +560 -560
- package/hive-slack-agent.js +408 -408
- package/hive-slack.js +2417 -2367
- package/hive-stdio.js +172 -172
- package/hive-stop-hook.js +293 -293
- package/hive-throttle.js +118 -118
- package/hive-time.js +71 -71
- package/hive-transport.js +617 -578
- package/hive-update.js +58 -58
- package/hive-version.js +110 -110
- package/hive-webhook.js +55 -54
- package/icr-merge.js +58 -58
- package/icr.js +856 -851
- package/lang-brace.js +305 -305
- package/lang-js.js +695 -651
- package/lang-json.js +211 -211
- package/lang-python.js +588 -588
- package/lang-ruby.js +230 -230
- package/lang-toml.js +136 -136
- package/lang-yaml.js +183 -183
- package/limits.js +413 -413
- package/package.json +11 -3
- package/reconcile.cjs +621 -621
- package/slack-app-manifest-agent.json +61 -61
- package/slack-app-manifest-inbound.json +36 -36
- package/slack-app-manifest.json +27 -27
- package/substrate.js +252 -252
- package/sync.js +434 -60
- package/token.js +201 -201
package/docs/QUICKSTART.md
CHANGED
|
@@ -1,266 +1,266 @@
|
|
|
1
|
-
# Quickstart: Zero to a Pull Request in 10 Minutes
|
|
2
|
-
|
|
3
|
-
Connect an AI coding agent to your GitHub repository so that adding a `hivecode` label to an issue runs the agent in an isolated workspace and opens a tested pull request.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Step 1: Prerequisites
|
|
8
|
-
|
|
9
|
-
Ensure you have the following installed on your machine:
|
|
10
|
-
|
|
11
|
-
1. **Node.js** (`>=18`, per `package.json` engines):
|
|
12
|
-
```bash
|
|
13
|
-
node -v
|
|
14
|
-
```
|
|
15
|
-
2. **GitHub CLI** (`gh`):
|
|
16
|
-
```bash
|
|
17
|
-
gh --version
|
|
18
|
-
```
|
|
19
|
-
If missing, install it from [cli.github.com](https://cli.github.com).
|
|
20
|
-
3. **An AI coding agent CLI** (such as Claude Code):
|
|
21
|
-
```bash
|
|
22
|
-
claude --version
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Step 2: Configure Your Agent (`setup`)
|
|
28
|
-
|
|
29
|
-
Run `setup` to install the runtime and configure the `hivecode` MCP server into your agent apps:
|
|
30
|
-
|
|
31
|
-
**Bash & PowerShell:**
|
|
32
|
-
```bash
|
|
33
|
-
npx -y hivecode-mcp@latest setup
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### What Success Looks Like
|
|
37
|
-
`setup` verifies each agent by performing an MCP handshake with its configuration:
|
|
38
|
-
```
|
|
39
|
-
Claude Code READY configured in ~/.claude.json (starts in 0.3s)
|
|
40
|
-
stop gate added to ~/.claude/settings.json: in a room, Claude Code is not let end a turn with no listener running
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Likely Failure & Fix
|
|
44
|
-
If an agent configuration file cannot be updated:
|
|
45
|
-
```
|
|
46
|
-
Claude Code FAILED ~/.claude.json
|
|
47
|
-
written, but it does not start: <error>
|
|
48
|
-
```
|
|
49
|
-
**Fix:** Add the `hivecode` server entry by hand to your agent's MCP settings:
|
|
50
|
-
```json
|
|
51
|
-
{
|
|
52
|
-
"mcpServers": {
|
|
53
|
-
"hivecode": {
|
|
54
|
-
"command": "node",
|
|
55
|
-
"args": ["<path-to-runtime>/hive-mcp.js"]
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## Step 3: Authenticate with GitHub (`gh auth login`)
|
|
64
|
-
|
|
65
|
-
Run this inside your local clone of the repository you want to watch:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
gh auth login
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Follow the interactive prompts to log in via your browser.
|
|
72
|
-
|
|
73
|
-
### What Success Looks Like
|
|
74
|
-
`gh` confirms you're logged in and displays your active account.
|
|
75
|
-
|
|
76
|
-
### Likely Failure & Fix
|
|
77
|
-
If `gh` is not logged in, network is down, or you run outside a repository:
|
|
78
|
-
- `Q600 gh is not logged in on this machine. Run: gh auth login (or set GH_TOKEN)`
|
|
79
|
-
**Fix:** Complete `gh auth login` or set `GH_TOKEN`.
|
|
80
|
-
- `Q601 GitHub has no repository <owner>/<repo> that <login> can see (HTTP 404). Check origin (<url>); a private repo needs an account with access to it (gh auth status shows which one gh uses).`
|
|
81
|
-
**Fix:** Verify `git remote -v` points to the intended repository, and confirm `gh auth status` shows an account with read access to it.
|
|
82
|
-
- `Q601 <cwd> is not inside a git repository. Run this in your clone of the repo.`
|
|
83
|
-
**Fix:** `cd` into your git clone before running.
|
|
84
|
-
- `Q601 origin (<url>) is not a github.com repository.`
|
|
85
|
-
**Fix:** Verify `git remote -v` points to GitHub.
|
|
86
|
-
- `Q601 the GitHub account gh is logged in as cannot push to <owner>/<repo>.`
|
|
87
|
-
**Fix:** Ensure your GitHub account has write permissions to push branches.
|
|
88
|
-
- `Q603 could not reach GitHub for <endpoint>: <error>`
|
|
89
|
-
**Fix:** Check your network connection to `github.com`.
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## Step 4 (Optional): Connect Slack
|
|
94
|
-
|
|
95
|
-
To receive per-issue progress updates and stop runs directly from Slack:
|
|
96
|
-
|
|
97
|
-
1. Create a Slack app at [api.slack.com/apps](https://api.slack.com/apps) by selecting **From a manifest** and pasting [`slack-app-manifest-inbound.json`](../slack-app-manifest-inbound.json).
|
|
98
|
-
2. Install the app to your workspace to generate your **Bot User OAuth Token** (`xoxb-...`).
|
|
99
|
-
3. Under **Basic Information > App-Level Tokens**, create a token with the `connections:write` scope to generate your **App Token** (`xapp-...`).
|
|
100
|
-
4. In Slack, invite the bot to your channel: `/invite @Hivecode`.
|
|
101
|
-
|
|
102
|
-
> **One Slack app per process:** Each process that reads Slack (e.g. `github start --slack-allow`, `slack start`, or `hive-slack-agent`) needs its own dedicated Slack app and App Token (`xapp-...`). Slack Socket Mode distributes incoming messages across all active connections on the same token without channel routing; sharing an app between the watcher and a room bridge will cause stop commands and thread replies to split between the two processes (`Q635`).
|
|
103
|
-
|
|
104
|
-
Set the tokens in your shell:
|
|
105
|
-
|
|
106
|
-
**Bash:**
|
|
107
|
-
```bash
|
|
108
|
-
export SLACK_BOT_TOKEN="xoxb-..."
|
|
109
|
-
export SLACK_APP_TOKEN="xapp-..."
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**PowerShell:**
|
|
113
|
-
```powershell
|
|
114
|
-
$env:SLACK_BOT_TOKEN="xoxb-..."
|
|
115
|
-
$env:SLACK_APP_TOKEN="xapp-..."
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Verify your Slack setup before starting:
|
|
119
|
-
|
|
120
|
-
**Bash & PowerShell:**
|
|
121
|
-
```bash
|
|
122
|
-
npx -y hivecode-mcp@latest slack check --channel <channel-id>
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### What Success Looks Like
|
|
126
|
-
```
|
|
127
|
-
✓ token: @Hivecode (U0123456789)
|
|
128
|
-
✓ workspace: YourTeam (T0123456789)
|
|
129
|
-
✓ channel: #dev-feed (C0123456789, member)
|
|
130
|
-
✓ scopes (outbound + inbound): chat:write, channels:read, groups:read, channels:history, groups:history, users:read
|
|
131
|
-
✓ Socket Mode: connected
|
|
132
|
-
This posts one message in #dev-feed (and one reply in its thread)
|
|
133
|
-
✓ replies reach Hivecode
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### Likely Failure & Fix
|
|
137
|
-
```
|
|
138
|
-
Q631 @Hivecode is not a member of #dev-feed (C0123456789). In Slack, open #dev-feed and run: /invite @Hivecode
|
|
139
|
-
```
|
|
140
|
-
**Fix:** Open the channel in Slack and type `/invite @Hivecode`.
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## Step 5: Start the GitHub Watcher
|
|
145
|
-
|
|
146
|
-
To inspect all available watcher options and flags (exits 0):
|
|
147
|
-
```bash
|
|
148
|
-
npx -y hivecode-mcp@latest github --help
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### 1. Test with a Dry Run First
|
|
152
|
-
Verify permissions and agent configuration without modifying your repository:
|
|
153
|
-
|
|
154
|
-
**Bash:**
|
|
155
|
-
```bash
|
|
156
|
-
npx -y hivecode-mcp@latest github start --dry-run \
|
|
157
|
-
--agent "claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode"
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
**PowerShell:**
|
|
161
|
-
```powershell
|
|
162
|
-
npx -y hivecode-mcp@latest github start --dry-run `
|
|
163
|
-
--agent 'claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode'
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
#### What Success Looks Like
|
|
167
|
-
```
|
|
168
|
-
Dry run: reading GitHub once. Nothing is written anywhere.
|
|
169
|
-
created the label "hivecode"
|
|
170
|
-
claude can use Hivecode (its hivecode MCP server: Connected).
|
|
171
|
-
Dry run done: no open issue is labelled "hivecode". Nothing was written.
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### 2. Start the Live Watcher
|
|
175
|
-
Once the dry run succeeds, start the live watcher.
|
|
176
|
-
|
|
177
|
-
**Bash (standalone):**
|
|
178
|
-
```bash
|
|
179
|
-
npx -y hivecode-mcp@latest github start \
|
|
180
|
-
--agent "claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode"
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
**PowerShell (standalone):**
|
|
184
|
-
```powershell
|
|
185
|
-
npx -y hivecode-mcp@latest github start `
|
|
186
|
-
--agent 'claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode'
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
**With Slack Integration:**
|
|
190
|
-
|
|
191
|
-
**Bash:**
|
|
192
|
-
```bash
|
|
193
|
-
npx -y hivecode-mcp@latest github start \
|
|
194
|
-
--agent "claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode" \
|
|
195
|
-
--slack-channel <channel-id> \
|
|
196
|
-
--slack-allow <user-id>
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
**PowerShell:**
|
|
200
|
-
```powershell
|
|
201
|
-
npx -y hivecode-mcp@latest github start `
|
|
202
|
-
--agent 'claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode' `
|
|
203
|
-
--slack-channel <channel-id> `
|
|
204
|
-
--slack-allow <user-id>
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
#### What Success Looks Like
|
|
208
|
-
```
|
|
209
|
-
Hivecode is watching <owner>/<repo> for issues labelled "hivecode". Ctrl+C stops it.
|
|
210
|
-
```
|
|
211
|
-
With Slack enabled:
|
|
212
|
-
```
|
|
213
|
-
Slack: `stop` in an issue's thread stops it; `retry` works for <user-id>.
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### Likely Failure & Fix
|
|
217
|
-
- If the agent lacks the MCP server:
|
|
218
|
-
```
|
|
219
|
-
Q602 claude has no hivecode MCP server, so it cannot join a room: every run would fail after spending tokens.
|
|
220
|
-
Run: npx -y hivecode-mcp@latest setup
|
|
221
|
-
(or --skip-agent-check if it is set up under another name).
|
|
222
|
-
```
|
|
223
|
-
**Fix:** Run `npx -y hivecode-mcp@latest setup` and restart your terminal.
|
|
224
|
-
- If `--allowedTools` is missing `mcp__hivecode`:
|
|
225
|
-
```
|
|
226
|
-
Q602 the agent command passes --allowedTools without mcp__hivecode, so it may not call hive_join and every run would fail after spending tokens. Add mcp__hivecode to its --allowedTools.
|
|
227
|
-
```
|
|
228
|
-
**Fix:** Include `mcp__hivecode` in the `--allowedTools` list.
|
|
229
|
-
|
|
230
|
-
---
|
|
231
|
-
|
|
232
|
-
## Step 6: Label an Issue, Observe, and Stop
|
|
233
|
-
|
|
234
|
-
### 1. Label an Issue
|
|
235
|
-
Open an issue on GitHub and add the `hivecode` label.
|
|
236
|
-
|
|
237
|
-
### 2. What You See
|
|
238
|
-
- **In your terminal:**
|
|
239
|
-
```
|
|
240
|
-
<HH:MM:SS> #12: queued (labelled by <user>)
|
|
241
|
-
<HH:MM:SS> #12: run 1 of 6 started (build) in room <room-id>
|
|
242
|
-
<HH:MM:SS> #12: pull request #13 opened
|
|
243
|
-
```
|
|
244
|
-
- **On the GitHub Issue:**
|
|
245
|
-
Hivecode comments immediately upon claiming:
|
|
246
|
-
```
|
|
247
|
-
Hivecode is working on this. The pull request will be linked here when it is ready.
|
|
248
|
-
|
|
249
|
-
To stop, remove the `hivecode` label or comment `/hivecode stop`.
|
|
250
|
-
```
|
|
251
|
-
- **On the Pull Request:**
|
|
252
|
-
Hivecode creates a pull request linked to `#12` containing:
|
|
253
|
-
- A summary of what the agent changed.
|
|
254
|
-
- The test command executed and its output.
|
|
255
|
-
- A table of commits with the agent named as author and a signed trailer.
|
|
256
|
-
- **In Slack (if enabled):**
|
|
257
|
-
A dedicated thread opens for the issue posting progress milestones and the pull request link.
|
|
258
|
-
|
|
259
|
-
### 3. How to Stop
|
|
260
|
-
You can cancel an in-progress run or watcher at any time:
|
|
261
|
-
- **On GitHub:** Remove the `hivecode` label from the issue, or post a comment containing `/hivecode stop`.
|
|
262
|
-
- **In Slack:** Reply `stop` in the issue's Slack thread.
|
|
263
|
-
- **In your terminal:** Press `Ctrl+C`. The watcher halts gracefully:
|
|
264
|
-
```
|
|
265
|
-
<HH:MM:SS> stopping: ending the runs in progress
|
|
266
|
-
```
|
|
1
|
+
# Quickstart: Zero to a Pull Request in 10 Minutes
|
|
2
|
+
|
|
3
|
+
Connect an AI coding agent to your GitHub repository so that adding a `hivecode` label to an issue runs the agent in an isolated workspace and opens a tested pull request.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Step 1: Prerequisites
|
|
8
|
+
|
|
9
|
+
Ensure you have the following installed on your machine:
|
|
10
|
+
|
|
11
|
+
1. **Node.js** (`>=18`, per `package.json` engines):
|
|
12
|
+
```bash
|
|
13
|
+
node -v
|
|
14
|
+
```
|
|
15
|
+
2. **GitHub CLI** (`gh`):
|
|
16
|
+
```bash
|
|
17
|
+
gh --version
|
|
18
|
+
```
|
|
19
|
+
If missing, install it from [cli.github.com](https://cli.github.com).
|
|
20
|
+
3. **An AI coding agent CLI** (such as Claude Code):
|
|
21
|
+
```bash
|
|
22
|
+
claude --version
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Step 2: Configure Your Agent (`setup`)
|
|
28
|
+
|
|
29
|
+
Run `setup` to install the runtime and configure the `hivecode` MCP server into your agent apps:
|
|
30
|
+
|
|
31
|
+
**Bash & PowerShell:**
|
|
32
|
+
```bash
|
|
33
|
+
npx -y hivecode-mcp@latest setup
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### What Success Looks Like
|
|
37
|
+
`setup` verifies each agent by performing an MCP handshake with its configuration:
|
|
38
|
+
```
|
|
39
|
+
Claude Code READY configured in ~/.claude.json (starts in 0.3s)
|
|
40
|
+
stop gate added to ~/.claude/settings.json: in a room, Claude Code is not let end a turn with no listener running
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Likely Failure & Fix
|
|
44
|
+
If an agent configuration file cannot be updated:
|
|
45
|
+
```
|
|
46
|
+
Claude Code FAILED ~/.claude.json
|
|
47
|
+
written, but it does not start: <error>
|
|
48
|
+
```
|
|
49
|
+
**Fix:** Add the `hivecode` server entry by hand to your agent's MCP settings:
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"hivecode": {
|
|
54
|
+
"command": "node",
|
|
55
|
+
"args": ["<path-to-runtime>/hive-mcp.js"]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Step 3: Authenticate with GitHub (`gh auth login`)
|
|
64
|
+
|
|
65
|
+
Run this inside your local clone of the repository you want to watch:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
gh auth login
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Follow the interactive prompts to log in via your browser.
|
|
72
|
+
|
|
73
|
+
### What Success Looks Like
|
|
74
|
+
`gh` confirms you're logged in and displays your active account.
|
|
75
|
+
|
|
76
|
+
### Likely Failure & Fix
|
|
77
|
+
If `gh` is not logged in, network is down, or you run outside a repository:
|
|
78
|
+
- `Q600 gh is not logged in on this machine. Run: gh auth login (or set GH_TOKEN)`
|
|
79
|
+
**Fix:** Complete `gh auth login` or set `GH_TOKEN`.
|
|
80
|
+
- `Q601 GitHub has no repository <owner>/<repo> that <login> can see (HTTP 404). Check origin (<url>); a private repo needs an account with access to it (gh auth status shows which one gh uses).`
|
|
81
|
+
**Fix:** Verify `git remote -v` points to the intended repository, and confirm `gh auth status` shows an account with read access to it.
|
|
82
|
+
- `Q601 <cwd> is not inside a git repository. Run this in your clone of the repo.`
|
|
83
|
+
**Fix:** `cd` into your git clone before running.
|
|
84
|
+
- `Q601 origin (<url>) is not a github.com repository.`
|
|
85
|
+
**Fix:** Verify `git remote -v` points to GitHub.
|
|
86
|
+
- `Q601 the GitHub account gh is logged in as cannot push to <owner>/<repo>.`
|
|
87
|
+
**Fix:** Ensure your GitHub account has write permissions to push branches.
|
|
88
|
+
- `Q603 could not reach GitHub for <endpoint>: <error>`
|
|
89
|
+
**Fix:** Check your network connection to `github.com`.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Step 4 (Optional): Connect Slack
|
|
94
|
+
|
|
95
|
+
To receive per-issue progress updates and stop runs directly from Slack:
|
|
96
|
+
|
|
97
|
+
1. Create a Slack app at [api.slack.com/apps](https://api.slack.com/apps) by selecting **From a manifest** and pasting [`slack-app-manifest-inbound.json`](../slack-app-manifest-inbound.json).
|
|
98
|
+
2. Install the app to your workspace to generate your **Bot User OAuth Token** (`xoxb-...`).
|
|
99
|
+
3. Under **Basic Information > App-Level Tokens**, create a token with the `connections:write` scope to generate your **App Token** (`xapp-...`).
|
|
100
|
+
4. In Slack, invite the bot to your channel: `/invite @Hivecode`.
|
|
101
|
+
|
|
102
|
+
> **One Slack app per process:** Each process that reads Slack (e.g. `github start --slack-allow`, `slack start`, or `hive-slack-agent`) needs its own dedicated Slack app and App Token (`xapp-...`). Slack Socket Mode distributes incoming messages across all active connections on the same token without channel routing; sharing an app between the watcher and a room bridge will cause stop commands and thread replies to split between the two processes (`Q635`).
|
|
103
|
+
|
|
104
|
+
Set the tokens in your shell:
|
|
105
|
+
|
|
106
|
+
**Bash:**
|
|
107
|
+
```bash
|
|
108
|
+
export SLACK_BOT_TOKEN="xoxb-..."
|
|
109
|
+
export SLACK_APP_TOKEN="xapp-..."
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**PowerShell:**
|
|
113
|
+
```powershell
|
|
114
|
+
$env:SLACK_BOT_TOKEN="xoxb-..."
|
|
115
|
+
$env:SLACK_APP_TOKEN="xapp-..."
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Verify your Slack setup before starting:
|
|
119
|
+
|
|
120
|
+
**Bash & PowerShell:**
|
|
121
|
+
```bash
|
|
122
|
+
npx -y hivecode-mcp@latest slack check --channel <channel-id>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### What Success Looks Like
|
|
126
|
+
```
|
|
127
|
+
✓ token: @Hivecode (U0123456789)
|
|
128
|
+
✓ workspace: YourTeam (T0123456789)
|
|
129
|
+
✓ channel: #dev-feed (C0123456789, member)
|
|
130
|
+
✓ scopes (outbound + inbound): chat:write, channels:read, groups:read, channels:history, groups:history, users:read
|
|
131
|
+
✓ Socket Mode: connected
|
|
132
|
+
This posts one message in #dev-feed (and one reply in its thread)
|
|
133
|
+
✓ replies reach Hivecode
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Likely Failure & Fix
|
|
137
|
+
```
|
|
138
|
+
Q631 @Hivecode is not a member of #dev-feed (C0123456789). In Slack, open #dev-feed and run: /invite @Hivecode
|
|
139
|
+
```
|
|
140
|
+
**Fix:** Open the channel in Slack and type `/invite @Hivecode`.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Step 5: Start the GitHub Watcher
|
|
145
|
+
|
|
146
|
+
To inspect all available watcher options and flags (exits 0):
|
|
147
|
+
```bash
|
|
148
|
+
npx -y hivecode-mcp@latest github --help
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 1. Test with a Dry Run First
|
|
152
|
+
Verify permissions and agent configuration without modifying your repository:
|
|
153
|
+
|
|
154
|
+
**Bash:**
|
|
155
|
+
```bash
|
|
156
|
+
npx -y hivecode-mcp@latest github start --dry-run \
|
|
157
|
+
--agent "claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**PowerShell:**
|
|
161
|
+
```powershell
|
|
162
|
+
npx -y hivecode-mcp@latest github start --dry-run `
|
|
163
|
+
--agent 'claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode'
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### What Success Looks Like
|
|
167
|
+
```
|
|
168
|
+
Dry run: reading GitHub once. Nothing is written anywhere.
|
|
169
|
+
created the label "hivecode"
|
|
170
|
+
claude can use Hivecode (its hivecode MCP server: Connected).
|
|
171
|
+
Dry run done: no open issue is labelled "hivecode". Nothing was written.
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### 2. Start the Live Watcher
|
|
175
|
+
Once the dry run succeeds, start the live watcher.
|
|
176
|
+
|
|
177
|
+
**Bash (standalone):**
|
|
178
|
+
```bash
|
|
179
|
+
npx -y hivecode-mcp@latest github start \
|
|
180
|
+
--agent "claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**PowerShell (standalone):**
|
|
184
|
+
```powershell
|
|
185
|
+
npx -y hivecode-mcp@latest github start `
|
|
186
|
+
--agent 'claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode'
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**With Slack Integration:**
|
|
190
|
+
|
|
191
|
+
**Bash:**
|
|
192
|
+
```bash
|
|
193
|
+
npx -y hivecode-mcp@latest github start \
|
|
194
|
+
--agent "claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode" \
|
|
195
|
+
--slack-channel <channel-id> \
|
|
196
|
+
--slack-allow <user-id>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**PowerShell:**
|
|
200
|
+
```powershell
|
|
201
|
+
npx -y hivecode-mcp@latest github start `
|
|
202
|
+
--agent 'claude -p --output-format json --allowedTools Bash Edit Write Read Glob Grep mcp__hivecode' `
|
|
203
|
+
--slack-channel <channel-id> `
|
|
204
|
+
--slack-allow <user-id>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
#### What Success Looks Like
|
|
208
|
+
```
|
|
209
|
+
Hivecode is watching <owner>/<repo> for issues labelled "hivecode". Ctrl+C stops it.
|
|
210
|
+
```
|
|
211
|
+
With Slack enabled:
|
|
212
|
+
```
|
|
213
|
+
Slack: `stop` in an issue's thread stops it; `retry` works for <user-id>.
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Likely Failure & Fix
|
|
217
|
+
- If the agent lacks the MCP server:
|
|
218
|
+
```
|
|
219
|
+
Q602 claude has no hivecode MCP server, so it cannot join a room: every run would fail after spending tokens.
|
|
220
|
+
Run: npx -y hivecode-mcp@latest setup
|
|
221
|
+
(or --skip-agent-check if it is set up under another name).
|
|
222
|
+
```
|
|
223
|
+
**Fix:** Run `npx -y hivecode-mcp@latest setup` and restart your terminal.
|
|
224
|
+
- If `--allowedTools` is missing `mcp__hivecode`:
|
|
225
|
+
```
|
|
226
|
+
Q602 the agent command passes --allowedTools without mcp__hivecode, so it may not call hive_join and every run would fail after spending tokens. Add mcp__hivecode to its --allowedTools.
|
|
227
|
+
```
|
|
228
|
+
**Fix:** Include `mcp__hivecode` in the `--allowedTools` list.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Step 6: Label an Issue, Observe, and Stop
|
|
233
|
+
|
|
234
|
+
### 1. Label an Issue
|
|
235
|
+
Open an issue on GitHub and add the `hivecode` label.
|
|
236
|
+
|
|
237
|
+
### 2. What You See
|
|
238
|
+
- **In your terminal:**
|
|
239
|
+
```
|
|
240
|
+
<HH:MM:SS> #12: queued (labelled by <user>)
|
|
241
|
+
<HH:MM:SS> #12: run 1 of 6 started (build) in room <room-id>
|
|
242
|
+
<HH:MM:SS> #12: pull request #13 opened
|
|
243
|
+
```
|
|
244
|
+
- **On the GitHub Issue:**
|
|
245
|
+
Hivecode comments immediately upon claiming:
|
|
246
|
+
```
|
|
247
|
+
Hivecode is working on this. The pull request will be linked here when it is ready.
|
|
248
|
+
|
|
249
|
+
To stop, remove the `hivecode` label or comment `/hivecode stop`.
|
|
250
|
+
```
|
|
251
|
+
- **On the Pull Request:**
|
|
252
|
+
Hivecode creates a pull request linked to `#12` containing:
|
|
253
|
+
- A summary of what the agent changed.
|
|
254
|
+
- The test command executed and its output.
|
|
255
|
+
- A table of commits with the agent named as author and a signed trailer.
|
|
256
|
+
- **In Slack (if enabled):**
|
|
257
|
+
A dedicated thread opens for the issue posting progress milestones and the pull request link.
|
|
258
|
+
|
|
259
|
+
### 3. How to Stop
|
|
260
|
+
You can cancel an in-progress run or watcher at any time:
|
|
261
|
+
- **On GitHub:** Remove the `hivecode` label from the issue, or post a comment containing `/hivecode stop`.
|
|
262
|
+
- **In Slack:** Reply `stop` in the issue's Slack thread.
|
|
263
|
+
- **In your terminal:** Press `Ctrl+C`. The watcher halts gracefully:
|
|
264
|
+
```
|
|
265
|
+
<HH:MM:SS> stopping: ending the runs in progress
|
|
266
|
+
```
|