橡木
橡木
README.md
95 行 · 3.9 KB
Oak
本仓库是 Oak 的开源核心:为智能体速度而生的版本控制系统。它作为一个 Cargo 工作区开发,包含一个可复用的 VCS 库以及供智能体驱动的 oak 命令行客户端。
自带你的智能体(Claude Code、Codex、Cursor……);Oak 是它读取、写入、分支和协作所依赖的基础设施。这个底层架构完全围绕智能体的实际工作方式设计——以每会话分支作为工作单元,用分支描述替代每次提交的消息,以及内容寻址的懒加载挂载,让智能体在数秒内即可编辑任何仓库。由于采用内容寻址并按需加载,它在智能体工作负载下远比 git 更快——但速度是设计的结果,而非卖点。
| 包 | 路径 | crates.io | 功能说明 |
| oakvcs-core | core/ | oakvcs-core | VCS 基础:BLAKE3 内容哈希、内容定义分块、差异/合并、Blob/Manifest/Commit/Tree 数据模型,以及可选的客户端本地仓库(SQLite + git 后端)。 |
| oakvcs-cli | cli/ | oakvcs-cli | 构建于 oakvcs-core 之上的 oak 二进制程序。 |
在自己的项目中使用该库
oakvcs-core 可独立使用——例如,为另一个工具或引擎构建 Oak 集成。关闭默认特性,仅引入内容寻址数据模型和哈希功能(不含 SQLite/git):
[dependencies]
oakvcs-core = { version = "0.99.0", default-features = false }
该包以 oakvcs-core 名称发布,但导入时使用 oak_core。
当你还需要磁盘上的 Repository(SQLite + 只读 git)后端时,请添加默认的 local-repo 特性。
安装 CLI
Oak 处于公开测试阶段(v0.99.0)。最快的方式是使用预构建的 oak 二进制程序:
curl -fsSL oak.space/install | sh
安装程序支持 macOS(Apple Silicon)和 Linux(x86_64)。安装后,运行 oak upgrade 即可原地更新二进制程序。
Windows(x86_64)
curl … | sh 安装程序仅适用于 Unix。在 Windows 上,请从最新的 GitHub 发布版中获取预构建的 oak-windows-x86_64.exe(重命名为 oak.exe 并放入 PATH),或通过 cargo install oakvcs-cli 从 crates.io 构建。之后 oak upgrade 会原地更新它。
Windows 上的 oak mount 使用投影文件系统(Projected File System,ProjFS),这是一个可选的 Windows 功能。请在提升权限的 PowerShell 中为每台机器启用一次:
Enable-WindowsOptionalFeature -Online -FeatureName Client-ProjFS -NoRestart
(或 设置 → 应用 → 可选功能 → “Windows 投影文件系统”)。除此之外的所有操作——克隆、推送、拉取、提交——无需它即可正常工作。
更倾向于从 crates.io 构建?改用 Cargo 安装(适用于 macOS、Linux 和 Windows——TLS 栈使用 rustls + ring,因此不需要 C/NASM 构建工具链):
cargo install oakvcs-cli # builds and installs the `oak` binary
从源码构建
cargo build --workspace # builds oak-core + the oak binary
cargo test -p oakvcs-cli # CLI tests (incl. wiremock HTTP tests)
make build # release build + the CLI release tooling
make release-proof # non-mutating launch/release readiness proof
CLI 通过工作区内的路径依赖 oak-core,因此直接运行 cargo build 即可针对本地的 core/ 检出目录进行构建,无需额外设置。关于发布验证和 crates.io 发布顺序检查,请参见 docs/release-readiness.md。
许可证
Apache-2.0。参见 LICENSE。
AI
本仓库几乎完全由 AI 编写,并有人类监督。如果您发现任何需要修复的问题或希望做出贡献,请发送邮件至 [email protected] 或通过 Discord 联系我们。
| 1 | # Oak
|
| 2 |
|
| 3 | This repository is the open-source heart of [Oak](https://oak.space):
|
| 4 | **version control at the speed of agents**. It's developed as a Cargo
|
| 5 | workspace: a reusable VCS library plus the `oak` command-line client that
|
| 6 | agents drive.
|
| 7 |
|
| 8 | Bring your own agent (Claude Code, Codex, Cursor, …); Oak is the foundation
|
| 9 | it reads, writes, branches, and collaborates through. The substrate is shaped
|
| 10 | around how agents actually work — branch-per-session as the unit of work,
|
| 11 | branch descriptions in place of per-commit messages, and content-addressed
|
| 12 | lazy mounts that get an agent editing any repo in seconds. Because it's
|
| 13 | content-addressed and hydrates on demand, it's also far faster than git for
|
| 14 | agent workloads — but the speed is a consequence of the design, not the pitch.
|
| 15 |
|
| 16 | | Crate | Path | crates.io | What it is |
|
| 17 | |
| 18 | | `oakvcs-core` | [`core/`](core/) | [`oakvcs-core`](https://crates.io/crates/oakvcs-core) | The VCS foundation: BLAKE3 content hashing, content-defined chunking, diff/merge, the Blob/Manifest/Commit/Tree data model, and an optional client-side local repository (SQLite + git backends). |
|
| 19 | | `oakvcs-cli` | [`cli/`](cli/) | [`oakvcs-cli`](https://crates.io/crates/oakvcs-cli) | The `oak` binary that builds on `oakvcs-core`. |
|
| 20 |
|
| 21 | ## Using the library in your own project
|
| 22 |
|
| 23 | `oakvcs-core` is usable on its own — e.g. to build an Oak integration into
|
| 24 | another tool or engine. Pull in just the content-addressed data model and
|
| 25 | hashing (no SQLite/git) with default features off:
|
| 26 |
|
| 27 | ```toml
|
| 28 | [dependencies]
|
| 29 | oakvcs-core = { version = "0.99.0", default-features = false }
|
| 30 | ```
|
| 31 |
|
| 32 | The crate is published as `oakvcs-core` but imported as `oak_core`.
|
| 33 |
|
| 34 | Add the default `local-repo` feature when you also want the on-disk
|
| 35 | `Repository` (SQLite + read-only git) backends.
|
| 36 |
|
| 37 | ## Installing the CLI
|
| 38 |
|
| 39 | Oak is in **public beta** (v0.99.0). The quickest way in is the prebuilt
|
| 40 | `oak` binary:
|
| 41 |
|
| 42 | ```bash
|
| 43 | curl -fsSL oak.space/install | sh
|
| 44 | ```
|
| 45 |
|
| 46 | The installer supports **macOS (Apple Silicon)** and **Linux (x86_64)**.
|
| 47 | After install, `oak upgrade` updates the binary in place.
|
| 48 |
|
| 49 | ### Windows (x86_64)
|
| 50 |
|
| 51 | The `curl … | sh` installer is Unix-only. On Windows, grab the prebuilt
|
| 52 | `oak-windows-x86_64.exe` from the [latest GitHub
|
| 53 | release](https://github.com/oakdotspace/oak/releases/latest) (rename it to
|
| 54 | `oak.exe` and put it on your `PATH`), or build from crates.io with
|
| 55 | `cargo install oakvcs-cli`. `oak upgrade` then updates it in place.
|
| 56 |
|
| 57 | `oak mount` on Windows uses the **Projected File System (ProjFS)**, an optional
|
| 58 | Windows feature. Enable it once per machine from an elevated PowerShell:
|
| 59 |
|
| 60 | ```powershell
|
| 61 | Enable-WindowsOptionalFeature -Online -FeatureName Client-ProjFS -NoRestart
|
| 62 | ```
|
| 63 |
|
| 64 | (or Settings → Apps → Optional features → "Windows Projected File System").
|
| 65 | Everything else — clone, push, pull, commit — works without it.
|
| 66 |
|
| 67 | Prefer to build from crates.io? Install with Cargo instead (works on macOS,
|
| 68 | Linux, and Windows — the TLS stack uses rustls + `ring`, so no C/NASM build
|
| 69 | toolchain is required):
|
| 70 |
|
| 71 | ```bash
|
| 72 | cargo install oakvcs-cli # builds and installs the `oak` binary
|
| 73 | ```
|
| 74 |
|
| 75 | ## Building from source
|
| 76 |
|
| 77 | ```bash
|
| 78 | cargo build --workspace # builds oak-core + the oak binary
|
| 79 | cargo test -p oakvcs-cli # CLI tests (incl. wiremock HTTP tests)
|
| 80 | make build # release build + the CLI release tooling
|
| 81 | make release-proof # non-mutating launch/release readiness proof
|
| 82 | ```
|
| 83 |
|
| 84 | The CLI depends on `oak-core` via an in-workspace path, so a plain
|
| 85 | `cargo build` works against the local `core/` checkout with no extra setup.
|
| 86 | See [`docs/release-readiness.md`](docs/release-readiness.md) for the release
|
| 87 | proof and crates.io publish-order checks.
|
| 88 |
|
| 89 | ## License
|
| 90 |
|
| 91 | Apache-2.0. See [LICENSE](LICENSE).
|
| 92 |
|
| 93 | ## AI
|
| 94 |
|
| 95 | This repo was written almost entirely using AI with human oversight. If you see anything that needs fixed or would like to contribute, please email [email protected] or reach out on [Discord](https://discord.gg/UUPfUaeDnS).
|