A TUI for managing lean-minimizer jobs.
Automates workspace setup and provides a terminal dashboard for tracking long-running Lean 4 code minimization jobs.
uv tool install git+https://github.com/leanprover-community/minimizeCheck your environment with:
minimize doctorPoint minimize run at any .lean file in a Lean project. The file must
contain a #guard_msgs block marking the behavior to preserve.
minimize run path/to/MyFile.lean
minimize run path/to/MyFile.lean --note "investigating issue #1234"This will:
- Detect the Lean project (walks up to find
lakefile.toml) - Create a workspace in
~/.minimize/with the right dependencies - Run
lake exe cache getif Mathlib is detected - Build and start
lake exe minimizein a persistent tmux session
Run minimize with no arguments to open the TUI:
minimize| Key | Action |
|---|---|
| Enter | Open workspace in VS Code |
| a | Attach to tmux session |
| l | Toggle log pane |
| k | Kill running job |
| d | Delete job and workspace |
| r | Resume stopped job |
| e | Edit note |
| q | Quit (jobs keep running) |
Jobs are color-coded: blue = running, green = completed, red = failed.
minimize run <file.lean> Start a minimization job
minimize list Show all jobs (non-interactive)
minimize attach <id> Attach to tmux session
minimize log <id> Tail the job log
minimize open <id> Open workspace in VS Code
minimize kill <id> Kill a running job
minimize resume <id> Resume with --resume flag
minimize note <id> [text] View or set a note
minimize result [id] Print minimized output
minimize clean Remove old workspaces
minimize doctor Check environment
Job IDs accept unambiguous prefixes (e.g., minimize log 04a).
minimize run <file> --marker PATTERN Custom marker (default: #guard_msgs)
minimize run <file> --force Skip #guard_msgs validation
minimize run <file> --mirror-deps Mirror deps instead of path dependency
minimize run <file> --extra-args "..." Extra args for lake exe minimize
minimize clean --older-than 7d Only clean jobs older than N days
For each job, minimize creates a standalone Lake project in ~/.minimize/
that depends on the source project (as a path dependency) and on
lean-minimizer. This means all
imports from the original project resolve correctly without duplicating the
Lake configuration.
Jobs run in named tmux sessions (minimize-<id>) that persist across
terminal disconnects. The TUI polls job status by reading phase markers
from the log file.
Apache 2.0