README.md
Koh
Version control designed for the solo developer.
Most version control is built for teams, with branches to keep people out of each other's way, pull requests to argue in, and merge tools for when two people edited the same line. On your own you need none of that. You need to save your work, see what changed, go back when something breaks, and pick up on your laptop where you left off on your desktop.
That's all Koh does.
koh init
koh save "sketch the parser"
koh status
koh view
koh undo # step back one save, without losing it
koh offer # send your saves to your bucket
koh steal # on the other machine: bring them in
How it thinks
Nothing is erased. Your history is one straight line, and every command adds
to it. Undo, revert and load don't rewind anything. They record a new save
that puts the files back, so the save you stepped away from is still there
tomorrow. The only exception is strip, for the day a secret gets saved,
and it makes you type the path twice before it does anything.
Everything lives in one file. A repo's whole history is .koh, a single
SQLite file at the root, and there's nothing else to maintain. Copy that file
and you've copied the whole history.
Your machines, not a server. Point Koh at an S3 bucket or a folder on a
disk once per machine with koh remote, and every save is offered to it
automatically. If you worked on both machines without syncing, koh steal
combines them file by file. A file changed on only one side just comes along.
A file changed on both sides is shown to you, and you pick which version to
keep. Your version isn't thrown away either way: the save it came from stays
in history.
Safe to hand to an agent. Every command has --json, never waits for
input when nothing is typing, and exits 0, 1 or 2. Saves record which agent
made them and in which session, so koh undo --session can take back an
agent's whole run in one step. A person has to be at the keyboard to strip.
Small on purpose. Koh 3 has 20 commands plus the manual, down from Koh 2's 45, and a hard ceiling of 12,000 lines of V. A feature that doesn't fit gets cut, so one person can still read all of it.
Setting up sync
koh remote # asks: a folder, or an S3 bucket?
It tests the remote before saving anything. Scripts can skip the questions:
KOH_ACCESS_KEY=... KOH_SECRET_KEY=... \
koh remote s3 https://s3.fr-par.scw.cloud my-bucket fr-par
koh remote folder /Volumes/usb/koh
Or write the two files yourself. koh man remote shows the format.
~/.config/koh/remote kind, endpoint, bucket, region (or path)
~/.config/koh/credentials access_key, secret_key, mode 600
In your prompt
shell/koh3.plugin.zsh puts the repo in your zsh prompt and adds tab
completion:
kiln · v2.1.0 · 6 saves · 4.2 MB !
→
! means unsaved changes, and ⚑ means the save you're on has been flagged.
Source it from ~/.zshrc. The comments at the top cover Starship,
Powerlevel10k and using your own prompt.
Status
Koh supports Apple silicon macOS and Linux on x86_64 and ARM64. Intel macOS is no longer supported for new releases.
Install Koh with:
curl -fsSL https://koh.asha.software/install.sh | sh
The installer checks the release checksum and offers the optional zsh plugin.
Koh 2 users can run koh update and confirm the upgrade, then koh migrate
in each repository. Save unfinished work with Koh 2 first. Migration keeps
save IDs and archives the old data in .koh-v2/; Koh 3 refuses repository
commands until migration is complete. The specification is
docs/koh-kepr-3-master-spec.md.
Building
v -o build/koh3 src/koh.v # or -prod for a release build
v test src/ && v test tests/
v fmt -verify src/ tests/
Koh is pinned to V master at b9a2d87, because V master can break it. SQLite
3.49.1 is vendored and compiled in, so there are no other dependencies.
AGENTS.md has the install steps for the pinned V, the Linux notes and the
layout.