UndoLangGetting Started

First useful run

Install, inspect, execute.

Requirements

A source build requires Go 1.27.x. The resulting native binary requires no Go installation, runtime service, API key, database, or environment variable. NO_COLOR is optional.

If you use the source checkout and Go is missing or older than 1.27, the local installer can download the official Go 1.27.0 archive, verify its SHA-256 checksum, and keep it in a user-local toolchain directory. Pass --no-install-go (or -NoInstallGo on PowerShell) to require an offline install.

Build from source

git clone https://github.com/daniel-oluwadunsin/undolang
cd undolang
go build -trimpath -buildvcs=false -o undo ./cmd/undo
./undo version

macOS and Linux

Keep the binary anywhere on PATH, or run ./install.sh to copy a local binary (or build the local checkout) to ~/.local/bin/undo. A source build uses an existing Go 1.27.x when available and otherwise performs the checksum-verified user-local Go bootstrap described above.

Windows

Build with go build -trimpath -buildvcs=false -o undo.exe ./cmd/undo. Run .\install.ps1 to copy the local binary to %LOCALAPPDATA%\UndoLang\bin; add that directory to the user PATH when prompted. If the checkout needs a compiler, the script can bootstrap Go 1.27.0 locally; pass -NoInstallGo to disable that.

Your first program

transaction "initialize" {
  require not_exists "VERSION"
  mkdir "data"
  write "VERSION" = "1"
  assert is_dir "data"
  assert contains "VERSION" "1"
}

Save this as setup.undo. The script can live anywhere; paths bind to the root passed below.

undo check setup.undo --root ./demo
undo plan setup.undo --root ./demo
undo run setup.undo --root ./demo
# noninteractive:
undo run setup.undo --root ./demo --yes --json

Recovery basics

If a process stops with an unresolved transaction, new mutation is blocked. Run undo recover --root ./demo --yes. Inspect retained or finalized metadata with undo history and undo inspect TXID.