README.md
Oxygen
Oxygen (oxy) is a distributed, commutative version control system written in Rust for large repositories. See docs/spec.md for the specification, docs/guide.md for a user guide by task, and docs/protocol.md if you are implementing a client or server.
It is self-hosting: this directory is an Oxygen repository, and the project's own history is kept with oxy, not with Git.
Working with agents
An AI agent works in Oxygen under a key of its own, which you delegate to for a scope and a time. For example:
oxy identity delegate add agent.identity --scope changes --expires 8h
Every change the agent makes is attributed to you and signed by the agent. oxy log, oxy verify and the hub therefore show who did the work, such as "Andy McCall Β· via Claude Code", and a policy can require that a person has approved it before it lands.
An agent can also work through oxy mcp, an MCP server for the repository: typed tools instead of a shell, signing as the identity it was started with, and nothing destructive unless you allow it (see docs/mcp.md).
See docs/ai_native_agent_workflows.md for the design and docs/guide.md Β§9 for the setup.
What is different
- History is a set of changes, not a chain of snapshots. A change records what it did to identified lines and tree nodes and which earlier changes it depends on. Changes that do not depend on each other commute, so there are no merge commits and rebasing independent work rewrites nothing.
- Conflicts are data. A conflicted state can be committed, pushed and pulled. Resolving one is an ordinary edit followed by a commit.
- Every change has a stable ID and a content hash. The ID survives rewrites; the hash makes history tamper-evident.
- Everything is signed. Composite Ed25519 + ML-DSA-65 signatures on changes and on every bookmark update, verified against a trust policy that lives in the repository.
- Every operation is undoable through an operation log.
- Large files are chunked with content-defined chunking into a BLAKE3-addressed store.
Status
Early, but usable for its own development. Implemented: the object model, the change graph with conflict detection and resolution, the working copy (status, commit, checkout, diff, undo), identities and signatures, remotes over local paths and HTTP(S) with clone, fetch, pull, push, the reference server oxy serve, the trust policy, and packed storage.
Not yet: checkpoints for very long histories, history editing (rebase, split, edit), multiple workspaces, garbage collection with retention, and the Thin client profile for constrained machines.
Install
Builds for Linux, macOS, Windows and Haiku are on the releases page. These are early releases: the macOS and Windows builds are not signed and have had little testing.
-
Debian, Ubuntu and other Linux with apt (x86_64, arm64 or riscv64): add the repository at https://oxygenhub.io/apt and install with apt, so
apt upgradekeeps oxy current:sudo curl -fsSLo /usr/share/keyrings/oxygenhub-archive-keyring.gpg https://oxygenhub.io/apt/oxygenhub.gpg sudo tee /etc/apt/sources.list.d/oxygenhub.sources >/dev/null <<EOF Types: deb URIs: https://oxygenhub.io/apt Suites: stable Components: main Signed-By: /usr/share/keyrings/oxygenhub-archive-keyring.gpg EOF sudo apt update && sudo apt install oxyOr download
oxy_VERSION_amd64.deb(or_arm64,_riscv64) from a release and runsudo apt install ./oxy_VERSION_amd64.deb: from 0.3.1 it adds the repository by itself. It needs glibc 2.28 or later (Debian 10, Ubuntu 20.04 and newer). The repository's key is82DD DD14 8BC9 0BDF 6006 09E9 522E 288F 265B DE6F. -
Other Linux: unpack
oxy-VERSION-linux-x86_64.tar.gz(or-linux-arm64) and putoxyon yourPATH. -
macOS (Apple Silicon or Intel): unpack
oxy-VERSION-macos-arm64.tar.gz(or-macos-x86_64), thenxattr -d com.apple.quarantine oxy, since the build is not notarised, and put it on yourPATH. -
Windows: unzip
oxy-VERSION-windows-x86_64.zipand put the folder on yourPATH. SmartScreen may warn on first run, since the build is not signed. -
Haiku (R1/beta6, x86_64): unpack
oxy-VERSION-haiku-x86_64.tar.gzand copyoxyto~/config/non-packaged/bin. It is built in a Haiku guest rather than by OxygenFlow, so it has its ownSHA256SUMS-haikuand no build attestation.
oh, the OxygenHub command line, is released the same way from OxygenHub's releases.
Check a download against the release's SHA256SUMS with sha256sum -c SHA256SUMS --ignore-missing.
Building
cargo build --release
cargo test --workspace
The binary is target/release/oxy.
On Haiku, install rust_bin and zstd_devel with pkgman and build with ZSTD_SYS_USE_PKG_CONFIG=1 cargo build --release: zstd-sys then links Haiku's libzstd, since a system library also references zstd and ld refuses the bundled copy's hidden symbols.
Changelog: a commit that changes code adds a line under ## Unreleased in CHANGELOG.md (Added, Changed, Fixed or Security, with the issue number); versions change only at release. scripts/changelog-check.sh [PATH...] checks it for the paths a commit takes (the working copy's changes without any) and runs in the gate; NO_CHANGELOG=1 for code changes users won't notice.
Quick start
oxy identity create --name "Your Name" --email [email protected]
oxy config --user core.sign change # sign every commit
oxy init # in a project directory
oxy status
oxy commit -m "First change"
oxy log # -n 10 for the latest ten, -v for full messages
oxy log -r 'v0.3.1..main & author(me)' # a revset: set algebra over history
Output uses colour, glyphs, and relative times on a UTF-8 terminal, and
falls back to plain ASCII when piped, with --plain, or with NO_COLOR set.
Collaborating through a hub such as OxygenHub: sign in once, in the browser, and every repository on that hub clones, fetches and pushes with it.
oxy auth login https://oxygenhub.io
oxy clone https://oxygenhub.io/owner/project
oxy push
oxy pull
Or with your own server:
oxy serve --root /srv/oxy --bind 0.0.0.0:8890 --tls-cert cert.pem --tls-key key.pem --token SECRET
echo SECRET | oxy auth login https://host:8890 --with-token
oxy clone https://host:8890/project
A repository kept on your own storage, with no server in between (Oxygen
Strata, see docs/strata.md): a bucket in your cloud account, in your
region, under your keys, or a directory on a shared drive.
oxy remote add cloud s3://my-bucket/repos/project --profile work # or gs://, az://, dir://
oxy remote check cloud # reachable, what it holds, and that it behaves
oxy push cloud
oxy clone s3://my-bucket/repos/project?profile=work
Trust policy, so a server accepts only changes from keys you have granted:
oxy policy init # your key becomes the root
oxy identity export # a contributor sends you this file
oxy policy grant alice.identity
oxy push # publishes the policy
Bookmarks (oxy bookmark create|switch, oxy merge), submodules (oxy submodule add|update),
partial commits (oxy commit PATH.., oxy commit -i), oxy blame, oxy bisect, oxy squash and
oxy rebase cover the everyday Git toolbox; see the guide.
Working alongside Git: oxy git import <repo> <dest> converts a Git history, oxy git fetch <url>
brings new commits of a Git remote into the bookmark, oxy git push <url> publishes the bookmark as
commits on top of them, and oxy git export <dir> writes a plain Git mirror.
Keys have a lifecycle: oxy identity rotate moves to a fresh key pair (the policy follows),
oxy identity renew --expires 365 sets an expiry, oxy identity delegate add agent.identity --scope changes --expires 8h
lets another key sign changes for you (an AI agent, say) for a while without ever being able
to move a bookmark, and oxy identity revoke retires a key. With several root
keys, oxy policy root add|remove|threshold and oxy policy sign gather the required signatures
through proposal files.
Layout
| Path | Contents |
|---|---|
crates/oxy-core | Library: encoding, hashing, objects, the change graph, storage, identities, policy, protocol, repository operations |
crates/oxy-server | Reference HTTP(S) server for the wire protocol |
crates/oxy-strata | The S3, Google Cloud Storage and Azure stores a repository can be kept on |
src/cli | The oxy command-line interface |
docs/spec.md | The specification |
docs/guide.md | User guide, organised by task |
docs/strata.md | Keeping a repository on your own storage: S3, GCS, Azure, a directory |
docs/protocol.md | Wire protocol for other implementers |
docs/prompt.md | Shell prompt integration |
docs/mcp.md | oxy mcp: the repository as tools for AI agents |
Licence
MIT or Apache-2.0, at your option (see LICENSE).