iTranslated by AI
Achieving P2P Collaborative Development with bit + bit-relay
I have been working on a tool for collaborative development without GitHub, and it has finally reached a point where it is minimally functional, so I would like to introduce it.
It is primarily intended for use by both humans and AI.
Introduction to bit + bit-relay
- bit is a git-compatible CLI tool + α (passes 25,000 e2e tests from Git core)
- bit-relay performs
bit clone/bit pushvia a P2P relay server without going through GitHub - It has built-in issue and PR storage as bit's own storage, enabling PR-equivalent functionality without GitHub
- It is mainly intended as a backend for AI agent orchestration
bit itself includes extensions not found in git, such as subdirectory checkout. (Details omitted)
Simple Usage Example
On the host side:
# cd <your-project>
$ bit relay serve relay+https://bit-relay.mizchi.workers.dev # You can host the relay server yourself
Session registered: qrcBUqKP
Clone URL: relay+https://bit-relay.mizchi.workers.dev/qrcBUqKP
Waiting for requests... (Ctrl-C to stop)
Pass this URL to the user: relay+https://bit-relay.mizchi.workers.dev/qrcBUqKP
$ bit clone relay+https://bit-relay.mizchi.workers.dev/qrcBUqKP local-project
That's the basic functionality.
Note: Since this communication is visible to other participants who are also running bit serve, it is intended for OSS projects that are safe to make public.
I'll explain a bit more from here, including collaboration.
Installing bit
# Shell script (Mac/Linux)
curl -fsSL https://raw.githubusercontent.com/bit-vcs/bit/main/install.sh | bash
# MoonBit package manager
moon install mizchi/bit/cmd/bit
Quick Start
Create a repository and share issues
# Create a repository
mkdir my-project && cd my-project
bit init
echo "# My Project" > README.md
bit add . && bit commit -m "initial commit"
# Initialize issue tracking
bit issue init
# Create an issue
bit issue create -t "Crashes on login page" -b "Occurs when special characters are input"
# Push issues to the relay
bit relay sync push relay+https://bit-relay.mizchi.workers.dev
Publish the repository via relay
bit relay serve relay+https://bit-relay.mizchi.workers.dev
# => Clone URL: relay+https://bit-relay.mizchi.workers.dev/AbCdEfGh
The other party clones and retrieves issues
bit clone relay+https://bit-relay.mizchi.workers.dev/AbCdEfGh myapp
cd myapp
bit issue init
bit relay sync fetch relay+https://bit-relay.mizchi.workers.dev
bit issue list
With just this, you can share repositories and issues without GitHub.
Concepts of bit + bit-relay
Decentralized Issue/PR Management
On GitHub, issues and PRs reside on the GitHub server. In bit, they are saved inside the repository as Git notes (refs/notes/bit-hub).
- Issues/PRs become part of the repository data and do not depend on a specific hosting service.
- They can be synchronized between peers without a central server.
- You can initialize it in any git repository with
bit issue init.
bit-relay — A Relay Server for Sharing
bit-relay is a lightweight relay server that solves two problems:
-
Repository sharing across NAT/Firewalls: Using
bit relay serve, you can publish a local repository via relay so others canbit cloneit. No port forwarding required. -
Synchronization of hub metadata:
bit relay sync push/fetchdistributes and retrieves issues/PRs via the relay.
Code (blob/tree/commit) is transferred via serve/clone, while hub metadata (issue/PR) is transferred via sync push/sync fetch. These are independent operations.
By default, the relay uses a public instance (bit-relay.mizchi.workers.dev) deployed from this project. You can also deploy your own instance.
Since it is a distributed environment, you can request git/objects from all peers currently running bit relay serve as a distributed KV store.
Why bit + bit-relay is needed
The Git protocol was originally designed as a distributed storage system. However, in reality, GitHub has become the authoritative server. While this is practical for selecting stable branches, it doesn't align well with development cycles that assume the high-speed productivity of AI Agents. I believe it should be possible to create branches more freely, choose upstreams more flexibly, and allow a large number of forks for different purposes.
As the author of bit, I have no political stance on decentralization. I simply believe there is a technical advantage in it for development workflows. Ultimately, I think it is easier for operations if things developed via P2P are synced to GitHub, and volatile P2P caches are not reliable enough for long-term storage.
bit + bit-relay is implemented as a P2P relay server. Autonomous AI agents join the development nodes based on the bit protocol, broadcast changes, and everyone incorporates them as they see fit — this is Git's true form as distributed storage. In the model of an OSS developer, autonomous agents given direction explore possibilities. Finally, a human reviews the results and selectively incorporates them. Decentralized Git is necessary to accelerate this cycle.
Specifically, while bit relay serve is running, changes made by someone via P2P are automatically saved as .git/objects and refs/relay/incoming/... across P2P nodes (with a maximum acceptance size limit). Users and AI can then cherry-pick any changes they like locally. If this model works well, the most useful branch should be treatable as a de facto fast-forward, much like a blockchain.
That said, currently there are only simple mechanisms for fetch/clone/sync/PR, and many more features will likely be needed:
- Synchronization between multiple relay servers
- A mechanism to share PRs/issues with GitHub
- Closed localhost relays
- A feature for relay servers to hold a cache for several days as backup
- Prompts to help AI understand this cycle
At present, it is being developed as a hobby-level PoC, and I am looking for people or companies to support it. Much is still missing — the effort to guarantee full compatibility with Git, SDKs and documentation to integrate this, and the knowledge gained from actually operating agent clusters.
Seeking Developers/Sponsors
If you feel a future in this concept, please contact me at https://x.com/mizchi
Feature requests can be made here: https://github.com/bit-vcs/bit-relay
Discussion