Invar — a terminal IDE built on ivue
Invar is ivue at full scale: a complete terminal IDE — editor, file tree, workspace search, find/replace, git, tasks, terminals, LSP, and agent integration — built entirely on ivue classes, running under Bun in a terminal with no DOM and no Vue components. The same Reactive() and Static() that drive the browser examples on this site drive every keystroke of it; only the paint target changed.
Invar is an alpha, experimental project — a proving ground for ivue beyond the web, and an experiment in agentic development: AI agents wrote almost all of it, using the ivue skill as their base discipline, with every module governed by explicit invariant contracts and a merge gate that enforces them. The story of how that worked is a series on the blog, starting with Introducing Invar and AI agents built an editor.
A look inside
The numbers
Counted from the open repository, 2026-08-11 (its own deterministic census script plus AST checkers; source excludes tests):
source lines 94,054 across 372 files, 37 modules
classes 345 100% namespace-pattern conforming
Reactive() classes 79
Static() capability classes 198
invariant contracts 35 (~14,000 lines)
value-import cycles 0 (Tarjan over the import graph)
computed() calls 10 (memoization is opt-in)
module-level variables 0Those zeros are not tidiness — they are the ivue discipline holding at scale, mechanically enforced on every merge. How each one is achieved has its own deep dive: zero import cycles, zero module-level state, ten computed() in 94k lines.
What to study in the source
Invar is open as a study-scale example of ivue architecture — the patterns from this site's guides, applied at three orders of magnitude:
- The namespace pattern everywhere — 345 classes, one export shape, cross-module references that resolve at first access.
- 79
Reactive()classes, 198Static()capability classes — file system, subprocesses, PTY file descriptors, and native library handles behind$-cached static getters. - The flyweight pattern rendering editor text at O(viewport) — the same architecture as the 20-million-cell grid, driving a real editor.
- Reactivity as resource governor — SQLite connections, LSP servers, and timers that exist only while observed.
- Invariant contracts — every module ships a
*.invariants.mdstating what must hold, what is impossible if it does, and how it is verified: uniformity as an instrument.
github.com/infinite-system/invar — clone it, run bun start, and read the modules with the guides open beside them.