Skip to content

mdnaimul22/GitManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitManager

Compose AI Agents from Distributed Repos β€” Automatically

Python FastAPI Tests License

Cherry-pick files and folders from multiple GitHub repos. Auto-sync upstream changes. Compose unified projects β€” zero manual effort.

The Problem Β· How It Works Β· Use Cases Β· Quick Start Β· API


GitManager Dashboard


🎯 The Problem

You're building an AI agent. The best skills, tools, and reference docs are scattered across 6 different GitHub repos from different authors. You need specific folders from each β€” not the whole repo.

Without GitManager:

1. git clone repo-A            ← manual
2. cp repo-A/skills/pytorch    ← manual
3. git clone repo-B            ← manual
4. cp repo-B/skills/security   ← manual
5. Repeat for 6 repos...       ← tedious
6. repo-A updates pytorch skill ← you never know
7. Your agent uses stale code   ← broken

With GitManager:

Configure once β†’ Auto-pull 6 repos β†’ Cherry-pick 35 paths β†’ Auto-commit & push β†’ Repeat on schedule

Upstream fixes a bug? Your project inherits it automatically. You remove a skill? GitManager deletes it from your repo and git history. All from a dashboard. No terminal needed.


βš™οΈ How It Works

flowchart LR
    subgraph Upstreams["Upstream Repos (GitHub)"]
        A["claude-skills"]
        B["chart-viz-skills"]
        C["engineering-skills"]
    end

    subgraph GM["GitManager"]
        Pull["β‘  git pull"]
        Forward["β‘‘ Cherry-pick paths"]
        Cleanup["β‘’ Orphan cleanup"]
        Push["β‘£ git commit + push"]
    end

    subgraph Target["Your Project"]
        Skills["skills/"]
        Config["configs/"]
    end

    A & B & C --> Pull --> Forward --> Cleanup --> Push --> Skills & Config
Loading
Step What Happens
β‘  Pull Clones or pulls latest from each upstream repo
β‘‘ Forward Copies only the folders/files you selected β€” not the whole repo
β‘’ Cleanup Removes orphaned paths when you delete a forwarding rule (including git rm)
β‘£ Push Auto-commits with smart messages and pushes to your repo

All steps run on a configurable schedule (e.g., every 10 minutes) in background worker threads.


πŸ’‘ Use Cases

πŸ€– AI Agent Composition (primary use case)

Aggregate skills from multiple AI skill repositories into a single unified agent:

alirezarezvani/claude-skills  β†’  skills/python-patterns
                                  skills/pytorch-patterns
                                  skills/security

anthropics/skills             β†’  skills/pdf
                                  skills/docx

your-own/custom-skills        β†’  skills/my-custom-tool

Result: One repo powers your AI agent with the best skills from across the ecosystem β€” always up to date.

πŸ“¦ Other Use Cases

Use Case How
Shared Config Sync Pull ESLint, Prettier, Dockerfile configs from a central standards repo into all your projects
Documentation Aggregation Collect /docs/ from multiple microservice repos into a single documentation site
Design System Distribution Sync UI components from a design system repo to multiple product repos
Open Source Curation Cherry-pick utilities from open source projects without forking entire repos
Multi-Vendor Integration Pull deliverables from vendor repos into your main project β€” auto-sync on updates

✨ Features

Feature Description
πŸ—‚οΈ Multi-Project Manage unlimited projects, each with its own upstreams, forwards, and schedule
πŸ”„ Live Upstream Sync Auto-pull or clone upstream repos β€” always track the latest changes
πŸ“ Selective Path Forwarding Cherry-pick specific folders/files β€” not the whole repo
🧹 Orphan Cleanup Remove a forward rule β†’ files are deleted from disk AND git index
⏰ Background Scheduler Per-project sync interval with hot-reload β€” config changes apply instantly
πŸ“Š Smart Commits Auto-generated commit messages grouped by upstream source

⚑ Quick Start

1. Clone and install

git clone https://github.com/mdnaimul22/GitManager.git
cd GitManager
pip install -r requirements.txt

2. Configure credentials

cp .env.example .env
GM_USERNAME=admin
GM_PASSWORD=your_secure_password
GM_SECRET_KEY=any_long_random_string

3. Run

python main.py

Open http://localhost:8000 β€” that's it. πŸŽ‰


πŸ” Step-by-Step Guide

1. Create a Project

Click + in the sidebar. Give it a name and the absolute path to your local Git repository.

2. Add Upstreams

For each source repository, define:

  • Name β€” a label (e.g., claude-skills)
  • URL β€” the GitHub clone URL
  • Branch β€” which branch to track (default: main)
  • Path β€” where to clone it locally

GitManager auto-clones on first run if the path doesn't exist.

3. Define Path Forwards

Select exactly which paths to copy from each upstream:

FROM: ~/.claude-skills/skills/python-patterns
  TO: ~/my-project/skills/python-patterns

Toggle individual forwards on/off without deleting them.

4. Run

Set the sync interval and click Run. The background worker handles everything automatically.


πŸ“ Architecture

GitManager/
β”œβ”€β”€ main.py                  # FastAPI server + graceful shutdown
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ config/              # Settings, paths, file utilities
β”‚   β”œβ”€β”€ schema/              # Pydantic models (single source of truth)
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ watcher.py       # Hot-reload config watcher (mtime-based)
β”‚   β”‚   β”œβ”€β”€ pool.py          # Background worker pool (per-project threads)
β”‚   β”‚   β”œβ”€β”€ rate_limiter.py  # Rate limiting + scanner auto-ban
β”‚   β”‚   └── resolver.py      # {REPO_ROOT} placeholder resolver
β”‚   β”œβ”€β”€ providers/
β”‚   β”‚   └── git.py           # Low-level git command wrapper
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ project.py       # Project CRUD (thread-safe)
β”‚   β”‚   β”œβ”€β”€ upstream.py      # Pull / clone upstream repos
β”‚   β”‚   β”œβ”€β”€ forward.py       # Selective copy + orphan cleanup + git rm
β”‚   β”‚   β”œβ”€β”€ commit.py        # Smart commit message generation
β”‚   β”‚   └── sync.py          # Full sync orchestrator
β”‚   └── routers/
β”‚       β”œβ”€β”€ auth.py          # HMAC-signed session auth
β”‚       └── projects.py      # REST API + worker control
β”œβ”€β”€ static/                  # Single-page dashboard (AlpineJS + 9 themes)
β”œβ”€β”€ data/                    # Per-project JSON config (gitignored)
└── tests/                   # 67 pytest tests

🌐 API Reference

All endpoints require session cookie authentication.

Method Endpoint Description
POST /api/auth/login Login with username & password
POST /api/auth/logout Clear session
GET /api/auth/check Validate current session
GET /api/projects List all projects
POST /api/projects Create a new project
GET /api/projects/{id} Get project with full config
PUT /api/projects/{id} Update project config
DELETE /api/projects/{id} Delete a project
POST /api/projects/{id}/run Start background sync worker
POST /api/projects/{id}/stop Stop background sync worker

πŸ§ͺ Testing

pytest tests/ -v
67 passed in 2.3s

Tests cover: authentication, project CRUD, worker control, rate limiting, orphan cleanup, incremental copy, hot-reload ordering, and config persistence.


πŸ”’ Security

  • Authentication: HMAC-SHA256 signed cookies β€” stateless, survives restarts
  • Rate Limiting: 60 req/min per IP β€” configurable
  • Scanner Detection: Auto-bans IPs probing for .env, .git, credentials (2 strikes β†’ 1hr ban)
  • Localhost Whitelist: 127.0.0.1, ::1, private subnets β€” prevents self-lockout
  • No Cloud: Runs entirely on your machine β€” your data never leaves

🀝 Contributing

  1. Fork the repository
  2. Branch: git checkout -b feature/your-feature
  3. Commit: Follow conventional commits (feat:, fix:, chore:)
  4. Test: pytest tests/ must pass
  5. PR: Open a Pull Request

πŸ“„ License

MIT License β€” free to use, modify, and distribute.


Built to solve a real problem β€” keeping AI agents alive with the latest skills from across the ecosystem.

If this solves your problem too, give it a ⭐ on GitHub!

About

Compose AI agents from distributed repos. Cherry-pick files from multiple GitHub repos, auto-sync upstream changes, forward selected paths -- all on a schedule with a dashboard.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors