Skip to content

A lightweight FastAPI service that enables custom GPT agents to scan, read, write, and reason over GitHub repositories like a human software engineer.

Notifications You must be signed in to change notification settings

nomenarkt/gpt-gateway

Repository files navigation

GPT Gateway

Bridge GPTs and GitHub Repositories
This FastAPI service enables GPT Actions or external agents to list, read, write, and recursively scan the contents of a GitHub repository using clean OpenAPI definitions and a plugin manifest.


🌐 Live Endpoint

Base URL: https://nomena-gpt.xyz


🚀 Features

  • ✅ List files in a given path
  • ✅ Read the raw content of any file
  • ✅ Write/update files with commit messages
  • ✅ Recursively scan the repo tree
  • ✅ Plugin-compatible via .well-known/ai-plugin.json
  • ✅ Fully documented with OpenAPI (3.1)

📁 API Reference


🔐 GitHub Permissions

To function properly, your GitHub token must have the following scopes:

GitHub Permission Required
Contents ✅ Yes
Metadata ✅ Yes
Issues ✅ Optional (for future extension)
Pull requests ✅ Optional
Discussions ✅ Optional

Set your token as an environment variable (e.g., in .env):

export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxx

🧪 Running Tests (locally or CI)

We use pytest to test API endpoints with FastAPI's built-in TestClient.

  1. Install dependencies:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install pytest
  1. Run tests:
pytest

📦 Project Structure

.
├── actions/                   # FastAPI route modules
├── services/                  # GitHub API logic
├── .well-known/               # ai-plugin.json for GPT integration
├── openapi.yaml               # OpenAPI schema (GPT Action schema)
├── main.py                    # App entrypoint
└── test_main.py               # API test suite

🛠️ Deployment (Linode, or Any VPS)

  1. Clone this repository:

    git clone https://github.com/nomenarkt/gpt-gateway.git
    cd gpt-gateway
  2. Set up environment:

    • Place your .env with GITHUB_TOKEN in the root directory.
  3. Start the FastAPI server:

    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    uvicorn main:app --host 127.0.0.1 --port 8000
  4. (Optional) Use systemd or Supervisor for production hosting.

  5. Configure Nginx as a reverse proxy (see /etc/nginx/sites-available/default).


📫 Contact

For feedback or support, email: [email protected]

About

A lightweight FastAPI service that enables custom GPT agents to scan, read, write, and reason over GitHub repositories like a human software engineer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages