GitMe is a Discord bot that watches your GitHub repositories. It tracks Commits, Pull Requests, and Issues, using LM Studio (Gemma) to:
- Analyze technical commit messages.
- Summarize changes into simple, layman terms locally.
- Post beautiful, color-coded notifications to your Discord channel.
- π Lightweight: Built with Node.js, Express, and Discord.js.
- π§ AI-Powered: Uses a local LLM via LM Studio to explain code changes without API costs.
- π Event Tracking:
- Commits: AI summaries, branch info, and commit hashes.
- Pull Requests: Notifications for Opened, Closed, Reopened, and Merged events.
- Issues: Notifications for Opened, Closed, and Reopened issues.
- π¨ Smart Embeds:
- Dynamic Colors: Green for Features/Opens, Red for Fixes/Closures, Purple for Merges.
- Rich Details: Includes author avatars, branch names, and truncated messages for readability.
- π‘οΈ Error Handling: Robust error handling for local API connection issues.
- π Modular Architecture: Professional structure with separate services, controllers, and config.
- Node.js (v18 or higher)
- Ngrok (to expose your local server to GitHub)
- A Discord Account & Server
- LM Studio (to run the local LLM)
git clone https://github.com/gubbysbyte/gitme.git
cd gitme
npm install- Rename
.env.exampleto.env. - Open
.envand fill in your keys:
DISCORD_TOKEN="your_bot_token_here"
DISCORD_CHANNEL_ID="your_channel_id_here"
LM_STUDIO_BASE_URL="http://localhost:1234/v1"
LM_STUDIO_MODEL="google/gemma-3-4b"
PORT=3000(Make sure to keep the quotes around the values!)
- DISCORD_TOKEN: Go to Discord Developer Portal -> New Application -> Bot -> Reset Token.
- DISCORD_CHANNEL_ID: In Discord app, go to User Settings -> Advanced -> Enable Developer Mode. Then right-click your target channel -> Copy ID.
- LM_STUDIO_BASE_URL: Usually
http://localhost:1234/v1(Default port for LM Studio). - LM_STUDIO_MODEL: The identifier of the model loaded in LM Studio (e.g.,
google/gemma-3-4b).
- In Discord Developer Portal -> OAuth2 -> URL Generator.
- Select Scopes:
bot. - Select Bot Permissions:
View Channels,Send Messages,Embed Links. - Copy the generated URL, open it in a browser, and invite the bot to your server.
First, start your local server. This runs the bot and listens for webhooks.
npm startIn a new terminal window, run ngrok to give your local server a public URL:
npx ngrok http 3000Copy the Forwarding URL (e.g., https://abcdef123.ngrok-free.app).
β οΈ Important: On the free ngrok plan, this URL changes every time you restart ngrok.
- Go to your GitHub Repository -> Settings -> Webhooks.
- Click Add webhook.
- Payload URL: Paste your ngrok URL and append
/webhookat the end.- Example:
https://abcdef123.ngrok-free.app/webhook
- Example:
- Content type: Select
application/json. - Which events?: Select Let me select individual events and check: Pushes, Pull requests, Issues.
- Click Add webhook.
- Make a change to a file in your repository.
- Commit and push:
git add . git commit -m "feat: testing the new bot" git push
- Check your Discord channel!
- You should see a message with "AI Summary".
You can also simulate a webhook without pushing to GitHub:
node tests/test-manual-events.js push
node tests/test-manual-events.js issue
node tests/test-manual-events.js prTest if your LM Studio integration is working correctly:
npm run test:gemma(Make sure LM Studio is running and the model is loaded!)
| Error | Cause | Solution |
|---|---|---|
| TokenInvalid | Empty .env or bad token |
Check .env file. Ensure values are in quotes "". |
| Missing Access | Bot not in channel/server | Invite bot to server. Give View Channel & Send Message permissions. |
| ECONNREFUSED | LM Studio server not running | Open LM Studio and ensure the Local Server is Started. |
| Model Not Found | Wrong model name in .env |
Ensure LM_STUDIO_MODEL matches the identifier in LM Studio. |
| Webhook 404 | Wrong URL in GitHub | Ensure Payload URL ends with /webhook (e.g., ...ngrok-free.app/webhook). |
Since Heroku is no longer free without a card, we use Render.com. To prevent the bot from sleeping after 15 minutes, use UptimeRobot.
- Push this code to GitHub.
- Log in to Render.com.
- New + -> Web Service.
- Connect your repo.
- Build Command:
npm install - Start Command:
npm start - Environment Variables: Add your keys (
DISCORD_TOKEN, etc). - Click Create Web Service.
- Copy your new Render URL (e.g.,
https://gitme-bot.onrender.com). - Go to UptimeRobot.com (Free account).
- Add New Monitor:
- Type: HTTP(s).
- Friendly Name: My GitMe Bot.
- URL: Paste your Render URL.
- Monitoring Interval: 5 minutes.
- Click Create Monitor.
Update your GitHub Webhook URL to:
https://gitme-bot.onrender.com/webhook
Contributions are welcome! Please read our Contributing Guide for details on how to get started.
Please note that this project has a Code of Conduct. By participating, you agree to abide by its terms.
To report a security vulnerability, please see our Security Policy.
See docs/CHANGELOG.md for a list of notable changes.
This project is licensed under the MIT License.