β‘ Auto-Full Bundle ModeΒΆ
π Auto-Full mode (
ZSHAND_AUTO_FULL=1) automatically compiles and loads a single bundle containing all framework + user code. No manual compilation steps β it just works.
π Quick SetupΒΆ
Add to ~/.zshenv (not env.zsh or .zshrc):
Or use the template:
Start a new shell. First run auto-compiles:
π¨ Auto-compiling full bundle (first run)...
β Compiling zshand-full.zwc...
β Full bundle compiled successfully
Every subsequent shell start loads the cached bundle silently.
Must be ~/.zshenv
This flag must be set in ~/.zshenv because it's checked before the framework loads. Setting it in ~/.config/zshand/env.zsh creates a circular dependency (that file is inside the bundle).
π How It WorksΒΆ
Shell starts β zshrc.zsh
β
ββ FAST PATH (bundle cached)
β Check ZSHAND_AUTO_FULL=1 + bundle file exists?
β β YES: source bundle β done (~15-40ms)
β
ββ STANDARD PATH (first run or bundle missing)
Load build functions β compile bundle β source bundle (~200-500ms)
β
ββ FALLBACK (compile fails)
Standard hybrid loading proceeds β shell still works
Guard conditions (all must be true for auto-full):
ZSHAND_AUTO_FULL=1ZSHAND_DEV_MODE=0(not in dev mode)ZSHAND_AUDIT_MODE=0(not in audit mode)
π¦ What's in the BundleΒΆ
The compiled bundle includes everything in the correct load order:
| # | Component | Source |
|---|---|---|
| 1 | π§± Shared functions | shared_functions/ |
| 2 | π Startup scripts | startup/ |
| 3 | π User environment | env.zsh, secrets.zsh, config.toml |
| 4 | π§ User init scripts | init.d/*.zsh (sorted) |
| 5 | π€οΈ PATH injection | Compile-time from path.txt |
| 6 | βοΈ Core + overrides | Framework core/ + user rc.d/ (merged) |
| 7 | π οΈ Functions | Framework + user (merged) |
| 8 | β¨οΈ Widgets | Framework + user (merged) |
| 9 | πͺ¨ Hooks | Framework + user (merged) |
| 10 | π Private functions | private_functions/ |
| 11 | π Aliases | aliases.zsh |
| 12 | π Post scripts | post.d/*.zsh (sorted) |
π Override SemanticsΒΆ
User files with the same basename completely replace framework files:
~/.config/zshand/functions/seek.zsh β overrides $ZSHAND/functions/seek.zsh
~/.config/zshand/widgets/aicmit.zsh β overrides $ZSHAND/widgets/aicmit.zsh
~/.config/zshand/rc.d/14_aliases.zsh β overrides $ZSHAND/core/14_aliases.zsh
Files with unique basenames are added alongside framework files.
β‘ PerformanceΒΆ
| Scenario | Time | Notes |
|---|---|---|
| π¨ First run (compiles) | ~200β500ms | One-time cost |
| β‘ Subsequent runs (cached) | ~15β40ms | Fast path β no build functions loaded |
| π vs. Hybrid loading | ~50% faster | No per-directory compilation checks |
| π§ vs. Dev mode | ~10Γ faster | No individual file sourcing |
The fast path skips loading build infrastructure entirely when the bundle is already cached, saving ~10ms per shell start.
π When to RecompileΒΆ
The bundle is compiled once and reused. Recompile when you change anything:
# After modifying user config (aliases, functions, hooks, etc.)
zrecompile user
# After updating the framework (git pull)
zrecompile framework
# After changing both
zrecompile both
# Full manual rebuild
zfull
Or delete the cache and let auto-full recompile on next start:
π Comparison with Other ModesΒΆ
| Mode | Trigger | Contents | Best For |
|---|---|---|---|
Auto-Full (ZSHAND_AUTO_FULL=1) | Automatic | Framework + user | Zero-config production |
Manual Full (ZSHAND_USE_MONOLITHIC=1 + zfull) | Manual | Framework + user | Explicit control |
Framework-Only (ZSHAND_USE_MONOLITHIC=1 + zprime) | Manual | Framework only | Testing / minimal |
| Hybrid (default) | Automatic | Framework + user | Balanced / development |
Dev Mode (.dev file or dirty git) | Automatic | Sources raw .zsh | Active development |
π« When It's SkippedΒΆ
Auto-full is automatically bypassed in these situations:
- Dev mode β
ZSHAND_DEV_MODE=1or.devfile exists (you want raw file loading) - Audit mode β
ZSHAND_AUDIT_MODE=1(needs full recompile + test cycle) - Explicitly disabled β
ZSHAND_AUTO_FULL=0or unset
π§ TroubleshootingΒΆ
Bundle fails to compileΒΆ
Causes: Missing config directory, syntax errors in user files, disk full.
Fix:
- Check config dir exists:
ls -la ~/.config/zshand - Test compilation manually:
zfull - Check syntax:
zsh -n ~/.config/zshand/rc.d/*.zsh
Functions missing after adding new filesΒΆ
The bundle was compiled before you added the files. Recompile:
Want fresh bundle every startΒΆ
Don't use auto-full. Instead:
# In ~/.zshenv
export ZSHAND_USE_MONOLITHIC=1
# Then manually run before each session:
zfull && exec zsh
π Related DocumentsΒΆ
| Document | Purpose |
|---|---|
| ποΈ ARCHITECTURE.md | Bundle system and loading modes |
| β‘ PERFORMANCE.md | Profiling and benchmarking |
| π€ USER_CONFIG.md | User configuration directory |
| π§ TROUBLESHOOTING.md | Bundle troubleshooting |
| π build/README.md | Build system details |