Margin documentation
Margin is the terminal review workspace for agent-assisted code: inspect changes, accept good hunks, reject bad ones safely, and return precise feedback while remaining accountable for every change.
brew install imrajyavardhan12/tap/margin
margin # review the working tree
Where to go
| If you want to… | Read |
|---|---|
| learn the keys | Keybindings |
| change themes, layout, or behaviour | Configuration · Themes |
| script Margin or feed an agent | JSON output |
| understand current direction | Roadmap |
| understand how it is built now | Architecture |
| know why it is built that way | Decision records |
| see what shipped | Changelog |
| read the original plan | Historical blueprint |
| contribute | Contributing |
Documentation authority
The root CONTEXT.md defines domain language, the README describes the current
product, the roadmap describes direction, this book’s architecture page
describes the current Implementation, ADRs preserve durable decisions, and the
changelog records shipped history. The blueprint is historical and is not
maintained as a live specification.
The review loop
Margin exists for the case where something else wrote the code and you have to decide whether to keep it:
marginopens the working tree — untracked files included.J/Kmove by hunk,]/[by file,/searches the whole changeset.sstages a hunk you accept;xdiscards one you don’t (backed up to.git/margin/trash/first —margin undorestores it).cleaves a note on a hunk that needs a human answer.mchecks a file off. The mark is keyed to the file’s content, so it survives a rebase and clears itself if the file changes again.margin --notesprints every note as Markdown withpath:lineanchors — paste it into a pull request, or hand it back to the agent.
Nothing is written to your repository unless you press a key that says
so, and the only destructive key asks you to type yes.