| Crates.io | pzsh |
| lib.rs | pzsh |
| version | 0.3.2 |
| created_at | 2026-01-03 18:46:50.266659+00 |
| updated_at | 2026-01-12 22:48:02.351471+00 |
| description | Performance-first shell framework with sub-10ms startup |
| homepage | |
| repository | https://github.com/paiml/pzsh |
| max_upload_size | |
| id | 2020605 |
| size | 441,752 |
Performance-first shell framework with sub-10ms startup. Like oh-my-zsh, but 50-200x faster.
┌─────────────────────────────────────────────────────────────┐
│ noah@dev ~/src/pzsh (main) │
│ ❯ pzsh bench │
│ │
│ Startup Benchmark (100 iterations) │
│ ──────────────────────────────── │
│ min: 0.002ms ████ │
│ max: 0.003ms ████ │
│ mean: 0.003ms ████ │
│ p99: 0.003ms ████ │
│ ──────────────────────────────── │
│ Budget: 10ms ✓ (p99 < 10ms) │
└─────────────────────────────────────────────────────────────┘
No shell startup shall exceed 10ms. This is not a goal—it is a hard constraint enforced at compile time, test time, and runtime.
| Framework | Startup | vs pzsh |
|---|---|---|
| pzsh | <1ms | 1x |
| bare zsh | 5-10ms | 10x |
| zinit | 100-300ms | 300x |
| prezto | 200-500ms | 500x |
| oh-my-zsh | 500-2000ms | 2000x |
Startup Benchmark (100 iterations)
────────────────────────────────
min: 0.002ms
max: 0.003ms
mean: 0.003ms
p50: 0.003ms
p95: 0.003ms
p99: 0.003ms
────────────────────────────────
Budget: 10ms ✓ (p99 < 10ms)
Startup Profile
├─ parse: 0.007ms
├─ env: 0.000ms
├─ alias: 0.000ms
├─ prompt: 0.005ms
└─ total: 0.013ms ✓
cargo install pzsh
# For zsh (~/.zshrc)
eval "$(pzsh init zsh)"
# For bash (~/.bashrc)
eval "$(pzsh init bash)"
pzsh provides drop-in replacements for common oh-my-zsh features:
g, ga, gc, gp, gst aliasesd, di, dps, dex aliases┌──────────────────────────────────────────────────────────┐
│ robbyrussell theme │
│ ➜ ~/src/pzsh (main*) git status │
├──────────────────────────────────────────────────────────┤
│ agnoster theme │
│ noah │ dev │ ~/src/pzsh │ main* │ ❯ │
├──────────────────────────────────────────────────────────┤
│ pure theme │
│ ~/src/pzsh main* │
│ ❯ │
├──────────────────────────────────────────────────────────┤
│ minimal theme │
│ > ls -la │
└──────────────────────────────────────────────────────────┘
Optional integration with aprender-shell for intelligent command predictions:
# Load your trained model
pzsh completion --model ~/.local/share/pzsh/model.apr
# Predictions trained on your command history
$ git c<TAB>
commit (0.85) checkout (0.72) clone (0.45)
# Initialize configuration
pzsh init --shell zsh
# Benchmark startup time
pzsh bench
# Lint for slow patterns
pzsh lint ~/.pzshrc
# Profile startup breakdown
pzsh profile
# Compile configuration
pzsh compile
# Check status
pzsh status
# ~/.pzshrc
[pzsh]
version = "0.2.0"
shell = "zsh"
[performance]
startup_budget_ms = 10
lazy_load = true
[prompt]
theme = "robbyrussell"
git_status = true
colors = true
[plugins]
enabled = ["git", "docker"]
[aliases]
ll = "ls -la"
gs = "git status"
[env]
EDITOR = "vim"
GOROOT = "/usr/local/opt/go/libexec" # Pre-resolved, no $(brew ...)
pzsh enforces O(1) startup by rejecting slow patterns:
# FORBIDDEN: subprocess calls at startup
export GOROOT="$(brew --prefix golang)/libexec" # 50-100ms per call
# ALLOWED: pre-resolved paths
export GOROOT="/usr/local/opt/go/libexec" # 0ms
# FORBIDDEN: oh-my-zsh, NVM, conda init
source $ZSH/oh-my-zsh.sh # 500-2000ms
# ALLOWED: pzsh lazy loading
eval "$(pzsh init zsh)" # <1ms
┌─────────────────────────────────────────┐
│ pzsh init zsh │
├─────────────────────────────────────────┤
│ Parser │ O(1) LRU cache │ 2ms │
│ Executor │ O(1) hash lookup │ 2ms │
│ Prompt │ Async git status │ 2ms │
│ Config │ Pre-compiled │ 0ms │
├─────────────────────────────────────────┤
│ Total Budget │ 10ms │
└─────────────────────────────────────────┘
# Run all tests (335 tests, 97% coverage)
cargo test
# Run benchmarks
cargo bench
# Run with coverage
cargo llvm-cov --html
# Color system demo
cargo run --example color
# Theme preview (robbyrussell, agnoster, pure, minimal)
cargo run --example theme
# Plugin system (git, docker aliases)
cargo run --example plugin
# Completion system
cargo run --example completion
# Shell initialization script
cargo run --example shell_init
# Zsh features (autocd, history, keybindings)
cargo run --example zsh_features
# Benchmark performance
cargo run --example benchmark
# Configuration parsing
cargo run --example basic_config
# Lint configuration
cargo run --example lint_config
# Prompt rendering
cargo run --example prompt
# Parser demo
cargo run --example parser
Development follows the Toyota Production System:
MIT