gitd

module
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0

README

gitd

Instant, secretless git checkouts for agent sandboxes. Your agents work in their own copy and publish a branch; they never see your token.

gitd.dev · Get started · Benchmark · Threat model · Roadmap

Give a hundred AI agents, CI jobs or preview environments the same repository and you usually get a hundred clones, a hundred fetches over the network, and a token inside every sandbox. gitd fetches each repository once into a pool, checks each commit out once into a template, and makes every workspace a copy-on-write layer on it: a new workspace needs no download, writes no files until its agent changes them, and holds no credential. When an agent is done it asks gitd to publish its commits as a new branch, and gitd pushes from the pool with the token it keeps.

  • Secretless. Credentials live in gitd, never in a workspace, a sandbox, an agent's context or a command line. Pushing happens from the pool, so a hostile insteadOf or http.proxy left in a workspace never sees where the token goes.
  • Fast and small. For a hundred agents on kubernetes, each workspace after the first took 23 ms and 4.3 MB, against 9.8 s and 418 MB for a shallow clone: all hundred in 14.5 s and 850 MB instead of 16 minutes and 41.9 GB, with one fetch instead of a hundred (see the benchmark).
  • Made for sandboxes. A workspace mounts into a container with its repository's pool, read only: each sandbox sees its own checkout and nothing else.
  • Dependencies ready. Seal one workspace after npm ci as a warm layer, and the next ones start with node_modules installed: ten workspaces of socket.io in 0.17 s each with its 561 MB of dependencies, against 28 s each installing (see warm layers).
  • Review built in. What each agent changed, its diff, how two attempts differ and whether they conflict, read without running the agent's code; publishing checked against rules, and the pull request opened from a GitHub App's bot.
  • Any git host. GitHub, GitLab (nested groups included), Bitbucket, Gitea, Forgejo, Codeberg or your own, over HTTPS or SSH, on any port, submodules included.
  • For agents. gitd mcp offers it as Model Context Protocol tools, none of which takes a credential.
  • Linux, macOS and Windows. Overlay workspaces on Linux, APFS clones on macOS, block clones on a Windows Dev Drive; Docker, Kubernetes and any sandbox with a network.

Why gitd

When agents write code, each needs its own copy of the repository, and the usual answer — one clone each — does not scale. Those who run agents at scale found it first:

  • Uber built GitFarm, a service that keeps its repositories checked out and ready, because every system cloned on its own and a cold clone of its monorepo took 10 to 15 minutes (Uber Engineering).
  • GitHub, whose git activity doubled in a year to 473.3 billion events a month, is rebuilding its git infrastructure for the scale of agents (GitHub).
  • Anthropic built its own version control, Scion, in five months, as its merges went from about 2,500 to over 30,000 a day: agents and CI are always online, so a full copy for each is wasted work (The Register).

None of them is available to anyone else. gitd is: open source, on the official git, with one fetch per repository, a copy per agent in milliseconds, and the token kept out of every sandbox. And for most teams the bottleneck is no longer git but reviewing what agents do, which is why every pull request gitd opens says what it checked.

Quick start

With Docker on Linux, two sandboxes with copy-on-write workspaces of one repository, gitd unprivileged beside its mount helper, and no token in either sandbox:

cd examples/sandboxes
./demo.sh                                   # or the steps below; ./demo.sh down removes it all

docker compose up -d gitd
docker compose exec gitd gitd prepare https://github.com/OCA/web /var/lib/gitd/workspaces/agent-1
docker compose exec gitd gitd prepare https://github.com/OCA/web /var/lib/gitd/workspaces/agent-2
docker compose run --rm agent-1 sh -c 'echo hi > NOTE.md && git add NOTE.md && git commit -m "agent-1 was here"'
docker compose exec gitd gitd publish /var/lib/gitd/workspaces/agent-1 agent-1/note

To publish, give gitd a credential in gitd.toml (see Credentials). examples/openhands runs an OpenHands agent the same way, and gitd opens its pull request from a GitHub App's bot; CI runs it on every push.

On your own machine, Linux or macOS, as yourself:

curl -fsSL --create-dirs -o ~/.local/bin/gitd https://github.com/dooservice/gitd/releases/latest/download/gitd-linux-amd64
chmod +x ~/.local/bin/gitd                  # gitd-darwin-arm64 on a Mac; ~/.local/bin on your PATH
gitd up                                     # gitd down stops it, keeping everything
gitd prepare https://github.com/OCA/web ~/gitd/workspaces/web

gitd up writes your configuration unless you have one, starts gitd as your user service (systemd's user instance on Linux, launchd on macOS) and waits until it answers; the command line then finds it with no GITD_SOCKET. With the GitHub CLI logged in, gitd reads its token each time it starts and never writes it down; without it, gitd connect github signs you in. Where workspaces are copied for want of root, it says the one step that makes them copy-on-write. With no user service manager, as in a container, it says how to run gitd in a terminal. On Windows it installs the service, from an administrator's terminal.

Configuration State Socket
Linux $XDG_CONFIG_HOME/gitd/gitd.toml (~/.config) $XDG_STATE_HOME/gitd (~/.local/state) $XDG_RUNTIME_DIR/gitd/gitd.sock
macOS ~/Library/Application Support/gitd/gitd.toml ~/Library/Application Support/gitd/state ~/Library/Application Support/gitd/gitd.sock

Workspaces go under ~/gitd/workspaces, on the same filesystem as the state, so that templates can be cloned into them.

On a server, without Docker:

curl -fsSLo /usr/local/bin/gitd https://github.com/dooservice/gitd/releases/latest/download/gitd-linux-amd64
chmod +x /usr/local/bin/gitd
gitd serve --config /etc/gitd/gitd.toml &   # packaging/gitd.service runs it under systemd
gitd prepare https://github.com/OCA/web /var/lib/gitd/workspaces/web

For AI agents (MCP)

gitd mcp answers the Model Context Protocol over stdio. Add it to your agent, for instance in Claude Code's .mcp.json or Cursor's mcp.json:

{
  "mcpServers": {
    "gitd": { "command": "gitd", "args": ["mcp"], "env": { "GITD_SOCKET": "/run/gitd/gitd.sock" } }
  }
}
Tool What it does
prepare_workspace A workspace of a repository at a path under gitd's roots, at a branch or a commit, on a branch of its own with new_branch
update_workspace To the tip of its branch
merge_branch A branch, such as main, merged into the one it is on; conflicts left marked
list_workspaces Every workspace gitd made, with the branches published from each
checkout_commit To a commit, as a rollback does
describe_workspace Its repository, commit, branch, uncommitted changes and submodules
list_changes Each file added, modified or deleted since gitd put it on its commit, with its lines
show_diff The unified diff of those changes, of some files or all, cut short at a size
publish_branch Its commits pushed to a new branch, or the one it is on, for a pull request; or to one it published before; or what a sandbox pushed through the endpoint
open_endpoint_access An address and a secret of gitd's own for a sandbox elsewhere to clone one repository from
remove_workspace Deleted; its pool stays
probe_repository Whether it can be read, its default branch and branches
read_audit_log The publishes done or refused, newest first

No tool takes a credential, and each says whether it only reads or destroys.

Command line

gitd alone serves; every other command calls the gitd that serves.

gitd prepare URL PATH [--branch B | --commit C] [--new-branch B] [--submodules] [--full-history] [--warm NAME]
gitd update PATH [--branch B | --merge B]   gitd checkout PATH COMMIT
gitd describe PATH                   gitd publish PATH [BRANCH]
gitd list
gitd submodules PATH                 gitd remove PATH
gitd probe URL                       gitd adopt PATH
gitd info                            gitd retire [--unused 720h]
gitd changes PATH [--ignored]        gitd diff PATH [FILE…] [--max-bytes N]
gitd compare FIRST SECOND [--diff]   gitd conflicts WORK WORK…
gitd watch [PATH…]                   gitd seal PATH NAME
gitd warm URL                        gitd token issue URL [--for 1h] | list | revoke ID
gitd publish --sandbox ID BRANCH
gitd audit [--since 24h] [--repository URL] [--limit N]
gitd publish PATH [BRANCH] [--requested-by LOGIN] [--pull-request] [--title T] [--draft] [--update] [--submodules]
gitd connect github | github-app --name N [--org O]
gitd connections list | remove ID | add-token PREFIX --token-env VAR | add-github-app
gitd publishing show | set PREFIX [--preset NAME] [--allow PATH] … | remove PREFIX
gitd publishing preset list | set NAME [--protect P] [--keep P] [--max-files N] | remove NAME
gitd mcp
gitd up                              gitd down

Every command takes --socket (default $GITD_SOCKET, then the socket of the gitd gitd up runs for you when it is there, then /run/gitd/gitd.sock) and --json; --url, --key-file and --ca-file (or $GITD_URL, $GITD_KEY_FILE, $GITD_CA_FILE) call a gitd on the network instead, naming the caller's tenant. Progress shows on a terminal only.

Credentials

gitd keeps them, so callers never have to, and a platform manages them from its own pages through the API (ConnectionService in both clients) or the command line, with no file to edit and no restart. None of this is offered to agents through MCP.

GitHub, with no token made by hand. The organisation creates its own GitHub App in one click, and gitd keeps its key; pull requests then come from the App's bot, and each token gitd makes from it opens one repository for an hour, for what the operation needs:

$ gitd connect github-app --org acme --name acme-agents
Open http://127.0.0.1:41703/ and press "Create GitHub App"
app-3f9a1c2b7d01  github_app  https://github.com/acme  as acme-agents[bot]
Install it on the repositories it may reach: https://github.com/apps/acme-agents/installations/new

A platform does the same through BeginGitHubApp and CompleteGitHubApp, with GitHub sending the person back to its own page. One person can instead sign in with a code (gitd connect github, GitHub's device flow, through gitd's public App, gitd-app, which gitd's releases and image are built with), and pull requests appear as them; a platform that already has an App registers it (gitd connections add-github-app). gitd connections list shows them all, never a secret.

Any host, or as configuration as code. A token is added the same way (gitd connections add-token PREFIX --token-env VAR), or declared in the file, naming where its secret is, never the secret itself:

[[credentials]]
prefix = "https://github.com/your-org"
token_file = "/run/credentials/gitd.service/github"   # LoadCredential= in gitd.service: in memory

[[credentials]]
prefix = "https://gitlab.com/your-group"
token_env = "GITLAB_TOKEN"

[[credentials]]
prefix = "https://github.com/your-org/tools"
github_app = { app_id = 123456, private_key_file = "/run/credentials/gitd.service/github-app.pem" }

[[credentials]]
prefix = ""                                            # any repository
ssh_key = "/etc/gitd/keys/id_ed25519"

A repository is read with the most specific credential that opens it, and only that one. A token reaches git as an HTTP header in its environment, scoped to that one repository; a key, through GIT_SSH_COMMAND, with hosts checked against known keys (GitHub, GitLab, Bitbucket and Codeberg are built in). A token's prefix must name its host, or it is refused: with none it would go to any host a submodule names. The secrets of connections made through the API are kept under <state>/connections, readable by gitd's user only, and encrypted when secrets_key_file names a key. A caller may still send a credential with a request, which wins over a kept one of the same prefix.

Publishing rules

Agents publish only new branches, never forced; a publish asked to update moves a branch an earlier one made, only ever forward. A platform sets, per repository prefix, what a publish may contain, through the API (PublishingService) or the command line, and gitd checks it on the commits to push — commit by commit, in the pool — before anything is pushed:

$ gitd publishing set https://github.com/acme --preset recommended --branch-prefix agents/ \
    --pull-requests always --draft --label agent --review-requester

gitd's own recommended preset protects .github/workflows/**, .gitlab-ci.yml, CODEOWNERS and .gitmodules, keeps tests from being deleted or renamed away, and allows at most 200 files changed. Presets are data, not code: define your own, or replace recommended with one of its name, and every setting that takes it changes at once; a setting can also leave paths of its preset free:

$ gitd publishing preset set strict --protect '.github/**' --protect 'deploy/**' --keep 'migrations/**' --max-files 50
$ gitd publishing set https://github.com/acme/tools --preset recommended --allow .gitmodules

A merge counts only what it brings itself, so merging what people changed on main is not the agent's change. Every setting whose prefix opens a repository applies, each checked on its own: what one allows never frees what another protects, and a narrower one never loosens a broader one. Presets and settings can be declared in the file too ([[publish.presets]], [[publish.settings]], and [publish] branch_prefix for every repository).

When the settings say so, or a publish asks, gitd opens the pull request on GitHub with the credential that pushed: from the App's bot, the person who asked for the work (--requested-by) asked to review it, and its body saying what gitd checked — the commits, the files and lines they change, and the rules they passed. If the pull request cannot be opened, the branch stays published and the answer says why.

A platform that publishes one session's work more than once sets update (--update): the branch moves forward, as a fast-forward only (BRANCH_EXISTS otherwise), and the pull request open from it is updated rather than another opened. An update that brings nothing new pushes nothing and still opens or updates the pull requests, so one that failed after the push is opened by publishing again. With submodules (--submodules), each submodule the branch changes gets its own pull request first, in its own repository, into the branch .gitmodules names for it or its default branch; the workspace's lists them, to be merged first and with a merge commit — a squash or a rebase would leave the workspace pointing at a commit its submodule's base does not have — and each links back to it. A submodule on a host other than GitHub is answered with why, and the others go on.

Rules by path cannot know what the CI runs: a test or a Makefile an agent changed runs in the CI of its branch. docs/GITHUB.md sets GitHub up so that agents' branches never receive the repository's secrets.

Every publish, done or refused, and every change to connections and settings, is on the record:

$ gitd audit --since 24h
2026-10-17 07:38:36  agents/x  https://github.com/octocat/hello-world  /var/lib/gitd/workspaces/agent-1
  refused, AUTH_REQUIRED: publishing takes a token, and none was given
2026-10-17 07:38:36  master  https://github.com/octocat/hello-world  /var/lib/gitd/workspaces/agent-1
  refused, BRANCH_REFUSED: "master" does not start with "agents/": gitd publishes only to branches that do

The log is <state>/audit/publishes.jsonl, one JSON entry per line, rotated at 16 MiB and kept for a year ([audit] rotate_bytes, keep); the API, the clients and MCP read it too.

What agents changed

A platform reviewing agents' work asks gitd, not the sandbox:

gitd changes /var/lib/gitd/workspaces/agent-3          # each file added, modified or deleted, with its lines
gitd diff /var/lib/gitd/workspaces/agent-3 src/app.go  # the unified diff, cut short at a size
gitd compare /var/lib/gitd/workspaces/agent-3 /var/lib/gitd/workspaces/agent-7 --diff
gitd conflicts agents/fix-a agents/fix-b /var/lib/gitd/workspaces/agent-9
gitd watch                                             # made, changed, published, refused, removed

On an overlay workspace the changes are read from the agent's own layer, and no git runs in the workspace: with one file changed in kubernetes, 0.012 s against 0.130 s for git status. Two attempts at one task compare file by file, workspaces or published branches alike; conflicts are read with git merge-tree in the pool. The clients have each call, and list_changes and show_diff let an agent review its own work over MCP.

Sandboxes elsewhere: the endpoint

A sandbox that cannot mount gitd's directories — a Firecracker microVM (E2B, Fly), a remote sandbox (Modal, Daytona, Runloop), a CI runner on another machine — clones from gitd over HTTP instead, with a token of gitd's own:

gitd token issue https://github.com/acme/web --for 2h     # a token, and the address to clone from
# in the sandbox:
git clone https://x:$TOKEN@gitd.internal:9420/git/github.com/acme/web.git
git push origin HEAD:agents/fix
# back on the platform:
gitd publish --sandbox sbx_… agents/fix

The token opens one repository for reading and one sandbox repository for writing, for an hour unless told and a day at most; it is never the git host's credential, and gitd keeps only its hash. Pushes land in the sandbox repository, never in the pool; publishing takes the branch from there with gitd's credential, under the same branch prefix, rules, pull request and audit log as a workspace. gitd serves it with git's own git http-backend, over TLS when given a certificate. examples/network runs it in CI, with a sandbox on a network of its own and nothing mounted.

Kubernetes: workspaces as volumes

A pod asks for a workspace like any volume, and gets a copy-on-write checkout from the gitd on its node, with no credential in the pod:

volumes:
  - name: repo
    csi:
      driver: gitd.dev
      volumeAttributes: { repository: https://github.com/acme/web, branch: main }

helm install gitd charts/gitd runs gitd and its CSI node plugin, gitd-csi, on every node: gitd keeps the pools on the node's disk and the credentials from a Secret only it mounts; the plugin mounts each pod's workspace, with its pool read-only inside it, and removes it when the pod goes. examples/kubernetes runs it on a kind cluster in CI: a pod commits in its workspace and gitd publishes it.

Many tenants on one gitd

A platform hosting many customers runs one gitd for all of them, each a [[tenants]] entry with its own key, roots, credentials and limits:

[[tenants]]
name = "acme"
api_key_file = "/run/credentials/gitd.service/acme"
roots = ["/var/lib/gitd/tenants-roots/acme"]
limits = { workspaces = 200, disk = "50GB", fetches = 2 }

Each tenant's pools, templates, workspaces, credentials, tokens and audit log live apart, under <state>/tenants/<name>; nothing is shared, public repositories included. Every call names its tenant with its key — Authorization: Bearer, or --key-file — and an endpoint token belongs to one tenant. A test runs two tenants and finds every reach into the other's refused. Without [[tenants]], gitd is one implicit tenant and behaves as before.

Dependencies ready: warm layers

Each new workspace usually starts without node_modules or .venv, and each agent installs them again. With gitd, the platform installs once — in its own sandbox, as gitd never runs a repository's code — and seals that workspace's layer:

gitd prepare https://github.com/acme/web /var/lib/gitd/workspaces/install
# in the platform's sandbox, on that workspace: npm ci
gitd seal /var/lib/gitd/workspaces/install deps
gitd prepare https://github.com/acme/web /var/lib/gitd/workspaces/agent-1 --warm deps

Every workspace made with --warm deps stacks the template, the warm layer and its own layer: it starts with everything installed, and only what it changes is its own. A warm layer is of one commit and never carries the sealed workspace's .git; sealing is refused while a sandbox still mounts the workspace.

Ten workspaces of socket.io, after one npm ci --ignore-scripts (37 s, 561 MB of node_modules), on a 4-CPU Linux machine:

How Time Disk Holding node_modules
10 × gitd prepare --warm 1.7 s, 0.17 s each 1.9 MB, plus the 561 MB layer once 10 of 10
10 × gitd prepare + npm ci 281 s, 28 s each 5,614 MB 10 of 10

All ten were clean checkouts to git, and npm ls --all read in them the same tree as in the workspace sealed. Run it yourself: sudo benchmarks/warm.sh REPO N, or the warm layers workflow of this repository.

Benchmark

A hundred agents on kubernetes, each getting its own copy, on a GitHub runner (4 CPUs):

How Time Disk Network
100 × git clone --depth 1 980 s, 9.8 s each 41,870 MB 100 fetches
100 × gitd prepare 14.5 s: the first 12.2 s, then 23 ms each 850 MB: 45 MB pool, 373 MB template, 4.3 MB per workspace 1 fetch

gitd is 67× faster and takes 49× less disk. Made 8 at a time, 99 workspaces took 2.0 s. git saw all hundred as clean checkouts, a first git status taking 0.24 s; an agent's commit stayed in its workspace; removing all hundred took 1.1 s. A workspace's 4.3 MB is mostly git's index, which each one keeps of its own.

Reading what an agent changed is fast for the same reason: with one file changed in a kubernetes workspace, gitd changes took 0.012 s, reading only the agent's own layer, against 0.130 s for git status walking all 31,441 files (0.92 s the first time); measured with ten agents on the same runner.

gitd ran as root in the benchmark, mounting the overlays itself; deployed unprivileged, it asks gitd-mount over a socket, which measured 34–36 ms a workspace. With the whole history (--full-history) a workspace is written rather than layered: ten of them took 128.6 s and 5,132 MB, against 1,093 s and 17,103 MB for ten full clones.

Run it yourself: docker build -t gitd:bench . && sudo benchmarks/hundred.sh REPO N, or the hundred agents workflow of this repository.

How it works

A pool is a bare repository fetched with --no-prune, never garbage collected, so even a commit lost to a force push is still there for a rollback. A workspace is a plain repository whose objects/info/alternates points at the pool: it has its own refs, index and config, any branch, and can be moved or mounted elsewhere. gitd runs the official git with a closed environment, no hooks and only HTTPS and SSH, and builds everything aside before moving it into place. The design is in docs/DESIGN.md; what each version brought, and what comes next — clients for Go and Rust, then 1.0 — in docs/ROADMAP.md.

Unlike git worktree, workspaces share no refs or config with each other, can check out the same branch twice, and survive being mounted into a container.

Configure

Every key has a default; packaging/gitd.toml shows them all.

Key Default What it is
socket /run/gitd/gitd.sock The Unix socket gitd answers on
state /var/lib/gitd Pools, lock files and the SSH host keys
roots ["/var/lib/gitd/workspaces"] The only directories a workspace may be made in
git git The git binary
metrics empty (off) Where Prometheus metrics are served, e.g. 127.0.0.1:9419
known_hosts [] Files of SSH host keys trusted besides the built-in ones
[[credentials]] none Credentials gitd keeps, by URL prefix: a token, an SSH key or a GitHub App
[endpoint] off gitd's network address: the git endpoint for sandboxes elsewhere, and the API, over TLS when given
api_key_file empty Without tenants, the key the network address asks callers for
[[tenants]] none Customers on one gitd, each with its key, roots, credentials and limits
secrets_key_file empty The key that encrypts the secrets of connections made through the API
[github] gitd's public App The App people sign in through with gitd connect github
[publish] branch_prefix = "" (any new branch) What every published branch must start with
[[publish.presets]] gitd's recommended Named sets of rules settings take; one named recommended replaces gitd's
[[publish.settings]] none Rules and pull requests per repository prefix, as the API sets them
[audit] rotate at 16 MiB, keep a year How the audit log of every publish and change is kept
[hosts."<host>"] — https_port, ssh_port, ssh_user of a host not on the usual ones
[limits] 4 fetches, 8 writes, 32 queued, 5m wait, 30m per call How much runs at once and for how long
[housekeeping] every 6h, retire after 30 days Pool maintenance and retirement

A host on other ports says so, and every form of its addresses is then one repository:

[hosts."git.example.com"]
https_port = 3000
ssh_port = 2222       # its key goes in known_hosts as [git.example.com]:2222 ssh-ed25519 …

API

gitd speaks ConnectRPC (gRPC, gRPC-Web and Connect over HTTP) on its Unix socket, and on its network address when [endpoint] sets one, there with a key; the contract is proto/gitd/v1/gitd.proto. Any language with a Connect or gRPC client can call it, and buf curl can too.

Every client is gitd-client, released with gitd's own version, on Linux, macOS and Windows:

Client Install Published on
Python Python pip install gitd-client PyPI
TypeScript TypeScript npm install gitd-client npm
Go Go go get github.com/dooservice/gitd/client pkg.go.dev
Rust Rust cargo add gitd-client crates.io

Install

  • On your machine: gitd up runs gitd for you, started with your session; see Quick start.
  • Binary: gitd-linux-amd64 or gitd-linux-arm64 from the releases, with its checksum; on macOS, gitd-darwin-arm64 or gitd-darwin-amd64, where templates are cloned by APFS (guide); on Windows, gitd-windows-amd64.exe or gitd-windows-arm64.exe, where templates are cloned by blocks on a Dev Drive and gitd service install runs it as a service (guide).
  • Docker: ghcr.io/dooservice/gitd, for amd64 and arm64.
  • systemd: packaging/gitd.service.
  • Kubernetes: the Helm chart in charts/gitd, and gitd-csi-linux-* from the releases.
  • Copy-on-write workspaces: gitd makes a workspace by mounting an overlay on a shared template whenever it can, and writes its files otherwise. It runs unprivileged, so the mount is done by gitd-mount, a tiny root service holding only the capabilities mounting an overlay takes, on a socket only gitd's user reaches: install gitd-mount-linux-* as /usr/local/bin/gitd-mount, put packaging/gitd-mount.conf in /etc/gitd/ (root's, matching gitd's state and roots), and enable gitd-mount.socket. gitd says at start which way it makes workspaces, and why; gitd up prints these commands for your own gitd, with its user and paths. On btrfs, or XFS with reflink, strategy = "reflink" in [workspaces] clones templates instead, with no root, saving disk though not time. Keep gitd's state and roots on a nosuid,nodev filesystem, and read the threat model before giving workspaces to sandboxes.
  • From source: make build (Go, the version in go.mod); make test, make lint; make generate regenerates gen/ from the .proto with buf.

Pushing a tag such as 0.10.0 releases the binaries, the image and the clients. Guides for each kind of sandbox are in docs/guides.

Contributing and security

See CONTRIBUTING.md. What gitd protects, from whom, and what it leaves to you is in docs/THREAT_MODEL.md. To report a vulnerability, do not open an issue: follow SECURITY.md.

License

Apache License 2.0.

Directories

Path Synopsis
Package client calls a gitd, on its Unix socket or on the network: for programs written in Go, and for gitd's own command line and MCP server.
Package client calls a gitd, on its Unix socket or on the network: for programs written in Go, and for gitd's own command line and MCP server.
cmd
gitd command
Command gitd keeps one copy of each git repository and makes workspaces that borrow from it.
Command gitd keeps one copy of each git repository and makes workspaces that borrow from it.
gitd-csi command
Command gitd-csi is gitd's Kubernetes CSI node plugin (internal/csi): a pod's ephemeral volume of the driver gitd.dev becomes a workspace of the gitd on its node, with no credential in the pod.
Command gitd-csi is gitd's Kubernetes CSI node plugin (internal/csi): a pod's ephemeral volume of the driver gitd.dev becomes a workspace of the gitd on its node, with no credential in the pod.
gitd-mount command
Command gitd-mount mounts and unmounts gitd's overlay workspaces, so that gitd itself needs no privilege.
Command gitd-mount mounts and unmounts gitd's overlay workspaces, so that gitd itself needs no privilege.
gen
internal
apikeys
Package apikeys checks the keys callers bring: a tenant's, or the one gitd's network address asks for without tenants.
Package apikeys checks the keys callers bring: a tenant's, or the one gitd's network address asks for without tenants.
audit
Package audit keeps the audit log: every publish, done or refused, one per line of an append-only file, in the JSON form of the contract's AuditEntry.
Package audit keeps the audit log: every publish, done or refused, one per line of an append-only file, in the JSON form of the contract's AuditEntry.
cli
Package cli is gitd's command line.
Package cli is gitd's command line.
config
Package config reads gitd's configuration, a TOML file whose every key has a default.
Package config reads gitd's configuration, a TOML file whose every key has a default.
conformance
Package conformance checks that every way of making a workspace from a template behaves, under what an agent does with git, exactly as a written checkout does — and never changes the template.
Package conformance checks that every way of making a workspace from a template behaves, under what an agent does with git, exactly as a written checkout does — and never changes the template.
connections
Package connections keeps the credentials a platform gives gitd through the API: one file per connection under the state directory, readable by gitd's user only, its secret sealed when gitd has a secrets key.
Package connections keeps the credentials a platform gives gitd through the API: one file per connection under the state directory, readable by gitd's user only, its secret sealed when gitd has a secrets key.
connectpage
Package connectpage writes the pages `gitd connect github-app` serves on this machine while a person creates their organisation's GitHub App: what will be created and may do, that it is connected and where to install it, or why it was not kept.
Package connectpage writes the pages `gitd connect github-app` serves on this machine while a person creates their organisation's GitHub App: what will be created and may do, that it is connected and where to install it, or why it was not kept.
credentials
Package credentials turns the credentials of one request into how git reads a repository.
Package credentials turns the credentials of one request into how git reads a repository.
csi
Package csi is gitd's Kubernetes CSI node plugin: a pod asks for a workspace like any volume — an ephemeral inline volume of the driver gitd.dev — and gets a copy-on-write checkout, made by the gitd on its node, with no credential in the pod.
Package csi is gitd's Kubernetes CSI node plugin: a pod asks for a workspace like any volume — an ephemeral inline volume of the driver gitd.dev — and gets a copy-on-write checkout, made by the gitd on its node, with no credential in the pod.
daemon
Package daemon is gitd serving: it reads the configuration, puts every part together and answers on the socket until it is told to stop.
Package daemon is gitd serving: it reads the configuration, puts every part together and answers on the socket until it is told to stop.
endpoint
Package endpoint is gitd's git endpoint: sandboxes that cannot mount gitd's directories clone and push over smart HTTP, with tokens of gitd's own that open one repository each, never the git host's credential.
Package endpoint is gitd's git endpoint: sandboxes that cannot mount gitd's directories clone and push over smart HTTP, with tokens of gitd's own that open one repository each, never the git host's credential.
events
Package events carries what happens to workspaces to whoever watches: a workspace made, changed, published, refused or removed.
Package events carries what happens to workspaces to whoever watches: a workspace made, changed, published, refused or removed.
files
Package files writes the files gitd keeps for itself under its state directory.
Package files writes the files gitd keeps for itself under its state directory.
git
Package git runs the official git binary, and is the only thing in gitd that does.
Package git runs the official git binary, and is the only thing in gitd that does.
githubapp
Package githubapp makes the tokens of a GitHub App: a short JWT signed with the App's private key asks GitHub for an installation token limited to one repository and to what one operation needs, kept in memory until shortly before it expires.
Package githubapp makes the tokens of a GitHub App: a short JWT signed with the App's private key asks GitHub for an installation token limited to one repository and to what one operation needs, kept in memory until shortly before it expires.
housekeeping
Package housekeeping keeps the pools healthy and the disk clean, by itself.
Package housekeeping keeps the pools healthy and the disk clean, by itself.
lock
Package lock serializes the writes on one repository and bounds how many run at once.
Package lock serializes the writes on one repository and bounds how many run at once.
mcpserver
Package mcpserver offers gitd to AI agents as Model Context Protocol tools, over stdio.
Package mcpserver offers gitd to AI agents as Model Context Protocol tools, over stdio.
metrics
Package metrics is what gitd tells Prometheus.
Package metrics is what gitd tells Prometheus.
mounthelper
Package mounthelper is gitd-mount: the one process that may mount, so that gitd needs no privilege at all.
Package mounthelper is gitd-mount: the one process that may mount, so that gitd needs no privilege at all.
pool
Package pool keeps one bare copy of each repository on this server, and is the only thing that reaches the network for it.
Package pool keeps one bare copy of each repository on this server, and is the only thing that reaches the network for it.
progress
Package progress reads what git writes to stderr with `--progress` while it works.
Package progress reads what git writes to stderr with `--progress` while it works.
publishing
Package publishing keeps the rules publishing follows for the repositories under each prefix, and the presets — named sets of rules — those settings take: gitd's own, those of the configuration file, shown and never changed through the API, and those a platform sets through it, kept under the state directory and applied at once.
Package publishing keeps the rules publishing follows for the repositories under each prefix, and the presets — named sets of rules — those settings take: gitd's own, those of the configuration file, shown and never changed through the API, and those a platform sets through it, kept under the state directory and applied at once.
pullrequests
Package pullrequests opens the pull request of a publish, on the host's API, with the same credential that pushed it, and writes its body: who asked for the work and what gitd checked, so a reviewer reads in a minute what they would otherwise dig for.
Package pullrequests opens the pull request of a publish, on the host's API, with the same credential that pushed it, and writes its body: who asked for the work and what gitd checked, so a reviewer reads in a minute what they would otherwise dig for.
repo
Package repo says which repository an address names.
Package repo says which repository an address names.
secrets
Package secrets keeps the secrets gitd stores on disk — the tokens and private keys of connections made through the API — sealed with a key kept apart, when one is given.
Package secrets keeps the secrets gitd stores on disk — the tokens and private keys of connections made through the API — sealed with a key kept apart, when one is given.
server
Package server answers the contract in proto/gitd/v1 over ConnectRPC, on a Unix socket.
Package server answers the contract in proto/gitd/v1 over ConnectRPC, on a Unix socket.
strategy
Package strategy makes a workspace's directory from a template without writing its files: an overlay layer on top of the template, or a reflink copy of it.
Package strategy makes a workspace's directory from a template without writing its files: an overlay layer on top of the template, or a reflink copy of it.
template
Package template keeps the templates copy-on-write workspaces are made from: one read-only checkout of a repository at a commit, built once and shared by every workspace of that commit, and retired once none uses it.
Package template keeps the templates copy-on-write workspaces are made from: one read-only checkout of a repository at a commit, built once and shared by every workspace of that commit, and retired once none uses it.
testhost
Package testhost serves a repository over HTTPS with git's own smart HTTP server, taking pushes, for tests that publish: a git host on this machine, with a certificate a pool can be told to trust.
Package testhost serves a repository over HTTPS with git's own smart HTTP server, taking pushes, for tests that publish: a git host on this machine, with a certificate a pool can be told to trust.
userservice
Package userservice runs gitd for the person signed in, under their system's own manager of user services: systemd's user instance on Linux, launchd on macOS.
Package userservice runs gitd for the person signed in, under their system's own manager of user services: systemd's user instance on Linux, launchd on macOS.
winservice
Package winservice runs gitd as a Windows service, as systemd runs it on Linux: started with the machine, restarted when it fails, answering whoever is in the local group gitd.
Package winservice runs gitd as a Windows service, as systemd runs it on Linux: started with the machine, restarted when it fails, answering whoever is in the local group gitd.
workspace
Package workspace checks repositories out where their users need them.
Package workspace checks repositories out where their users need them.

Jump to

Keyboard shortcuts

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