@drewpayment/mink 0.4.0 → 0.5.0
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/README.md +155 -0
- package/dist/cli.js +972 -298
- package/package.json +1 -1
- package/src/cli.ts +13 -0
- package/src/commands/channel.ts +252 -0
- package/src/core/channel-process.ts +274 -0
- package/src/core/channel-templates.ts +156 -0
- package/src/core/daemon.ts +63 -2
- package/src/core/paths.ts +8 -0
- package/src/types/channel.ts +16 -0
- package/src/types/config.ts +32 -0
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ Mink intercepts these lifecycle events and maintains structured state so the ass
|
|
|
21
21
|
- **Advise on frameworks** with a decision tree and migration guides
|
|
22
22
|
- **Build a cross-project wiki** that accumulates knowledge across all your projects
|
|
23
23
|
- **Capture notes from anywhere** with an AI-powered Claude Code skill that categorizes, tags, and links notes automatically
|
|
24
|
+
- **Chat with Mink from Discord** — DM your bot to capture, search, and summarize your wiki from anywhere via Claude Code Channels
|
|
24
25
|
- **Sync across machines** with git-backed `~/.mink` syncing — auto-pull on session start, auto-push on session stop
|
|
25
26
|
|
|
26
27
|
## How It Works
|
|
@@ -73,6 +74,12 @@ All state lives in `~/.mink/` -- nothing is stored in your project repository.
|
|
|
73
74
|
- **External Linking** — Symlink external notes directories into the vault for a unified Obsidian experience
|
|
74
75
|
- **Templates** — 6 built-in templates (quick-capture, daily, meeting, project, area, person)
|
|
75
76
|
|
|
77
|
+
### Discord Companion
|
|
78
|
+
- **Conversational interface** — DM your bot on Discord to capture notes, search the vault, and get daily summaries
|
|
79
|
+
- **Always-on** — runs Claude Code inside a detached GNU screen session that survives terminal closes
|
|
80
|
+
- **CLAUDE.md-driven persona** — the bot's behavior is configured by a markdown file in the vault, not code
|
|
81
|
+
- **Unattended mode** — optional `--dangerously-skip-permissions` bypasses terminal prompts so the bot works entirely from Discord
|
|
82
|
+
|
|
76
83
|
### Advanced
|
|
77
84
|
- **Design Evaluation** — Automated multi-viewport screenshot capture with server and route detection (uses Puppeteer)
|
|
78
85
|
- **Framework Advisor** — Decision tree, framework catalog, comparison matrix, and migration prompts for UI framework selection
|
|
@@ -272,6 +279,154 @@ mink wiki unlink notes
|
|
|
272
279
|
|
|
273
280
|
Open `~/.mink/wiki/` as your Obsidian vault and you'll see Mink's generated content (projects, patterns, inbox) alongside your own notes — with `[[wikilinks]]` working across both.
|
|
274
281
|
|
|
282
|
+
## Discord Companion
|
|
283
|
+
|
|
284
|
+
DM your bot on Discord to capture notes, search the vault, and get summaries — with the Claude Code session running on your own machine against your own wiki.
|
|
285
|
+
|
|
286
|
+
This uses [Claude Code Channels](https://code.claude.com/docs/en/channels) to push Discord messages into a running Claude Code session. The session launches inside a detached GNU screen with a preloaded `CLAUDE.md` that makes Claude behave as a knowledge companion. Nothing is hosted; the bot is just you talking to Claude on your laptop.
|
|
287
|
+
|
|
288
|
+
### Prerequisites
|
|
289
|
+
|
|
290
|
+
- [Claude Code](https://claude.ai/code) v2.1.80+ signed in with a `claude.ai` account (Console/API-key auth is not supported by Channels)
|
|
291
|
+
- [Bun](https://bun.sh/) (required by the Discord channel plugin)
|
|
292
|
+
- `screen` (pre-installed on macOS; `sudo apt install screen` on Linux)
|
|
293
|
+
- An initialized vault: `mink wiki init`
|
|
294
|
+
|
|
295
|
+
### Step-by-step setup
|
|
296
|
+
|
|
297
|
+
**1. Create a Discord bot**
|
|
298
|
+
|
|
299
|
+
In the [Discord Developer Portal](https://discord.com/developers/applications):
|
|
300
|
+
|
|
301
|
+
1. Click **New Application** and give it a name
|
|
302
|
+
2. Open the **Bot** page → click **Reset Token** → copy the token somewhere safe
|
|
303
|
+
3. On the same page, scroll to **Privileged Gateway Intents** and enable **Message Content Intent** (required — without this the bot receives empty messages)
|
|
304
|
+
|
|
305
|
+
**2. Invite the bot to a server**
|
|
306
|
+
|
|
307
|
+
Still in the Developer Portal:
|
|
308
|
+
|
|
309
|
+
1. Go to **OAuth2 → URL Generator**
|
|
310
|
+
2. Set **Integration Type** to **Guild Install** (not *User Install* — `bot` scope is only valid for Guild Install)
|
|
311
|
+
3. Check scope: **bot**
|
|
312
|
+
4. Check bot permissions: **View Channels**, **Send Messages**, **Send Messages in Threads**, **Read Message History**, **Attach Files**, **Add Reactions**
|
|
313
|
+
5. Open the generated URL in your browser and invite the bot to a server
|
|
314
|
+
|
|
315
|
+
> To DM the bot privately, create a personal server first (Discord → `+` icon → **Create My Own** → *For me and my friends*). Guild-Install bots can receive DMs from any user who shares a server with them.
|
|
316
|
+
|
|
317
|
+
**3. Install the Discord channel plugin in Claude Code (one time)**
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
claude
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Inside Claude Code:
|
|
324
|
+
|
|
325
|
+
```
|
|
326
|
+
/plugin install discord@claude-plugins-official
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Wait for the confirmation, then exit Claude Code.
|
|
330
|
+
|
|
331
|
+
**4. Save the bot token in mink**
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
mink channel setup discord --token YOUR_BOT_TOKEN
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Running `mink channel setup discord` without `--token` prints the full instructions above for reference. The token is stored in `~/.mink/config.local` (machine-scoped — it won't sync to other machines).
|
|
338
|
+
|
|
339
|
+
**5. Start the channel**
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
mink channel start
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
This:
|
|
346
|
+
|
|
347
|
+
- Writes `~/.mink/wiki/CLAUDE.md` (the companion personality) if it doesn't already exist
|
|
348
|
+
- Launches Claude Code with `--channels plugin:discord@claude-plugins-official --dangerously-skip-permissions` inside a detached GNU screen session named `mink-channel-discord`
|
|
349
|
+
|
|
350
|
+
**6. Pair your Discord account**
|
|
351
|
+
|
|
352
|
+
1. DM your bot on Discord (any message)
|
|
353
|
+
2. The bot replies with a pairing code
|
|
354
|
+
3. Attach to the session so you can type into Claude Code:
|
|
355
|
+
```bash
|
|
356
|
+
mink channel attach
|
|
357
|
+
```
|
|
358
|
+
4. Inside the attached session, run:
|
|
359
|
+
```
|
|
360
|
+
/discord:access pair YOUR_PAIRING_CODE
|
|
361
|
+
/discord:access policy allowlist
|
|
362
|
+
```
|
|
363
|
+
5. Detach with **Ctrl-a** then **d** (don't exit — detach keeps the session running)
|
|
364
|
+
|
|
365
|
+
You're done. DM your bot from anywhere.
|
|
366
|
+
|
|
367
|
+
### Daily use
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
mink channel status # running? uptime? session name?
|
|
371
|
+
mink channel logs # recent Claude Code output (via screen hardcopy)
|
|
372
|
+
mink channel attach # jump into the live session; detach with Ctrl-a d
|
|
373
|
+
mink channel stop # end the session
|
|
374
|
+
mink channel start # start it again (e.g. after a reboot)
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Example conversations
|
|
378
|
+
|
|
379
|
+
From Discord:
|
|
380
|
+
|
|
381
|
+
- **Capture** — "Save a note — the auth migration is blocked on new compliance requirements from legal."
|
|
382
|
+
- **Daily** — "Add to my daily: shipped the config refactor, PR #42 is up."
|
|
383
|
+
- **Meeting** — "Meeting with Sarah about Q3 roadmap — discussed prioritizing the mobile SDK, 6-week timeline."
|
|
384
|
+
- **Search** — "What did I write about the auth migration?"
|
|
385
|
+
- **Summary** — "What did I work on this week?"
|
|
386
|
+
|
|
387
|
+
The companion `CLAUDE.md` tells Claude to categorize, tag with existing vocabulary, add `[[wikilinks]]`, and reply briefly.
|
|
388
|
+
|
|
389
|
+
### Customizing the bot's personality
|
|
390
|
+
|
|
391
|
+
The bot's behavior lives in `~/.mink/wiki/CLAUDE.md` — pure markdown, no code. Edit it to adjust tone, add behavioral rules, or include project-specific context. Changes take effect on the next `mink channel start`.
|
|
392
|
+
|
|
393
|
+
Mink never overwrites an existing `CLAUDE.md`. To refresh from the built-in template after a mink upgrade:
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
rm ~/.mink/wiki/CLAUDE.md
|
|
397
|
+
mink channel start
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
### Configuration
|
|
401
|
+
|
|
402
|
+
| Setting | Default | Scope | Description |
|
|
403
|
+
|---------|---------|-------|-------------|
|
|
404
|
+
| `channel.discord.bot-token` | — | local | Discord bot token (saved by `mink channel setup`) |
|
|
405
|
+
| `channel.discord.enabled` | `false` | local | Auto-start the channel when `mink daemon start` runs |
|
|
406
|
+
| `channel.default-platform` | `discord` | shared | Platform when `mink channel start` is run without an argument |
|
|
407
|
+
| `channel.skip-permissions` | `true` | shared | Pass `--dangerously-skip-permissions` so the bot runs unattended |
|
|
408
|
+
|
|
409
|
+
Change any value with `mink config <key> <value>`.
|
|
410
|
+
|
|
411
|
+
### Security model
|
|
412
|
+
|
|
413
|
+
- **Sender allowlist** — After pairing and running `/discord:access policy allowlist`, only your Discord account can push messages to the bot. Everyone else is silently dropped.
|
|
414
|
+
- **Local execution** — The Claude Code session runs entirely on your own machine. Nothing is hosted.
|
|
415
|
+
- **Skip-permissions trade-off** — With `channel.skip-permissions` on (default), Claude does not prompt before tool calls. Combined with the sender allowlist this is fine for personal use; turn it off with `mink config channel.skip-permissions false` if you want each tool call approved via `mink channel attach`.
|
|
416
|
+
- **Scope** — The companion `CLAUDE.md` tells Claude to stay focused on vault/mink operations and not edit source code.
|
|
417
|
+
|
|
418
|
+
### Troubleshooting
|
|
419
|
+
|
|
420
|
+
- **"channel session died immediately after starting"** — Usually `claude` isn't on your PATH, or the Discord plugin isn't installed. Run `which claude` and verify step 3 (`/plugin install discord@claude-plugins-official`) was completed. To see the underlying error, run the command manually:
|
|
421
|
+
```bash
|
|
422
|
+
cd ~/.mink/wiki && claude --channels plugin:discord@claude-plugins-official
|
|
423
|
+
```
|
|
424
|
+
- **Bot doesn't respond to DMs** — Make sure you share a server with it (Guild-Install bots can only DM users who share a server) and that **Message Content Intent** is enabled in the Developer Portal.
|
|
425
|
+
- **`Input must be provided either through stdin...`** in logs — The Claude Code session has no TTY. The `mink channel` commands spawn through GNU screen to avoid this; if you see it, check that `screen` is on PATH.
|
|
426
|
+
- **Permission prompts stall the bot** — Ensure `mink config channel.skip-permissions` is `true` (the default). Apply after a restart: `mink channel stop && mink channel start`.
|
|
427
|
+
- **Token rotated or invalid** — Re-run `mink channel setup discord --token NEW_TOKEN`, then restart the channel.
|
|
428
|
+
- **Colors look washed out when you `mink channel attach`** — mink starts screen with `-T screen-256color` so Claude Code renders at 256-color depth. If you still see muted output, verify your terminfo database has the entry: `infocmp screen-256color`. If truecolor escape codes look garbled (common on very old GNU screen versions like macOS's bundled 4.00.03), restart the channel with `COLORTERM` unset so Claude falls back to 256-color mode: `mink channel stop && env -u COLORTERM mink channel start`.
|
|
429
|
+
|
|
275
430
|
## Sync
|
|
276
431
|
|
|
277
432
|
Mink can sync your entire `~/.mink` directory (wiki, config, project knowledge) across machines using git.
|