koh

@june

Koh is version control for the solo developer.

V

v3.8.7 · 297 saves · 13,847 lines · updated 3 days ago

101 files
57a9c84b4678
back to HEAD
shell/7.0 KB · 6 days ago
src/539.1 KB · 6 days ago
apply/6.7 KB · 2 weeks ago
build/27.2 KB · 2 weeks ago
cli/152.1 KB · 6 days ago
args_test.v445 B · 2 weeks agoargs.vCommand line parsing.2.6 KB · 2 weeks agocli.vCommand line entry: dispatch table, usage text and exit codes.3.1 KB · 1 week agocmd_back_test.v4.0 KB · 1 week agocmd_back.vGoing back: koh undo, koh revert and koh load.9.7 KB · 2 weeks agocmd_build.vkoh build — build with koh.build, and upload nothing.2.6 KB · 2 weeks 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 weeks agocmd_doctor_test.v4.8 KB · 6 days agocmd_doctor.vkoh doctor — integrity check and cleanup.9.5 KB · 6 days agocmd_flag.vkoh flag — mark a save unsafe, clear the mark, or list what is marked.2.4 KB · 2 weeks agocmd_ignore.vBatch ignore toggles: plan from the original rules, then confirm one file replacement.6.3 KB · 1 week agocmd_init.vkoh init — write the .koh file and a default ignore list.964 B · 2 weeks agocmd_man.vkoh man — the manual, built into the binary.3.4 KB · 2 weeks agocmd_migrate.vkoh migrate — one-time conversion from Koh 2.4.3 KB · 2 weeks agocmd_offer.vkoh offer — send the local saves to this machine's remote, and, with --builds, publish a release built from them.7.0 KB · 1 week agocmd_peek.vkoh peek — put a save's tree in a temporary folder and print where.1.7 KB · 2 weeks agocmd_pluck.vkoh pluck — put one save's change onto the current tree.5.1 KB · 2 weeks agocmd_remote.vkoh remote — the machine's remote, set up once and used by every repo.14.1 KB · 1 week agocmd_save.vkoh save and koh checkpoint.2.9 KB · 2 weeks agocmd_status.vkoh status — where things stand: the save you are on, and what the working tree has that it does not.4.3 KB · 2 weeks agocmd_steal_test.v386 B · 2 weeks agocmd_steal.vkoh steal — bring another machine's saves in.18.8 KB · 1 week agocmd_strip.vkoh strip — remove a path from history, permanently.7.0 KB · 1 week agocmd_update.vkoh update — put a newer published koh in place of this one (§12).2.8 KB · 2 weeks agocmd_view.vkoh view — the history, browsed or printed.7.1 KB · 2 weeks agodoctor_checks.vDoctor's local history, event and working-tree checks.8.0 KB · 6 days agodoctor_remote.vRead-only remote inspection; Doctor never calls sync or the write probe.7.2 KB · 6 days agohandover.vRefuse repository commands until a Koh 2 repository has been migrated.731 B · 1 week agooutput.vOutput for the command line: the ✦ / ✗ habit, and the --json shapes agents read.1.6 KB · 2 weeks agoprogress_test.v673 B · 1 week agoprogress.vThe line a long action draws while it works (§4, "never leave the person wondering"): one line on stderr, redrawn in place and cleared when the step ends, and only when stderr is a terminal, so pipes, logs and --json never see it.3.2 KB · 1 week agoprompt.vThe strict confirm prompt, shared by destructive commands.1.0 KB · 1 week agorepo.vOpening the repo a command acts on, and the tree lookups commands share.949 B · 2 weeks ago
events/8.2 KB · 2 weeks ago
exchange/105.2 KB · 1 week ago
fmt/3.5 KB · 2 weeks ago
history/25.9 KB · 1 week ago
machine/8.2 KB · 2 weeks ago
migrate/31.8 KB · 1 week ago
release/13.8 KB · 1 week ago
remote/38.2 KB · 1 week ago
snapshot/39.9 KB · 1 week ago
storage/25.4 KB · 6 days ago
update/10.8 KB · 1 week ago
view/42.0 KB · 6 days ago
koh.vProgram entry: hands the command line to the CLI and exits with its code.257 B · 1 week ago
tests/95.7 KB · 6 days ago
vendor/9.4 MB · 2 weeks ago
build.shBuilds one Koh release binary into build/releases/koh-<target>.2.2 KB · 1 week agokoh.build129 B · 1 week agoREADME.mdKoh is version control for a solo developer working across a few machines.9.6 KB · 6 days agov.mod122 B · 6 days agoVERSION6 B · 6 days ago
5ef6324e5841specify Kepr's retryable build deletion order and tarball keys that cover hidden paths1 week agoa71c8c80a31brecord Kepr's 2026-09-30 admin decisions: no card order or install lines, build and tarball deletion, bucket tarballs, hidden paths, S3 from a folder instance, localhost origin1 week ago39013e0246f3specify Kepr's backup workspace1 week ago24cc5e20c2b7say email kinds switch on only once SMTP is saved, and what retry now resets1 week ago6a7ad407014aspecify Kepr's SMTP email notifications and delivery queue1 week agoa5894ce97c4brecord June's 10,500-line Kepr ceiling with admin 1,600 and server 1,5001 week ago0a83e3f47ed1specify Kepr's in-app operator notifications1 week ago4852e02881b7specify Kepr issue triage, follow-up hiding and the new-issues switch1 week ago61544c35740cspecify Kepr's selected-repo workspace and shown languages1 week agod789d3f1ff1brecord June's allocation of the last 200 Kepr reserve lines to server1 week agof82016c7dba3specify Kepr's console-edited, tested S3 settings rewriting kepr.toml1 week ago4ed280970bdarecord approved Kepr admin and server headroom1 week agoa2fe38a6bf08record June's 3000-line Kepr CSS allowance1 week ago74b41b2f570flist only folders with a head in steal --list, so Kepr's own .kepr folder in the remote is never named as a repo (3.2.25)2 weeks ago135d14574f3dsay 1 save, not 1 saves, in migrate's count-mismatch error; reword a continuity note off git terms (3.2.24)2 weeks agoe2124037124fsay 1 save, not 1 saves, in steal's fetched, brought-in and up-to-date lines (3.2.23)2 weeks agoc8506f27a079record 3.2.22 green on Debian 13 arm64 in Apple container, with the vc bootstrap and root traps2 weeks ago16c0fc007c1fcorrect three overclaiming comments and drop three that restated their code, after Codex review (3.2.22)2 weeks agobae6f36f4351read an empty --name= as an empty value instead of taking the next word (3.2.21)2 weeks ago064fb290d6cfreword two comments away from git terms, and record the A4 pass in continuity (3.2.20)2 weeks ago1f6a60e93364explain storage, events, commands and the history view (3.2.19)2 weeks ago4fedb4de22e5explain the sync, strip, save and restore code (3.2.18)2 weeks ago17c48991c43csplit the print half out of cmd_steal and cmd_status, and note the key table in term (3.2.17)2 weeks ago4d519567736fone comment style everywhere, a discard helper in settings, and lined-out struct literals (3.2.16)2 weeks ago2213f5046815say plainly why a Koh 3 command is refused in a Koh 2 repo: it needs a Koh 3 repo, and this one is still Koh 2 (3.2.15)2 weeks ago5ef1c461d861record the lost-version recourse, the vegeta finding and the safe survey in continuity (3.2.14)2 weeks ago8da913d7e452migrate past file versions Koh 2 lost: name them before asking, take them back from a backup with --with, or bring those saves over without them, flagged; a failed migrate removes its own draft (3.2.14)2 weeks agob723e06ba9fename the save and status counters in the spec's feedback rule, and record the new ceiling in continuity (3.2.13)2 weeks agodfe5c9f72825count the files a walk reads and a save stores on the terminal, so the first save of a large tree is never silent, and raise the line ceiling to 12,000 with the tripwire at 11,800, June's call (3.2.13)2 weeks ago67b039b810e5record the feedback pass, the install trap and the tripwire margin in continuity (3.2.12)2 weeks agodc0dd30a22dcmigrate shows what it found and what it will do, asks first (--yes skips), counts saves as it imports and checks them, and reports each object once (3.2.12)2 weeks agof0d2d40f26a8show what long actions are doing on the terminal: doctor names its check, build each platform, update its download, and offer, steal and a remote strip count what they move (3.2.11)2 weeks ago67dcb773afe1count saves, objects, events and checkpoints in words that agree with the number, and say plainly when the update server answers with something that is not a release (3.2.10)2 weeks agoac15999ac9b4in a Koh 2 repo, refuse the commands Koh 2 reads differently or lacks, pointing at koh migrate, and keep remote and update Koh 3's (3.2.9)2 weeks ago8d1444aebca9install by replacing the binary, never rewriting it in place, which macOS punishes by killing a running koh (3.2.8)2 weeks ago0112cda41049credit Asha Software, asha.software, in the man page's authors as on the help screen (3.2.8)2 weeks ago061b8e07f23brecord the status wording, the help attribution and the zsh setup in continuity (3.2.7)2 weeks ago301e80efe291credit Asha Software, asha.software, at the foot of the help screen (3.2.7)2 weeks ago6eabcf809156show where things stand in koh status — the save you are on, its age and the save count — and say so in help: status is where things stand, diff is what changed (3.2.6)2 weeks agoa4eddf199042record the koh/koh2 cutover and the closed malformed-name and illegal-strip findings in continuity (3.2.5)2 weeks ago75b94560088einstall Koh 3 as koh with Koh 2 renamed koh2, and find Koh 2 for the migrate tests as koh2 first, never Koh 3 (3.2.5)2 weeks agoc626bc7e3f0bread unpaired surrogate escapes as bytes so one bad name never refuses a whole record, escape only the bytes outside valid UTF-8, and ignore strips with illegal paths, as Kepr does (3.2.4)2 weeks agof916e638e588record Kepr's 512 MiB object cap and 8 MiB recount skip in the spec, and the finished A3 in continuity (3.2.3)2 weeks agoacb7f0f501adreport the unsafe paths a whole-repo steal drops, as a steal into an existing repo does (3.2.3)2 weeks agod5d9ef7e460freport unsafe paths in doctor, drop them in migrate by the shared rule, and keep flagged names in offer --builds --json (3.2.2)2 weeks agoa8e3208a9603wip: report unsafe doctor paths and thread flagged build-offer JSON; A3.4 incomplete (3.2.2)2 weeks agoeff0d4dd1105remove the generated CLI test binary from the saved tree (3.2.1)2 weeks ago427d85ab1fecrefuse restore paths outside the repo and keep sibling folders out of pruning (3.2.1)2 weeks ago87658431342dskip and report unsafe paths on save and arrival with one shared rule (3.2.0)2 weeks ago1985e2a8fd8dcorrect the spec section named in the handoff: the flags display is §10 (3.1.5)2 weeks ago

← newerolder →

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.