Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

239 lines · 23.8 KBRaw History
1# Diffinery
2
3**The open-source GitHub and GitHub Actions alternative that runs entirely on Cloudflare.** Git hosting, pull requests, code review and drop-in GitHub Actions CI, built for teams of people and AI agents. Deploy it to your own Cloudflare account: no servers, no runner machines, nothing to patch.
4
5[![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
6[![GitHub Actions compatible](https://img.shields.io/badge/GitHub%20Actions-compatible-2088ff.svg)](https://diffinery.com/docs/actions/compatibility)
7[![Runs on Cloudflare Workers](https://img.shields.io/badge/runs%20on-Cloudflare%20Workers-f38020.svg)](https://diffinery.com/built-on-cloudflare)
8[![Built-in MCP server](https://img.shields.io/badge/MCP-server%20built%20in-8a2be2.svg)](https://diffinery.com/docs/agents/mcp)
9[![Documentation](https://img.shields.io/badge/docs-diffinery.com%2Fdocs-f38020.svg)](https://diffinery.com/docs)
10[![Pull requests welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
11
12[Website](https://diffinery.com) · [Docs](https://diffinery.com/docs) · [Deploy your own](https://diffinery.com/docs/self-hosting/deploy) · [Compare](https://diffinery.com/compare) · [Performance](https://diffinery.com/performance) · [Roadmap](ROADMAP.md) · [llms.txt](https://diffinery.com/llms.txt)
13
14[![A pull request on Diffinery opened by an AI agent, with its intent, a person's approval and four passing GitHub Actions–compatible checks](docs/images/pull-request.png)](docs/images/pull-request.png)
15
16Diffinery hosts Git repositories, pull requests with reviews and a merge queue, issues, releases and a container registry, and runs your existing `.github/workflows/*.yml` files as they are, marketplace actions included. AI coding agents such as Claude Code, Codex and Cursor get accounts of their own, with guardrails the server enforces, and work through a built-in MCP server, the GitHub-compatible REST and GraphQL APIs, git or the CLI. Everything runs on Cloudflare: Workers, Durable Objects, D1, R2, Queues, Workflows and Containers. It is free, open-source software under the Apache License 2.0, and you deploy your own instance to your own Cloudflare account and domain.
17
18- **Source:** [diffinery.com/codician/diffinery](https://diffinery.com/codician/diffinery), where development, CI and deploys happen, mirrored to [github.com/codician-team/diffinery](https://github.com/codician-team/diffinery).
19- **Documentation:** [diffinery.com/docs](https://diffinery.com/docs), also as Markdown and in [llms.txt](https://diffinery.com/llms.txt) and [llms-full.txt](https://diffinery.com/llms-full.txt) for AI assistants.
20
21If Diffinery is useful to you, a star on GitHub helps other people find it.
22
23## Contents
24
25- [Who Diffinery is for](#who-diffinery-is-for)
26- [Why Diffinery](#why-diffinery)
27- [Screenshots](#screenshots)
28- [Features](#features)
29- [How it compares](#how-it-compares)
30- [Self-host on your own Cloudflare account](#self-host-on-your-own-cloudflare-account)
31- [How it runs on Cloudflare](#how-it-runs-on-cloudflare)
32- [Develop locally](#develop-locally)
33- [Repository layout](#repository-layout)
34- [What Diffinery doesn't do (yet)](#what-diffinery-doesnt-do-yet)
35- [FAQ](#faq)
36- [Contributing, security and license](#contributing-security-and-license)
37
38## Who Diffinery is for
39
40- **Teams looking for a GitHub Actions alternative** that keeps their workflow YAML: Diffinery reads `.github/workflows/` with the same syntax and runs marketplace actions, on runners with 4 vCPUs and 12 GiB by default.
41- **Teams that want a self-hosted GitHub alternative without running servers.** Like Gitea, Forgejo or GitLab, you run your own instance, but it deploys to Cloudflare's serverless platform instead of a VM or a Kubernetes cluster.
42- **Teams that want faster CI runners** than GitHub's standard 2-vCPU runner for private repositories, without paying a separate runner service such as Blacksmith or Depot.
43- **Teams working with AI coding agents** (Claude Code, Codex, Cursor and others) that should open pull requests a person approves, rather than push to `main`.
44- **Cloudflare developers** looking for a large, real-world application built on Durable Objects with SQLite, Containers, Workflows, Queues and R2.
45
46## Why Diffinery
47
48- **Git hosting, pull requests and CI in one serverless app.** One Cloudflare Worker serves the web UI, git over HTTPS, a GitHub-compatible REST and GraphQL API, and an MCP server. Each repository is its own Durable Object with its own SQLite database, so repositories scale out instead of sharing one database server.
49- **Your GitHub Actions workflows run unchanged.** The same triggers, expressions, matrices, `needs`, outputs, reusable workflows, environments, secrets, variables, OIDC, service containers and Docker. Marketplace actions (`uses: owner/repo@ref`) are downloaded and run. Every known difference is listed in [Compatibility with GitHub Actions](https://diffinery.com/docs/actions/compatibility).
50- **Runners that exist only while a job runs.** Each job gets a fresh Ubuntu 24.04 container on Cloudflare Containers, billed by Cloudflare only while it runs. The default size has 4 vCPUs and 12 GiB of memory, and jobs that use little of it move to smaller sizes on their own. Self-hosted runners cover macOS, Windows, Arm and GPUs.
51- **Built for AI agents, with a human in the loop.** Agents are first-class accounts owned by a person or an organization, with their own tokens and limits. They can't push or merge to protected branches unless a rule allows it, their pull requests need a human approval, and every commit they make records who they act for. Agent tasks run Claude Code, Codex or your own command in a sandbox and open a pull request.
52- **Secure by default.** Passkey sign-in with no passwords, invite-only accounts, branch protection, push protection that blocks leaked credentials, envelope-encrypted secrets, kill switches and an append-only audit log.
53- **Moving from GitHub is one step.** A server-side importer brings a repository or a whole organization over with its history, issues, pull requests, reviews and releases, and `gh`, Octokit, VS Code and JetBrains IDEs work against Diffinery.
54
55## Screenshots
56
57| A repository, with the clone URL and one-click open in VS Code, Cursor, Windsurf and IntelliJ IDEA | A workflow run from `.github/workflows/ci.yml`, with a matrix and `needs` |
58| --- | --- |
59| [![A repository's code page on Diffinery](docs/images/repository.png)](docs/images/repository.png) | [![A GitHub Actions–compatible workflow run on Diffinery](docs/images/actions-run.png)](docs/images/actions-run.png) |
60
61[![A job's live log on Diffinery, in dark mode](docs/images/job-logs-dark.png)](docs/images/job-logs-dark.png)
62
63## Features
64
65| Area | What you get | Docs |
66| --- | --- | --- |
67| Git | Clone, fetch and push over HTTPS with a token; shallow clones, Git LFS, `refs/pull/<n>/head` and `/merge`; large pushes unpacked from R2 in pieces | [Git over HTTPS](https://diffinery.com/docs/repositories/git) |
68| Pull requests | Draft PRs, reviews with line comments, required approvals and checks, merge, squash and rebase, auto-merge, a merge queue with `merge_group` runs, and an `intent` field that tells reviewers what a change is for | [Pull requests](https://diffinery.com/docs/collaboration/pull-requests) |
69| Issues and releases | Issues, labels, milestones, reactions, mentions, releases with assets and generated notes | [Collaboration](https://diffinery.com/docs/collaboration/issues) |
70| Actions (CI/CD) | GitHub Actions–compatible workflows on hosted runners in Cloudflare Containers or self-hosted runners; caches, artifacts, secrets, environments, OIDC, Docker, service containers, concurrency groups, scheduled runs | [Actions overview](https://diffinery.com/docs/actions/overview) |
71| Container registry | Push and pull OCI images at `<your host>/<owner>/<name>`, in place of ghcr.io | [Container registry](https://diffinery.com/docs/packages/container-registry) |
72| Agents | Agent accounts and tokens, an MCP server at `/mcp`, sandboxes, agent tasks, agent code review, projects with shared memory, and a Today page of what needs you | [Agents](https://diffinery.com/docs/agents/overview) |
73| API and tools | GitHub-compatible REST (`/api/v3`) and GraphQL (`/api/graphql`) APIs, webhooks, the `diffinery` CLI, `gh` support, VS Code and JetBrains plugins, a Claude Code and Codex plugin (in [`plugins/`](plugins)) | [REST API](https://diffinery.com/docs/reference/rest-api) |
74| Security | Passkeys (WebAuthn), branch protection, push protection, encrypted secrets, audit log, moderation, rate limits, quotas and kill switches | [Security overview](https://diffinery.com/docs/security/overview) |
75| Migration | Import from GitHub with history, issues, pull requests, reviews and releases, from the web, CLI, API or MCP | [Migrate from GitHub](https://diffinery.com/docs/migrate-from-github) |
76
77## How it compares
78
79Diffinery is a forge: it hosts your code and runs your CI. Here is how it sits next to the tools people usually compare it with. Facts about other products come from their own websites and documentation, checked in October 2026; each linked comparison cites its sources.
80
81| | Diffinery | GitHub + GitHub Actions | GitLab | Gitea / Forgejo | Runner services (Blacksmith, Depot) |
82| --- | --- | --- | --- | --- | --- |
83| What it is | Open-source forge with built-in CI | Hosted forge with built-in CI | Forge with built-in CI | Open-source self-hosted forges with built-in CI | Faster runners for GitHub Actions; your code stays on GitHub |
84| Who runs it | You, on your own Cloudflare account | GitHub (Enterprise Server: your servers) | GitLab, or you (self-managed) | You, on your own servers (or Gitea Cloud, Codeberg) | The vendor |
85| Servers to operate | None | None (hosted) | None (hosted) or your own | Your servers and your runner machines | None |
86| CI workflow format | GitHub Actions YAML in `.github/workflows/` | GitHub Actions YAML | `.gitlab-ci.yml` | GitHub Actions–style YAML, "mostly compatible" (Gitea) or "not designed to be compatible" (Forgejo) | GitHub Actions YAML, with a new `runs-on` label |
87| Default hosted Linux runner | 4 vCPU, 12 GiB, started per job in Cloudflare Containers | 2 vCPU, 8 GB for private repositories | 2 vCPU, 8 GB | Runners you install | Several sizes, priced per minute |
88| Hosted macOS and Windows | No (self-hosted runners) | Yes | Beta | Runners you install | Yes |
89| Guardrails for AI agents | Built in for every agent account | Rulesets and token permissions you configure | Approval rules and service accounts you configure | Not covered | Not applicable |
90| Built-in MCP server | Yes, at `/mcp` | Yes | Yes | Gitea: a separate MCP server | Not applicable |
91| License | Apache-2.0 | Proprietary | Open core | MIT (Gitea), GPL v3+ (Forgejo) | Proprietary |
92
93Read the details: [Diffinery vs GitHub](https://diffinery.com/compare/github) · [vs GitLab](https://diffinery.com/compare/gitlab) · [vs Gitea and Forgejo](https://diffinery.com/compare/gitea) · [vs Blacksmith](https://diffinery.com/compare/blacksmith) · [vs Depot](https://diffinery.com/compare/depot) · [vs CircleCI](https://diffinery.com/compare/circleci) · [vs Buildkite](https://diffinery.com/compare/buildkite) · [vs Bitbucket](https://diffinery.com/compare/bitbucket) · [all GitHub Actions alternatives](https://diffinery.com/compare) · [other Git and CI projects on Cloudflare](https://diffinery.com/built-on-cloudflare#other-git-and-ci-projects-on-cloudflare)
94
95## Self-host on your own Cloudflare account
96
97Diffinery is designed to be deployed by anyone to their own Cloudflare account and domain. Nobody who uses your instance needs a Cloudflare account; only the deployment does.
98
99**You need:**
100
101- A Cloudflare account on the **Workers Paid** plan, with R2 enabled. Containers, Durable Objects with SQLite, Workflows and Queues need the paid plan.
102- A domain on that account (Diffinery is served at the root of a hostname such as `git.example.com`).
103- A Cloudflare API token with the permissions listed in [Deploy your own Diffinery](https://diffinery.com/docs/self-hosting/deploy#step-2-create-a-cloudflare-api-token).
104- Node.js 22, pnpm 10, Docker, `jq`, `curl` and `openssl` on the machine you deploy from.
105
106**Deploy:**
107
108```sh
109git clone https://diffinery.com/codician/diffinery.git # or the GitHub mirror
110cd diffinery
111
112export CLOUDFLARE_API_TOKEN=... # never commit it
113export CLOUDFLARE_ACCOUNT_ID=...
114export DIFFINERY_DOMAIN=git.example.com # your hostname
115export BOOTSTRAP_ADMINS=you@example.com # who becomes site administrator on first sign-in
116
117scripts/setup.sh --dry-run # checks tools, token and config without changing anything
118scripts/setup.sh # creates the Cloudflare resources and deploys
119```
120
121The setup script creates whatever is missing in your account (the D1 database, R2 bucket and lifecycle rules, queues, a Turnstile widget and a Cloudflare Access application for email recovery), applies the database migrations, deploys the Worker and the runner image, generates the Worker's own secrets once, and checks that the site answers. Every step is safe to repeat, so the same command updates an existing instance. Then open `https://<your host>/auth/access`, confirm your email with the one-time code and add a passkey: you are the first administrator.
122
123You can also deploy from CI with the included [Deploy workflow](.github/workflows/deploy.yml) on Diffinery or GitHub Actions. The full guide, including email sending, DNS, Access and troubleshooting, is [Deploy your own Diffinery](https://diffinery.com/docs/self-hosting/deploy), and every setting is described in [Configuration](https://diffinery.com/docs/self-hosting/configuration).
124
125## How it runs on Cloudflare
126
127| Piece | Cloudflare product |
128| --- | --- |
129| Web UI, git smart HTTP, REST and GraphQL APIs, MCP | Workers ([Hono](https://hono.dev)) |
130| One repository: refs, objects, pull requests, issues, reviews, checks, runs | A Durable Object with SQLite (`RepoDO`), one per repository |
131| Large objects, Git LFS, container images, logs, caches, artifacts | R2 |
132| Accounts, organizations, tokens, invites, notifications, audit log | D1, read through the Sessions API for read replicas |
133| Webhooks, notifications, email | Queues, with dead-letter queues, and Email Sending |
134| Workflow runs (durable, survive restarts, 6-hour job timeout) | Workflows |
135| Job runners, agent sandboxes and import transfers | Containers (an Ubuntu 24.04 image in `containers/runner`) |
136| Scheduled workflows (`on: schedule`) | Cron Triggers |
137| Live logs and pull request updates | Durable Object WebSockets with hibernation |
138| Sign-in | Passkeys (WebAuthn); Cloudflare Access guards only `/auth/access`, the email recovery path |
139
140More in [Architecture](https://diffinery.com/docs/self-hosting/architecture).
141
142## Develop locally
143
144```sh
145pnpm install
146pnpm -r build && pnpm -r typecheck && pnpm -r test
147pnpm --filter @diffinery/app db:migrate:local
148pnpm dev # http://localhost:8787, signed in as dev@diffinery.local
149pnpm --filter @diffinery/app e2e # wrangler dev, real git, the runner agent and Chromium
150```
151
152`pnpm dev` runs the Worker under `wrangler dev` with local D1, R2 and queues, so you need no Cloudflare account to work on Diffinery. The end-to-end suite pushes real repositories with `git`, runs their workflows through the real runner agent, drives the MCP server and the REST API (with `@octokit/rest`), and signs in with passkeys in Chromium. See [CONTRIBUTING.md](CONTRIBUTING.md).
153
154## Repository layout
155
156```
157apps/diffinery the Worker: web UI, git, REST/GraphQL, MCP, Actions, D1 migrations, docs, e2e tests
158apps/cli the `diffinery` command-line client
159apps/vscode the VS Code, Cursor and Windsurf extension
160apps/jetbrains the JetBrains IDE plugin
161plugins the Claude Code and Codex plugins (marketplaces in .claude-plugin/ and .agents/plugins/)
162containers/runner the runner agent, sandbox server and the container image
163packages/git-core git objects, packfiles, deltas, diff and merge, in pure TypeScript
164packages/workflow-yaml the GitHub Actions workflow parser, expressions, matrices and cron
165packages/shared types shared by the Worker and the runner
166scripts setup, bootstrap and deploy scripts for Cloudflare
167```
168
169## What Diffinery doesn't do (yet)
170
171Diffinery is young, and we'd rather you know its limits before you move:
172
173- **Hosted runners are Linux x64 only.** macOS, Windows and Arm jobs need [self-hosted runners](https://diffinery.com/docs/actions/runners#self-hosted-runners).
174- **HTTPS only for Git.** There's no SSH access.
175- **No forks.** Pull requests are between branches of the same repository.
176- **No wikis, discussions, Pages-style sites, Codespaces-style cloud editors or app marketplace.**
177- **Reviews are simpler than GitHub's.** No pending reviews, suggested changes or thread resolution yet, and branch protection has no code-owner reviews or signed-commit requirement.
178- **Some GitHub events**, such as `issues` and `issue_comment`, are accepted in workflows but never start a run.
179- **No hosted service.** Nobody runs Diffinery for you: you deploy your own instance.
180
181The full lists are in [Compatibility with GitHub Actions](https://diffinery.com/docs/actions/compatibility) and [Diffinery vs GitHub](https://diffinery.com/compare/github), and where we'd like to go next is in the [roadmap](ROADMAP.md).
182
183## FAQ
184
185**What is Diffinery?**
186An open-source git forge and CI platform that runs entirely on Cloudflare. It replaces GitHub's code hosting, pull requests and GitHub Actions in one app that you deploy to your own Cloudflare account.
187
188**Is Diffinery an open-source GitHub Actions alternative?**
189Yes. Diffinery runs GitHub Actions workflow files from `.github/workflows/` with the same triggers, expressions, matrices, `needs`, reusable workflows, environments, secrets, OIDC, service containers and Docker, and downloads and runs marketplace actions (`uses: owner/repo@ref`). Every known difference is listed in [Compatibility with GitHub Actions](https://diffinery.com/docs/actions/compatibility).
190
191**Is Diffinery a self-hosted GitHub alternative?**
192Yes. Like Gitea, Forgejo or GitLab, you run it yourself, but instead of a server or a Kubernetes cluster it deploys to Cloudflare's serverless platform, and its CI runs GitHub Actions workflow files instead of a format of its own.
193
194**How is Diffinery different from Gitea and Forgejo?**
195All three are open-source forges you run yourself. Gitea and Forgejo run on your own servers, with runner machines you install for CI. Diffinery runs only on Cloudflare: there are no servers or runner machines to look after, and each CI job gets a fresh container, but your code lives on Cloudflare's infrastructure. Gitea and Forgejo have wikis and a package registry, which Diffinery doesn't. See [Diffinery vs Gitea and Forgejo](https://diffinery.com/compare/gitea).
196
197**Is Diffinery an alternative to Blacksmith or Depot?**
198For a different kind of team. Blacksmith and Depot keep your code and pull requests on GitHub and run your jobs on faster machines, for a per-minute price. Diffinery replaces GitHub as well: your repositories move to your own instance, and your jobs run on 4-vCPU runners that your Cloudflare account pays for by the 10 ms. If you want to stay on GitHub and run nothing yourself, a runner service is the simpler choice. See [Diffinery vs Blacksmith](https://diffinery.com/compare/blacksmith) and [vs Depot](https://diffinery.com/compare/depot).
199
200**Do my GitHub Actions workflows run without changes?**
201Most do. Diffinery reads `.github/workflows/*.yml` with the same syntax and runs marketplace actions. Jobs that need hosted macOS, Windows or Arm runners need a self-hosted runner. See [Compatibility with GitHub Actions](https://diffinery.com/docs/actions/compatibility).
202
203**Is Diffinery faster than GitHub Actions?**
204We don't run jobs on GitHub to benchmark it, so we don't claim a speed-up figure. Diffinery's default runner has 4 vCPUs and 12 GiB, while GitHub's standard Linux runner for private repositories has 2 vCPUs and 8 GB, so jobs that use several cores get twice as many. On Diffinery, jobs start about 3 to 5 seconds after they're queued. See the [measured performance](https://diffinery.com/performance).
205
206**Can I run Diffinery CI while my code stays on GitHub?**
207Yes. A small GitHub workflow mirrors every push to your Diffinery instance, which then runs the same `.github/workflows/` files, and can fail the GitHub job when the runs on Diffinery fail. See [Run Diffinery CI while your code stays on GitHub](https://diffinery.com/docs/guides/mirror-from-github).
208
209**What does it cost to run?**
210Diffinery is free and open source under the Apache License 2.0, with no paid edition. Running it costs whatever your own Cloudflare account bills: the Workers Paid plan plus usage. Hosted runners are Cloudflare Containers, which bill only while a job runs.
211
212**Does it run on Cloudflare's free plan?**
213No. Containers, Durable Objects with SQLite, Workflows and Queues need the Workers Paid plan. See [Deploy your own Diffinery](https://diffinery.com/docs/self-hosting/deploy).
214
215**Does it work with AI coding agents?**
216Yes. Agents connect over MCP (`https://<your host>/mcp`), the REST API, git or the GitHub CLI. There are guides for Claude, Claude Code, Codex, Cursor and VS Code, and a plugin for Claude Code and Codex, installable with `claude plugin marketplace add https://diffinery.com/codician/diffinery.git` (sources in [`plugins/`](plugins)). See [Connect AI apps](https://diffinery.com/docs/connect).
217
218**Can an AI agent merge its own pull request?**
219Not by default. Unless a branch protection rule allows it, agents can't push to or merge into protected branches, their pull requests need a person's approval, their check results never satisfy required checks, and runs of code they pushed get no secrets. See [Guardrails](https://diffinery.com/docs/agents/overview#guardrails).
220
221**Can I move my repositories from GitHub?**
222Yes. The importer brings a repository or a whole organization with history, issues, pull requests, reviews and releases. Secret names come over with a field to enter each value. `gh`, Octokit, VS Code and JetBrains IDEs work against Diffinery. See [Migrate from GitHub](https://diffinery.com/docs/migrate-from-github).
223
224**Can I sign up on diffinery.com?**
225Not directly. diffinery.com is the project's home and the instance Diffinery is developed on, and accounts there are by invitation. To try Diffinery there before deploying your own, [request early access](https://diffinery.com/early-access). It isn't a hosted service for teams: to use Diffinery for your work, deploy your own instance.
226
227**Is Diffinery the only Git platform on Cloudflare?**
228No. Other open-source projects run Git or CI on Cloudflare too, and [Built on Cloudflare](https://diffinery.com/built-on-cloudflare#other-git-and-ci-projects-on-cloudflare) lists how they differ. As far as we know, Diffinery is the one where Git hosting, pull requests with reviews in a web UI and GitHub Actions–compatible CI with marketplace actions all run on Cloudflare (checked October 25, 2026).
229
230**Where is development happening?**
231On Diffinery itself, at [diffinery.com/codician/diffinery](https://diffinery.com/codician/diffinery). Diffinery's own CI, deploys and pull requests run there. The GitHub repository is a mirror, and issues and pull requests are welcome in either place; see [CONTRIBUTING.md](CONTRIBUTING.md).
232
233## Contributing, security and license
234
235- **Contributing:** see [CONTRIBUTING.md](CONTRIBUTING.md), and [AGENTS.md](AGENTS.md) if you're an AI coding agent. Please follow the [Code of Conduct](CODE_OF_CONDUCT.md). Questions go to [SUPPORT.md](SUPPORT.md).
236- **Roadmap and changes:** [ROADMAP.md](ROADMAP.md) and [CHANGELOG.md](CHANGELOG.md).
237- **Security:** please don't open public issues for vulnerabilities. Report them privately as described in [SECURITY.md](SECURITY.md).
238- **Citing Diffinery:** use GitHub's "Cite this repository" button, or [CITATION.cff](CITATION.cff).
239- **License:** [Apache License 2.0](LICENSE). See [NOTICE](NOTICE).