ghp

module
v0.0.0-...-66da7ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2026 License: MIT

README

ghp logo

ghp

GitHub Proxy for Autonomous Coding Agents

Issue scoped, auditable tokens to coding agents. Agents interact with GitHub through the proxy using opaque ghx_-prefixed tokens — they never see real GitHub credentials.

  • Agents use standard gh CLI, GitHub SDKs, or raw HTTP — no custom clients
  • Repository and permission scopes enforced at the proxy
  • Full audit trail of every proxied request
  • Single static Go binary, self-hosted for your team

Quick Start

Your administrator has already deployed ghp and configured DNS so that api.github.com and github.com resolve to the proxy on your network. You just need a token.

Option A: Web UI
  1. Open your team's ghp dashboard (e.g. https://ghp.example.com)
  2. Sign in with GitHub
  3. Click Create Token, choose a repository and scopes
  4. Copy the ghx_-prefixed token
Option B: CLI
ghp auth login
ghp token create --repo owner/repo --scope contents:read,pulls:write
Give the token to your agent
export GH_TOKEN=ghx_...

The agent now uses GitHub through the proxy with scoped permissions. No other configuration is needed — standard gh CLI, GitHub SDKs, and raw HTTP all work transparently.

Documentation

Topic Link
How it works Architecture & virtualhost routing
Server setup Installation & deployment
Configuration Full reference
CLI reference All commands
Web UI Dashboard & admin panel
Development Contributing & dev mode

Tip: Run mkdocs serve from the repository root to browse the full documentation site locally.

Directories

Path Synopsis
cmd
ghp command
Package main is the entrypoint for the ghp CLI.
Package main is the entrypoint for the ghp CLI.
internal
auth
Package auth handles GitHub OAuth authentication, browser session management, and the optional OAuth broker feature.
Package auth handles GitHub OAuth authentication, browser session management, and the optional OAuth broker feature.
backend
Package backend defines the upstream backend identifiers that ghp routes traffic to.
Package backend defines the upstream backend identifiers that ghp routes traffic to.
config
Package config handles loading and managing the ghp server configuration.
Package config handles loading and managing the ghp server configuration.
crypto
Package crypto provides AES-256-GCM encryption for storing GitHub OAuth credentials at rest.
Package crypto provides AES-256-GCM encryption for storing GitHub OAuth credentials at rest.
database
Package database provides the data access layer for ghp, abstracting over PostgreSQL (production) and SQLite (development) backends.
Package database provides the data access layer for ghp, abstracting over PostgreSQL (production) and SQLite (development) backends.
docs
Package docs provides the embedded documentation site for ghp.
Package docs provides the embedded documentation site for ghp.
gitcache
Package gitcache implements a Git protocol v2 caching proxy.
Package gitcache implements a Git protocol v2 caching proxy.
github
Package github implements GitHub App authentication for agent tokens (gha_).
Package github implements GitHub App authentication for agent tokens (gha_).
metrics
Package metrics registers all Prometheus metrics for ghp and provides helper functions for recording observations.
Package metrics registers all Prometheus metrics for ghp and provides helper functions for recording observations.
proxy
Package proxy implements the core reverse proxy that sits between coding agents and GitHub.
Package proxy implements the core reverse proxy that sits between coding agents and GitHub.
server
Package server wires up the HTTP server with all routes.
Package server wires up the HTTP server with all routes.
token
Package token manages the lifecycle of ghp proxy tokens (ghx_ and gha_ prefixed).
Package token manages the lifecycle of ghp proxy tokens (ghx_ and gha_ prefixed).
web
Package web provides the management web UI and HTTP middleware for ghp.
Package web provides the management web UI and HTTP middleware for ghp.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL