Frameworks#
Zsh is the most framework-heavy shell ecosystem. The scene splits between frameworks (curated collections with a shared config convention) and plugin managers (thin loaders for individual plugins). Frameworks are easier to start with; managers are faster and easier to keep tidy as the config grows. On top of either, the operator usually drops in a prompt manager for status, git, kubernetes context, and language pickers.
Frameworks#
Opinionated bundles. Drop one in, get aliases, prompts, completions, plugin loading, and theming with no further setup. Pay for it in startup time.
Oh My Zsh, the original. Huge plugin catalog (300+), one config-file convention (
~/.zshrc), big theme library. Slow on startup with many plugins enabled.Prezto, lighter Oh My Zsh-style framework. Module-based;
zpreztorcselects which modules load.zim, minimal framework focused on startup speed; compiles modules to bytecode on update.
Plugin Managers#
No prefab config; the operator wires up only what they want. Faster startup, more deliberate.
zinit, the performance-first manager. Turbo-mode loads plugins after the prompt is on screen.
antidote, the Oh My Zsh-friendly successor to
antibody; declarative.zsh_plugins.txt.zplug, vim-plug-style manager; popular for a while, less actively maintained.
znap – git-based manager that focuses on fast clone / update flows.
Common Plugins#
The four most-installed plugins, regardless of which framework or manager the operator picked. Most operators run all of them.
zsh-autosuggestions, inline gray suggestions from history. Tap right-arrow to accept.
zsh-syntax-highlighting – colors commands as the operator types; spots typos before Enter.
fast-syntax-highlighting, a faster, theme-rich alternative to the original.
fzf, fuzzy history (
Ctrl-R), fuzzy file (Ctrl-T), fuzzycd(Alt-C).
Prompt Managers#
Most modern setups use a separate prompt manager rather than
hand-coding PROMPT. The manager handles async git status,
Kubernetes context, language version pickers, and icon fonts so
the prompt stays fast and consistent across shells.
Starship, cross-shell prompt written in Rust; configured via TOML. Works in zsh, bash, fish, PowerShell, nushell.
Powerlevel10k, the fastest zsh prompt; instant-prompt rendering before
.zshrcfinishes loading.pure, minimal, async git prompt in pure zsh.
spaceship, module-rich prompt; many language and platform indicators.
CLI / Argument Parsing#
The zsh-native parser is zparseopts from the zsh/zutil
module. It handles short and long flags, mandatory and optional
arguments, and stops parsing on -- cleanly. POSIX getopts
also works (short flags only).
$ zmodload zsh/zutil
$ zparseopts -D -A opts -- h=flag_h v=flag_v f:=flag_f -file:=flag_file
$ (( ${+flag_h[1]} )) && { print "usage: ..."; exit 0 }
$ (( ${+flag_v[1]} )) && verbose=1
$ file=${flag_f[2]:-${flag_file[2]:-default.txt}}
Testing#
zunit, TAP-style test framework for zsh.
zsh-test-runner ecosystem.
bats-core also runs zsh scripts; widely understood.
$ #!/usr/bin/env zunit
$ @test 'addition works' {
$ result=$(( 2 + 3 ))
$ assert "$result" equals 5
$ }
Logging / Output#
References#
Libraries for the builtin / module / autoload layer that frameworks orchestrate.
Zsh for the broader zsh chapter (Setup, init files, completion, globbing).
Customization for the prompt / theme / dotfiles picture.
awesome-zsh-plugins (curated list of frameworks, managers, and plugins).