Work / nerv
nerv
Fig-style autocomplete for zsh on macOS: subcommands, flags, branches and scripts pop up as you type. A Rust daemon and one zsh script, with no login, no AI and no telemetry.
- Platform
- macOS on Apple Silicon · zsh
- Built with
- Rust · one zsh script
- Specs
- 715 commands
- License
- Apache-2.0 · MIT for the specs
brew install nerv-sh/tap/nerv
eval "$(nerv init zsh)"
What it does.
The next token, as you type
Subcommands, flags and their descriptions for 715 commands such as git, docker, kubectl and npm.
Live values too
Git branches, npm scripts, kubectl resources, SSH hosts and make targets.
Ghost text from your history
The command you most likely mean, ranked by how often and how recently you ran it, and in which folder. Right-arrow accepts it.
What it will never do
It has no AI, no account, no telemetry, no network calls at runtime and no auto-updater. The project documents these as non-goals.
How it is designed.
The keystroke path of nerv, from the zsh widget to the daemon and back, drawn from its code.
-
A socket, not a process, per keystroke
Each request used to fork the nerv binary: 12 to 14 ms a keystroke. Now the zsh widget opens the daemon’s Unix socket itself and keeps it open for the life of the shell. One line goes out and rows come back, about 0.25 ms a round trip. If the socket fails, that request takes the fork path and the next one reconnects.
-
Specs are compiled, not interpreted
The engine is the Fig completion engine that AWS open-sourced. At build time a converter runs the TypeScript specs from withfig/autocomplete and emits plain JSON for 715 commands. At runtime there is no Node and no network: the daemon reads gzipped JSON off disk lazily, with a bound on entries and on bytes. The largest spec, aws, is split into 343 subtrees, and its first keystroke takes 3.9 ms cold (Apple Silicon, release build, v0.1.15, 2026-09).
-
A slow command cannot freeze the prompt
A live value such as git branch --list runs in a subprocess on a background thread with a hard 800 ms cap. Its result is cached for 5 seconds, or 60 for a generator measured slower than 50 ms, and it lands on the next keystroke.
-
At most 500 rows cross the socket
The popup shows about ten rows, but the widget receives every row and scans them all to size the box. At the 16,914 formulae of brew install that scan alone took about 270 ms a keystroke. The daemon now sends the top 500 after ranking, which keeps the widget’s work near 6 ms.
-
A budget for every keystroke
The budget is 25 ms a keystroke. Measured on Apple Silicon (release build, v0.1.15, 2026-09), the engine answers in 0.055 ms at p95 when warm, and a cold start of the CLI bridge takes 4.07 ms at p95. The numbers are measured again before each release.