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-09-03 (its own deterministic census script, scripts/census.sh, plus AST checkers; source excludes tests):
source lines 107,670 across 412 files, 41 modules
classes 384 100% namespace-pattern conforming
Reactive() classes 91
Static() capability classes 211
invariant contracts 39 (~19,000 lines)
value-import cycles 0 (Tarjan over the import graph)
computed() calls 12 (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, twelve computed() in 108k 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 — 384 classes, one export shape, cross-module references that resolve at first access.
- 91
Reactive()classes, 211Static()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.
Related guide pages
- Backend ivue — ivue with no DOM, under Bun.
- Static() — Capability Classes — capability classes,
$-cached statics, the anchor. - Caches, Registries & self — shared stores,
LazyShared, reading statics throughself. - Namespace Pattern —
$Class,Class, and the types derived from them. - Node class HMR — class hot-swap on the backend.