{"slug": "a-github-compatible-git-service-built-for-ai-agents", "title": "A GitHub-compatible Git service built for AI agents", "summary": "A new open-source project called agent-git-service provides a self-hosted, GitHub-compatible API server designed for AI agents, offering durable agent accounts, scoped tokens, and direct permission grants while preserving Git-native workflows. The service supports REST v3, GraphQL v4, OAuth device flow, and Git Smart HTTP, storing repositories as real bare Git repos and metadata in TiDB/MySQL-compatible storage, enabling developers to run a GitHub-like service under their own control.", "body_md": "**A self-hosted, GitHub-compatible API server for agents, automation, and\ndeveloper workflows.**\n\n`agent-git-service`\n\nlets GitHub-speaking clients work with repositories you\nown, and its agent-first design treats AI agents as first-class citizens with\ndurable identities, scoped tokens, default workspaces, and ownership/recovery\nflows.\n\nIt exposes GitHub-style REST v3, GraphQL v4, OAuth device flow, and Git Smart HTTP while storing repository data in real bare Git repositories and product metadata in TiDB/MySQL-compatible storage.\n\nThe development binary is currently named `gh-server`\n\n.\n\nUse `agent-git-service`\n\nwhen you want a GitHub-compatible service that can\nrun where your agents run:\n\n- Keep repositories and product metadata under your control.\n- Support existing GitHub clients instead of inventing new client protocols.\n- Give agents durable accounts, tokens, optional human binding, and repository transfer flows.\n- Preserve Git-native clone, fetch, push, refs, diffs, merges, and history in real bare Git repositories.\n- Validate compatibility through the vendored GitHub CLI acceptance suite.\n\n| Capability | agent-git-service | GitHub.com | How it differs |\n|---|---|---|---|\n| GitHub-style repositories, issues, labels, wiki, and Git history | Yes | Yes | Both support familiar GitHub-shaped collaboration workflows. agent-git-service keeps these workflows available on a self-hosted backend. |\nGit Smart HTTP, REST v3, OAuth device flow, and common `gh` workflows |\nYes | Yes | Existing GitHub-speaking clients can work against agent-git-service without learning a new protocol. |\n| First-class durable agent accounts | Yes | No | GitHub supports bots, Apps, PATs, and machine users, but agent-git-service gives agents their own durable accounts, tokens, and default workspaces. |\n| Direct agent permissions across repos, orgs, and teams | Yes | Partial | In agent-git-service, agents can be granted collaborator, org, team, and team-repo access directly instead of relying on App or PAT indirection. |\n| Human-agent binding and recovery | Yes | No | agent-git-service supports human-agent binding, connected login, switch sessions, and recovery flows as first-class workflows. |\n| Self-hosted agent service | Yes | No | agent-git-service can run where your agents and data live, with local control over identity, storage, and rate-limit policy. |\n| Local data, Git storage, and metadata ownership | Yes | No | agent-git-service stores repositories as real bare Git repos while keeping product metadata in TiDB/MySQL-compatible storage. |\n| Full hosted GitHub product ecosystem | Partial | Yes | GitHub.com is broader across Actions, security products, marketplace, traffic/community features, and long-tail APIs. |\n| Full GitHub GraphQL schema parity | Partial | Yes | agent-git-service provides GraphQL compatibility for selected workflows, not full GitHub GraphQL parity. |\n\n| Enhancement | What it adds |\n|---|---|\n| Agent identities and governance | Durable agent accounts, API tokens, human binding/recovery, switch sessions, default repos, repository transfer flows, and direct repo/org/team permission grants |\n| GitHub-compatible core | REST v3, GraphQL compatibility, OAuth device flow, Git Smart HTTP, and `gh` acceptance coverage for common workflows |\n| Issue workspace | Typing signals, presence, attachments, read state, unread counts, pinned comments, and reactions |\n| Wiki memory | Git-backed pages, history, search, labels, backlinks, page moves, reconcile, repair, and compact operations |\n| Semantic search | Optional embedding-backed issue and pull request search |\n| Self-hosted operations | Local data and Git storage, local rate-limit policy, Prometheus metrics, readiness checks, structured logs, and a Grafana dashboard |\n\nKnown GitHub-compatibility gaps are tracked in\n[ docs/github-api-compatibility-matrix.md](/ngaut/agent-git-service/blob/main/docs/github-api-compatibility-matrix.md).\n\nThis local path uses [TiDB Zero](https://zero.tidbcloud.com/)\nfor a disposable TiDB database.\n\nInstall `curl`\n\nand `jq`\n\nbefore running this quickstart. The snippet below uses\nboth tools to create a TiDB Zero instance and build the MySQL DSN.\n\n```\ngit clone https://github.com/ngaut/agent-git-service.git\ncd agent-git-service\ncp .env.example .env\n\nZERO_INSTANCE=\"$(\n  curl -fsS -X POST https://zero.tidbapi.com/v1beta1/instances \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"tag\":\"agent-git-service-quickstart\"}'\n)\"\nexport DB_DSN=\"$(\n  printf '%s' \"$ZERO_INSTANCE\" | jq -r '\n    .instance.connection as $c |\n    \"\\($c.username):\\($c.password)@tcp(\\($c.host):\\($c.port))/test?parseTime=true&timeout=10s&tls=true\"\n  '\n)\"\nprintf 'TiDB Zero claim URL: %s\\n' \"$(\n  printf '%s' \"$ZERO_INSTANCE\" | jq -r '.instance.claimInfo.claimUrl'\n)\"\n\ngo run ./cmd/gh-server\n```\n\nClaim the TiDB Zero instance from its claim URL if you want to keep the database\nafter evaluation. For production, create a TiDB Cloud Starter instance and\nfollow the full [ docs/production-deployment.md](/ngaut/agent-git-service/blob/main/docs/production-deployment.md)\nguide.\n\nFor the complete local setup, including `gh`\n\nCLI, `curl`\n\n, and Git push examples,\nsee [ docs/quickstart.md](/ngaut/agent-git-service/blob/main/docs/quickstart.md).\n\n```\nmake build       # compile gh-server\nmake check       # build + go vet\nmake test-unit   # go test -v ./...\nmake test        # gh CLI acceptance tests; requires a running local server\nmake test-e2e    # shell E2E flows under e2e/\n```\n\nLocal setup helpers:\n\n```\nmake setup       # persistent setup with an external DB_DSN\nmake test-setup  # test-only setup using tiup playground\nmake run-bg      # start the local server in the background\nmake stop        # stop it\nmake status      # show local status\n```\n\n`make run-bg`\n\nfirst tries the privileged `github.localhost`\n\nlistener path used\nby acceptance tests. If passwordless sudo is unavailable, it falls back to port\n`8080`\n\n; `make test`\n\nwill then fail fast because the acceptance suite expects\n`http://github.localhost`\n\non port `80`\n\n.\n\nLicensed under the [Apache License 2.0](/ngaut/agent-git-service/blob/main/LICENSE).", "url": "https://wpnews.pro/news/a-github-compatible-git-service-built-for-ai-agents", "canonical_source": "https://github.com/ngaut/agent-git-service", "published_at": "2026-06-30 07:05:44+00:00", "updated_at": "2026-06-30 07:20:13.661139+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-infrastructure"], "entities": ["agent-git-service", "GitHub", "TiDB", "MySQL", "OAuth", "Git Smart HTTP", "Prometheus", "Grafana"], "alternates": {"html": "https://wpnews.pro/news/a-github-compatible-git-service-built-for-ai-agents", "markdown": "https://wpnews.pro/news/a-github-compatible-git-service-built-for-ai-agents.md", "text": "https://wpnews.pro/news/a-github-compatible-git-service-built-for-ai-agents.txt", "jsonld": "https://wpnews.pro/news/a-github-compatible-git-service-built-for-ai-agents.jsonld"}}