koh

@june

Koh is version control for the solo developer.

V

v3.8.7 · 308 saves · 15,477 lines · updated 1 week ago

73 files
8aa3154c04f0
back to HEAD
src/257.1 KB · 2 months ago
apply/6.7 KB · 2 months ago
cli/70.6 KB · 2 months ago
args.vCommand line parsing.2.0 KB · 2 months agocli.vCommand line entry: dispatch table, usage text and exit codes.3.3 KB · 2 months agocmd_back.vGoing back: koh undo, koh revert and koh load.7.0 KB · 2 months agocmd_diff.vkoh diff — unified diff of the working tree against a save, of one save against another, or across a session.3.3 KB · 2 months agocmd_doctor.vkoh doctor — integrity check and cleanup.3.5 KB · 2 months agocmd_flag.vkoh flag — mark a save unsafe, clear the mark, or list what is marked.2.4 KB · 2 months agocmd_init.vkoh init — write the .koh file and a default ignore list.962 B · 2 months agocmd_log.vkoh log, and its saves and checkpoints aliases.6.8 KB · 2 months agocmd_man.vkoh man — the manual, built into the binary.2.1 KB · 2 months agocmd_migrate.vkoh migrate — one-time conversion from Koh 2.1.8 KB · 2 months agocmd_offer.vkoh offer — send the local saves to this machine's remote.2.3 KB · 2 months agocmd_peek.vkoh peek — put a save's tree in a temporary folder and print where.1.7 KB · 2 months agocmd_pluck.vkoh pluck — put one save's change onto the current tree.3.9 KB · 2 months agocmd_remote.vkoh remote — the machine's remote, set up once and used by every repo.6.5 KB · 2 months agocmd_save.vkoh save and koh checkpoint.2.3 KB · 2 months agocmd_status.vkoh status — what the working tree has that head does not.2.7 KB · 2 months agocmd_steal.vkoh steal — bring another machine's saves in.5.7 KB · 2 months agocmd_strip.vkoh strip — remove a path from history, permanently.6.8 KB · 2 months agohandover.vThe cut-over hand-off.2.1 KB · 2 months agooutput.vOutput for the command line: the ✦ / ✗ habit, and the --json shapes agents read.1.5 KB · 2 months agoprompt.vThe strict confirm prompt, carried over from Koh 2 unchanged.1011 B · 2 months agorepo.vOpening the repo a command acts on, and the tree lookups commands share.949 B · 2 months ago
events/8.1 KB · 2 months ago
fmt/2.1 KB · 2 months ago
history/17.7 KB · 2 months ago
machine/4.7 KB · 2 months ago
migrate/17.0 KB · 2 months ago
remote/25.3 KB · 2 months ago
snapshot/22.2 KB · 2 months ago
storage/19.2 KB · 2 months ago
sync/40.9 KB · 2 months ago
view/22.5 KB · 2 months ago
koh3.v77 B · 2 months ago
tests/25.4 KB · 2 months ago
vendor/9.4 MB · 2 months ago
README.mdOne SQLite file per repo, one line of history where nothing is ever erased, optional sync to an S3 bucket or a local folder.738 B · 2 months agov.mod122 B · 2 months agoVERSION6 B · 2 months ago
01986d5f7814specify operator access to private Kepr repos1 week agodc658c78d1ffrecord the P2 fix on Tylee in continuity1 week ago6a83267261dcrecord the verified 3.9.0 install and Kepr's pin move in continuity1 week agoda46ffea15a03.9.0: let only this host's folder locks use the pid check, and bump the version for schema 21 week agoa03dc73b7a11record P1's heavy-route bounds and the final Kepr budgets in the spec1 week ago422a82958764clear a stale folder lock only when its writer is gone1 week ago4ab979d1a1e4land steal objects in batches, list repos by folder, reuse the save walk and read back a refused head swap1 week ago694ae2cf655areplace per-save file rows with shared per-folder manifests (schema 2), and resolve K3, K19, K26, K27, K30 and K331 week ago096ef744e76fresolve review findings K2, K6, K9, K12, K14, K15, K16, K18, K20, K21, K24, K25, K29, K31 and raise the ceiling to 15,200 for per-folder manifests1 week ago2f32ce6c5db4raise the source ceiling to 14,500 and record the review decisions1 week ago54db83c066b0add the 2026-11-16 code and performance review of Koh 3.8.7 and Kepr 3.2.51 week ago9236af88c567record verified Koh 3.8.7 publication1 month ago6298e1f7cd95prepare Koh 3.8.7 release1 month agoe1d10e4c5aaeaccept mainstream build profiles and project markers1 month agof55debb9a051harden steal imports and scope incoming strip cleanup1 month ago7e9f6e02a31bspec safe steal imports and mainstream build profiles1 month agoae3640439cc1close the follower fan-out question as a decision: not bounded, deferred1 month agoec83d49c0918spec deleting a repo from the console, its key's reach, and the budget it took1 month agocec220eaea32spec two-step sign-in for the operator and record the decision1 month agof79d23a70046allow blob previews and sandbox issue attachments in the security section1 month agof5b200d2bc08specify public issue threads with replies, attachments and email updates1 month ago38eefa33a769specify gentle profile save streams and issue notification bubbles1 month ago97e08dad4e40specify Kepr's red open-issue count and amber handle links1 month agof1a58cc0fe9arecord in §30 that Kepr's people are coral and versions gold, one warm family1 month ago9f70ffd4b3cbrecord in §30 that each of Kepr's five colours has one meaning on every page1 month agob36179532bd0record Kepr's richer five-colour palette in spec §21 and §301 month agoc2a3480b3eaarecord the published Koh 3.8.6 release and its verification in continuity1 month ago0c3291310c79report deleted damaged remote copies when a Doctor resend fails part way1 month ago573800eb25d3close the sixth review's two findings on the 3.8.6 Doctor fixes1 month ago35a69dc83f0dclose the fifth review's two findings on the 3.8.6 Doctor fixes1 month ago6c4e37d5ae4eclose the fourth review's three findings on the 3.8.6 Doctor fixes1 month agod118485757e6close the third review's three findings on the 3.8.6 Doctor fixes1 month agob0f012ef7fe0close the second review's five findings on the 3.8.6 Doctor fixes1 month ago77badda0369bclose the eight review findings on the 3.8.6 Doctor fixes and add the 3.8.6 release notes1 month ago9519d1769dd2resolve the ten 3.8.5 Doctor safety findings with permanent regressions (3.8.6)1 month ago2b16b6628a15record 3.8.5 Doctor data-integrity failures with cross-platform test evidence1 month ago2d8759c3c26fspecify one read-write bucket key for Kepr and drop [bucket.write] (§19, §21, §24, §25, §30)1 month ago953527080be5record the verified 3.8.5 Doctor repairs and installation in continuity1 month ago1452d201ee6bgive every failed Doctor check a remedy and offer repairs that lose nothing (3.8.5)1 month ago176fe5976767specify Doctor remedies and opt-in repairs (§7.6.2) and raise the source ceiling to 13,5001 month agob4674fd6a5e8record verified 3.8.4 manual rewrite and installation1 month ago1d4115a82c65rewrite the manual in short direct entries and trim stale code comments (3.8.4)1 month ago2d53457a7f9ewip: rewrite manual and tighten comments; full test results pending (3.8.4)1 month ago57a9c84b4678replace doctor --offline with --fast in scripts and documentation (3.8.3)1 month ago744c2018c7eaexclude machine-local Claude configuration from future saves1 month agodcb0cda563efrecord the published Koh 3.8.2 release and the humanizer hook in continuity1 month ago65ac188ca3f3tighten the 3.8.2 release notes after a humanizer review1 month ago9d8158ff8ec7write the Koh 3.8.2 release notes covering every change since 3.7.31 month agoa9f449b823c8renumber the Doctor output and --fast release as patch 3.8.21 month ago566910e3f8c2tidy Doctor's terminal report into labelled rows and add --fast to skip the remote audit (3.9.0)1 month ago

older →

details

Koh

Koh is version control for a solo developer working across a few machines. Save your project, see what changed, and bring back earlier work when you need it. Each repository keeps its history in one SQLite file, .koh, with one line of saves. Koh is written in V.

Install

Koh runs on Apple silicon macOS and Linux on ARM64 or x86_64. New releases do not support Intel macOS or Windows.

curl -fsSL https://koh.asha.software/install.sh | sh

The installer verifies the release checksum and offers an optional zsh plugin. For later updates, run koh update. Use koh update --check to check without installing.

Start saving

Run these commands in your project folder:

koh init
koh save "record the first working version"
koh status
koh view

init creates .koh and a starter .kohignore. Check the ignore rules before your first save. Each save snapshots every file Koh tracks, including new files; unchanged contents are stored only once. save refuses when nothing changed.

Before a change you may want to undo, make a checkpoint:

koh checkpoint "before changing the parser"

A checkpoint records the project even when nothing changed. After editing, koh diff shows the changes and koh save "describe the result" records them. Commands work from subfolders too.

koh view opens an interactive history browser in a terminal. Use the arrow keys or j and k to move, / to search, Enter for details, and Tab to switch between saves and checkpoints. With --json or when piped, it prints history. LOG.md is a generated summary of the latest 20 saves.

Bring back earlier work

Command What it does
koh undo Restore the previous save.
koh undo 3 Step back three saves.
koh load <id> Restore a particular save.
koh load --checkpoint Restore the latest checkpoint.
koh revert Discard unsaved changes, keeping them in a checkpoint first.
koh peek <id> Unpack a save into a temporary folder for inspection.
koh pluck <id> Apply one save's changes to the current tree as a new save.

Restoring earlier work adds a new save. The saves you stepped away from remain available, so you can load them again. Koh has no branches or lanes.

undo, load, and pluck require a clean working tree. Commands that rewrite your files show a preview and ask for confirmation. Enter cancels; only y or Y approves. Scripts must supply --yes to approve the action.

Sync your machines

Choose an S3 bucket or a folder remote once per machine. Every repository on that machine uses the same remote.

For a folder, such as one on a removable drive:

koh remote folder /Volumes/usb/koh

For S3, supply the endpoint, bucket, and region. Koh asks for the access keys and tests the connection before keeping the settings:

koh remote s3 https://s3.fr-par.scw.cloud my-bucket fr-par

If you run a Kepr, koh remote <kepr-host> opens its sign-in page and lets you connect with the code it supplies. koh remote shows the current setting. Replacing or forgetting an existing remote requires consent.

Once configured, saves and checkpoints offer their history automatically. A failed transfer leaves the local save intact; run koh offer to retry. On another machine, fetch a repository from outside an existing repo:

koh steal my-project
cd my-project

Inside it, koh steal brings in new history. If both machines changed a file, Koh shows both versions and asks which one to keep. It resolves clashes per file, without blending lines. The original saves remain available, and the result names the save you can load to return to your previous state.

Incoming changes require confirmation. For scripts, --mine or --theirs chooses a side for every clash; --yes separately approves applying the changes.

You can also fetch a public repository with koh steal <kepr-host>/<repo>. That copy syncs from its public source and cannot offer back until you sign in to that Kepr as its operator.

Ignore files and remove saved content

.kohignore holds rules for the repository and travels with its saves. ~/.kohignore adds rules for every repository on this machine and stays local. Koh also excludes its own history files, LOG.md, and symlinks.

koh ignore cache/ output/ notes.txt
koh ignore --global scratch.txt

ignore previews the exact rules and asks once for the batch. A path already matched in the selected ignore file proposes removing its matching rules; removing a broad rule can affect other files, which the preview explains. Local paths are relative to the current directory. Global names and paths match at any depth in every repository.

Ignoring a file leaves its earlier saved versions in history. koh strip <path> permanently removes a file or folder from all saves and bans that path from future saves. It propagates the removal to the remote and other machines as they sync. The working file stays on disk. --save <id> limits removal to one save and does not ban the path.

Strip is the exception to Koh's growing history: it cannot be undone. It requires a terminal and each affected path typed exactly. --yes skips only the yes/no question. See koh man strip before using it.

Work with coding agents

Saves can record the agent's model and a session name:

koh save --agent gpt-6 --session "fix parser errors" "reject incomplete input"
koh view --session "fix parser errors" --json
koh diff --session "fix parser errors"

koh undo --session restores the state before the current session. Use the actual model identifier and keep one session name for related work.

Commands that print data support --json. Koh refuses when a required prompt cannot be answered, so unattended commands never wait for input. Exit codes are 0 for success, 1 for refusal or failure, and 2 for bad usage.

Build projects and publish releases

A project's koh.build file names its build command, output, and platforms. koh build runs it for the current machine without uploading or installing anything. The toolchain must already be on PATH.

koh offer --builds builds every configured platform and publishes the artifacts as a release. It requires a saved tree and a version in the project's own files, such as VERSION, v.mod, or package.json. Ordinary saves never publish builds. See the specification for the file format, and koh man build or koh man offer for command options.

Back up a repository

koh doctor
koh doctor --backup /path/to/new-backup.koh

doctor checks the database, stored content, history, events, working files and configuration. It also verifies remote history and release files by default. Use --fast for a local check. The report names each check, its result, and any part it could not verify. A failed check says how to fix it, and Doctor offers to repair what it can without losing anything: on a terminal it asks first, and --yes runs every repair. Its backup command writes a consistent copy of .koh. Use it instead of copying the database while Koh is using it. Keep a live .koh out of cloud folder sync services; use offer and steal between machines.

Koh does not encrypt history. Anyone who can read the database or remote can read its saved files. Koh is intended for code and text; individual files over 512 MiB are refused.

Upgrade from Koh 2

Save unfinished work with Koh 2 first. Run koh update in a terminal and confirm the upgrade, then run koh migrate in each repository.

Migration keeps save IDs and archives the old repository in .koh-v2/. It imports the dev ancestry by default, falling back to main if dev has no saves; --lane main selects the other line. Koh 3 refuses repository commands in an unmigrated Koh 2 repository. See koh man migrate for missing file recovery and other options.

Build from source

Use the pinned compiler, V 0.5.2 b9a2d87. A different V revision can break Koh, and the tests reject it.

To compile V, install a C compiler and extract the V source archive. Copy v.c from the vc bootstrap archive into the extracted V directory, then run these commands there. The vc revision is pinned too because newer bootstraps can be incompatible with this V source.

mkdir -p .git
printf '%s\n' b9a2d87bc6c317739113db1d96ca89a05f8903f4 > .git/HEAD
cc -O2 -w -o v1 v.c -lm -lpthread
./v1 -o v2 cmd/v
./v2 -o v cmd/v
./v self
./v version

The .git/HEAD file lets V report the pinned revision when built from an archive. Add the directory containing the resulting v executable to PATH. From Koh's repository root, compile Koh with:

mkdir -p build
v -d use_bundled_libgc -o build/koh3 src/koh.v

The flag builds the GC library from V's bundled source. SQLite 3.49.1 is vendored and compiled into the executable. Every Koh build requires Boehm garbage collection. Release builds use sh build.sh or koh build on the target OS and CPU. Linux releases use the host C compiler (cc) and static C runtime libraries. Install the toolchain's static runtime development package if needed. Zig is not required. Cross-compiling Koh with the pinned V disables garbage collection, so the release script refuses it.

Manual and shell integration

Run koh man for the full manual or koh man <command> for one command. The manual source is also available in this repository.

Source shell/koh3.plugin.zsh from ~/.zshrc for a prompt segment and tab completion. ! marks unsaved changes; ⚑ marks a flagged head save. The plugin's header covers custom prompts, Starship, and Powerlevel10k.

Made by Asha Software.