opral/lix
Embeddable version control system for files and tables.
Lix – Version‑control for files and SQL tables
What it is
- A library that lets you treat a collection of ordinary files (text, binaries, CAD, video, …) and relational tables as a single version‑controlled repository.
- The whole thing lives inside a single ACID OLTP database, so you can query the history of files and rows with normal SQL.
Why it matters
- Traditional VCSs (Git, Mercurial) only version raw bytes. When an app stores its state in a database, you either keep that database separate or dump the whole file into Git, which makes reviewing, merging and rolling‑back row‑level changes painful.
- Lix bridges that gap: a branch can contain a code change and the corresponding row updates, and you can diff/merge both.
Key features
| Feature | What you get |
|---|---|
| Any file | Text, binaries, large media. Plugins give structured diffs for Markdown, CSV, etc.; other formats fall back to whole‑file history. |
| SQL tables | Define tables in the repository; rows are versioned just like files. |
| Database‑backed | All data lives in one ACID database; you can run SQL queries over millions of rows. |
| Real‑time collaboration | Multiple users or agents see changes as they happen. |
| Embeddable | Runs in‑process as a library. Storage back‑ends: in‑memory, filesystem, browser OPFS, or S3. |
| Planned permissions | Per‑file/group ACLs stored and versioned alongside everything else. |
How you use it
- Install the JavaScript SDK (
@lix-js/sdk) and a storage implementation, e.g.@lix-js/storage-filesystem. - Open a repository pointing at a folder (or a remote server) and start issuing SQL statements.
import { openLix } from "@lix-js/sdk";
import { FilesystemStorage } from "@lix-js/storage-filesystem";
const lix = await openLix({
storage: new FilesystemStorage({ path: "./repo" }),
});
await lix.execute(
"INSERT INTO lix_file (path, content) VALUES ($1, $2)",
["/notes/status.txt", new TextEncoder().encode("ready")]
);
- Changes are automatically committed; you can later query the
lix_changetable to build UI diff/undo panels.
Typical use cases
- Co‑locate code, docs, and app state – keep a script, its design doc, and the database rows it manipulates in one branch for easy review.
- Per‑customer repositories – SaaS products give each tenant a private Lix repo that stores their automations, documents, and business data, enabling built‑in audit trails and roll‑backs.
- Versioned workflows – embed Lix in an internal tool so every write to your own tables is automatically versioned, giving you history, blame and branching without extra engineering.
Status
- The project is in alpha. SDKs exist for JavaScript/TypeScript and Rust; Python and Go are planned.
- A hosted service called LixRay offers a cloud‑hosted repository that integrates with LLMs like Claude, OpenAI, and Gemini.
Where to learn more
- Quick‑start guides for JavaScript and Rust.
- Full docs at https://lix.dev/docs.
- Community Discord and the GitHub repo for issues and contributions.
Lix is not an AI model itself, but it is positioned as infrastructure that can be used by AI agents (e.g., LLM‑driven assistants) to store and version their generated files and database updates.
Related
- Project
- Project
- Project
- Project
- Project