Skip to content

LuanBertozzi7/Yui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yui — Discord Knowledge Bot

Yui banner

A Discord bot that turns your messages into structured Markdown notes and commits them to a Git repository.

Send !learn ipv4 from anywhere. Get a well-structured .md file pushed to your notes repo — no manual writing required.


How it works

Discord message  →  Yui identifies the prefix
                          ↓
               Claude Code CLI generates the note
                          ↓
              git commit + push to your repo
                          ↓
              .md file sent back to Discord

Commands

Command What it generates
!learn <topic> Full knowledge note — concept, how it works, examples, comparisons
!quick <topic> Short note — concept + one practical example
!compare <a> vs <b> Comparison table focused on differences
!hands <topic> Hands-on note — commands, code, step-by-step
!why <topic> Historical context — why it exists, what problem it solves
!eli5 <topic> Explain like I'm 5 — analogies, zero jargon
!cheat <topic> Cheatsheet — most used commands/syntax
!bug <description> Bug diagnosis — causes, how to identify, fix, and prevent
!road <topic> Learning roadmap — suggested order, resources, milestones
!glossary <area> Glossary — key terms for an area
!idea <idea> Idea expansion — how it could work, risks, ramifications
!ask <question> Direct answer — no note generated, just a response

All notes include YAML frontmatter, typed wiki-links (part of, uses, similar to, leads to), and are ready for Obsidian.


Requirements

  • Node.js v18+
  • Claude Code CLI installed and authenticated on the machine running Yui
    npm install -g @anthropic-ai/claude-code
    claude  # authenticate once
  • A Discord bot token with Message Content Intent enabled
  • A Git repository for your notes with push access

Setup

1. Clone and install

git clone https://github.com/LuanBertozzi7/Yui.git
cd Yui
npm install

2. Configure environment

cp .env.example .env

Edit .env:

DISCORD_TOKEN=your_discord_bot_token
DISCORD_CHANNEL_IDS=channel_id_1,channel_id_2
INBOX_REPO_PATH=/path/to/your/notes/repo

DISCORD_CHANNEL_IDS accepts one or more channel IDs separated by commas.

3. Discord bot setup

  1. Go to Discord Developer Portal
  2. Create a new application → Bot
  3. Enable Message Content Intent under Bot → Privileged Gateway Intents
  4. Copy the token to DISCORD_TOKEN
  5. Invite the bot using OAuth2 → URL Generator with the permissions below

Required permissions

Permission Why
Read Messages / View Channels See incoming commands
Send Messages Reply with results
Attach Files Send the generated .md file
Read Message History Required alongside Read Messages

4. Run

node src/index.js

For persistent deployment:

npm install -g pm2
pm2 start src/index.js --name yui --cwd /path/to/Yui
pm2 save

Note structure

---
type: learn
created: 2026-05-10
categories: [networking]
---

# Topic Title

## Concept
...

## How it works
...

## Practical examples
...

## Connections
- part of: [[broader-area]]
- uses: [[dependency]]
- similar to: [[alternative]]
- leads to: [[next-concept]]

Roadmap

  • Native AI API support — replace Claude Code CLI dependency with direct API calls (Anthropic, OpenAI, or others). This would make Yui easier to deploy anywhere, with no CLI installation required.
  • Configurable note templates per prefix
  • Support for multiple output repositories

License

MIT

About

Discord bot that turns commands into structured Markdown notes, commits them to a git repo, and sends a PDF back in the channel.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors