Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

185 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AOSSIE Gitcord

Β 

Static Badge

X (formerly Twitter) Badge Β Β  Discord Badge Β Β  LinkedIn Badge Β Β  AOSSIE Website Badge


Gitcord (Discord–GitHub Automation Engine)

Gitcord is a local, offline‑first automation engine that reads GitHub activity and Discord state, then plans role changes and GitHub assignments in a deterministic, reviewable way. It is designed for safety: dry‑run and observer modes produce audit reports without mutating anything.


πŸš€ Features

  • Offline‑first execution: run locally on demand, no daemon required.
  • Audit‑first workflow: JSON + Markdown reports before any writes.
  • Deterministic planning: identical inputs produce identical plans.
  • Permission‑aware IO: readers degrade safely on missing permissions.
  • Discord Bot: Interactive slash commands for identity linking, contributor profiles, metrics, and notifications.

πŸ’» Tech Stack

Backend

  • Python 3.11+
  • SQLite (local state)
  • Pydantic + PyYAML

βœ… Project Checklist

  • Audit-first workflow: reports generated for review.
  • Dry-run default: writes gated by mode and permissions.
  • Permission-limited operation: safe under missing permissions.

πŸ”— Repository Links

  1. Main Repository
  2. Installation Guide - Complete setup instructions (Docker and local)
  3. Environment Variables - .env reference
  4. Technical Documentation - Architecture and design
  5. Docker Guide - Docker setup and mentor-friendly deployment

πŸ—οΈ Architecture Diagram

Read -> Plan -> Report -> Apply

Core boundaries:

  • Readers are read‑only (GitHub/Discord ingestion).
  • Planners are pure, deterministic logic.
  • Writers are thin executors gated by MutationPolicy.

πŸ”„ User Flow

Load config -> Ingest -> Score -> Plan -> Audit -> (Optional) Apply

Key User Journeys

  1. Preflight check

    • Configure tokens and org
    • Run ghdcbot --config config/config.yaml validate
    • Fix any βœ— failures before continuing
  2. Dry‑run review

    • Run run-once in dry‑run mode
    • Review audit reports
  3. Observer mode

    • Run read‑only without write permissions
    • Produce audit output for reviewers

πŸ€ Getting Started

πŸ“– New to Gitcord? For complete step-by-step setup instructions including Discord bot creation and GitHub token setup, see INSTALLATION.md.

Prerequisites

Before installing Gitcord, you need:

  • βœ… GitHub Organization access
  • βœ… Discord Server with admin permissions
  • βœ… GitHub Personal Access Token (fine-grained PAT) - How to create
  • βœ… Discord Bot Token - How to create

Quick Start with Docker (recommended for mentors)

If you have Docker installed, you can skip Python setup and run Gitcord in one go:

git clone https://github.com/AOSSIE-Org/Gitcord-GithubDiscordBot.git
cd Gitcord-GithubDiscordBot
cp .env.example .env          # Add your GITHUB_TOKEN and DISCORD_TOKEN
cp config/docker-example.yaml config/config.yaml   # Set github.org and discord.guild_id
docker compose up -d
docker compose logs -f bot

The Discord bot stays running; SQLite data and reports persist in a Docker volume. To run a one-off sync (e.g. dry-run):
docker compose run --rm bot --config /app/config/config.yaml run-once

See docs/DOCKER.md for details, pitfalls, and audit-first workflow.

Quick Deployment (always-on)

For development and user testing, run Gitcord locally with Docker as described above. When the bot must stay online while your computer is off, deploy the same Compose setup to an always-on Linux host.

Linux VPS (recommended)

This works with Oracle Cloud Free Tier, a small VM from another provider, or your own always-on server. Gitcord does not accept inbound web traffic, so the VM only needs outbound HTTPS access plus SSH for administration.

  1. Create an Ubuntu/Debian VM, install Git, Docker Engine and the Compose plugin, then clone this repository.

  2. Create .env and config/config.yaml exactly as in the Docker quick start. Keep runtime.data_dir: "/data" so SQLite survives restarts.

  3. Validate the configuration, then start the bot and scheduled sync:

    docker compose run --rm bot --config /app/config/config.yaml validate
    docker compose --profile scheduler up -d --build
    docker compose ps
    docker compose logs -f bot sync-scheduler

Both services use restart: unless-stopped, and the named gitcord_data volume preserves identities, notification history, and sync cursors across container or VM restarts. The scheduler runs every six hours by default; set GITCORD_SYNC_INTERVAL_SECONDS in .env to change it.

For updates:

git pull
docker compose --profile scheduler up -d --build

Protect .env, restrict SSH access, and back up the gitcord_data volume. Never commit production tokens or config/config.yaml.

Fly.io and similar container platforms

Fly.io is possible, but the repository is not currently a one-command Fly deployment: its Compose file uses host networking and a local named volume. A Fly deployment must remove network_mode: host, provide secrets through fly secrets, mount a persistent volume at /data, and run the bot and scheduler without allowing overlapping syncs. Use a Linux VPS for the supported copy-and-run path until platform-specific deployment files are added.

Quick Setup Overview (local Python install)

1. Create GitHub Token (Detailed Guide)

  • Go to GitHub β†’ Settings β†’ Developer Settings β†’ Fine-grained tokens
  • Permissions: Contents (Read & Write), Issues (Read & Write), Pull requests (Read & Write)

2. Create Discord Bot (Detailed Guide)

3. Invite Bot to Server (Detailed Guide)

  • OAuth2 β†’ URL Generator
  • Scopes: bot, applications.commands
  • Permissions: Manage Roles, View Channels, Send Messages, Embed Links, Read Message History
  • ⚠️ Never use Administrator permission

4. Install Gitcord

1. Clone the Repository

git clone https://github.com/AOSSIE-Org/Gitcord-GithubDiscordBot.git
cd Gitcord-GithubDiscordBot

2. Install Dependencies

python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Full walkthrough: INSTALLATION.md.

5. Configure Environment Variables

Create a .env file (copy from .env.example):

GITHUB_TOKEN=your_github_token_here
DISCORD_TOKEN=your_discord_bot_token_here

6. Create Configuration File

Copy and edit:

cp config/example.yaml config/config.yaml

Edit config/config.yaml: set github.org, discord.guild_id, and runtime.data_dir: "./data". Match role_mappings to role names in your Discord server.

7. Test Run (Dry-Run Mode)

ghdcbot --config config/config.yaml run-once

This generates audit reports without making changes. Review data/reports/audit.md.

8. Run Discord Bot

ghdcbot --config config/config.yaml bot

Wait 30 seconds for commands to sync.

9. Enable Active Mode (After Testing)

  1. Dry-run (default): Run run-once with your config. The bot reads your guild’s members and roles, ingests GitHub activity, and writes audit reports. No roles are changed in Discord; check <data_dir>/reports/audit.md to see planned role add/remove actions.
  2. Live role updates: To have the bot actually add/remove roles in Discord, set in config/config.yaml:
    • runtime.mode: "active"
    • runtime.enable_discord_role_updates: true
    • discord.permissions.write: true Then run run-once again. Ensure the bot’s role in the server is above any roles it should assign (Server Settings β†’ Roles). See Testing in Discord and INSTALLATION.md for details.

πŸ€– Discord Bot Commands

Identity Linking

  • /link - Link your Discord account to GitHub (creates verification code)
  • /verify-link - Verify your GitHub link after adding code to bio/gist
  • /profile - Show contributor profile (GitHub, verification, socials, roles); optional Discord member
  • /unlink - Unlink your GitHub identity
  • /connect-social - Connect X or LinkedIn (enter your username or profile URL)
  • /disconnect-social - Disconnect X or LinkedIn from Gitcord

Contribution & Metrics

  • /summary - Show contribution metrics (7 and 30 days); optional Discord member for another verified contributor
  • /open-prs - List a contributor's currently open PRs in configured repos

Sync (mentor-only)

  • /sync - Manually sync GitHub events and send notifications

Note: /sync requires a mentor role configured in discord.command_permissions. The bot can also auto-detect PR URLs in configured channels and post passive previews.


πŸ“± App Screenshots

Not applicable (CLI automation engine).


πŸ™Œ Contributing

Thank you for considering contributing to this project! Contributions are highly appreciated and welcomed. To ensure smooth collaboration, please refer to our Contribution Guidelines.


✨ Maintainers

See contributors.


πŸ“ License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.


πŸ’ͺ Thanks To All Contributors

Thanks a lot for spending your time helping Gitcord grow. Keep rocking πŸ₯‚

Contributors

Β© 2026 AOSSIE

About

Gitcord is a Github Discord Bot

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Contributors

Languages