βοΈ ZSHAND Core ModulesΒΆ
π Core modules are the heart of the framework β they configure PATH, shell options, completions, aliases, widgets, hooks, plugins, and functions. Loaded in numeric order during startup.
π Module ReferenceΒΆ
| File | Purpose | Key Functions |
|---|---|---|
02_vars.zsh | Core variables, XDG paths, config.toml loading | β |
04_path.zsh | PATH construction from path.txt and system dirs | β |
06_engine.zsh | Build system, compilation, telemetry | zprime, zrun, _z_system_init |
08_audit.zsh | Integrity checking, logging, telemetry queries | zcheck, zfail, zsearch, zpulse |
10_options.zsh | Shell behavior (AUTO_CD, history, globbing, etc.) | β |
12_completions.zsh | Tab completion engine and styles | β |
14_aliases.zsh | Built-in command aliases | β |
16_widgets.zsh | Widget loader and keybinding registration | β |
18_hooks.zsh | Hook classification (critical vs lazy) and loading | β |
20_plugins.zsh | P10k theme, syntax highlighting, autosuggestions | β |
90_functions.zsh | Function directory loader | β |
π’ Numbering SchemeΒΆ
| Range | Owner | Purpose |
|---|---|---|
| 02β90 (even) | Framework | Core configuration |
| 01β99 (odd) | User | Reserved for insertion via rc.d/ |
Gaps between even numbers allow user scripts to interleave:
02_vars.zsh β framework
03_my_early.zsh β user (rc.d/)
04_path.zsh β framework
05_my_paths.zsh β user (rc.d/)
06_engine.zsh β framework
π Module DetailsΒΆ
02_vars.zsh β Variables & ConfigΒΆ
First module loaded. Establishes:
- Core paths (
ZSHAND,PROJECT_ROOT) - XDG directories (
XDG_CONFIG_HOME,XDG_CACHE_HOME, etc.) - User config loading (
config.toml,env.zsh,secrets.zsh) - Shell defaults and framework flags
- Self-sufficient β no dependencies on other core modules
04_path.zsh β PATH ConstructionΒΆ
Builds $PATH from:
- Framework
bin/directory - User
bin/directory - Entries from
path.txt(one per line) - System defaults
06_engine.zsh β Build & Runtime EngineΒΆ
The framework's engine. Provides:
zprime/zrβ Rebuild and compile framework bundleszrunβ Telemetry-aware command execution with logging_z_system_initβ Security enforcement, terminal titles- Atuin daemon lifecycle management
.zwcbytecode compilation
08_audit.zsh β Integrity & TelemetryΒΆ
System integrity and telemetry:
zcheckβ Framework health audit (bundles, permissions, deps)zfailβ Query recent failures from telemetryzsearchβ Search telemetry by patternzpulseβ Session summary (commands, success rate)
10_options.zsh β Shell OptionsΒΆ
Sets zsh behavior:
AUTO_CD,CORRECT,EXTENDED_GLOB- History configuration (size, dedup, sharing)
- Completion options
12_completions.zsh β Tab CompletionΒΆ
Configures the completion system:
compinitinitialization- Completion styles (menu, matching, grouping)
- Cache directory setup
14_aliases.zsh β AliasesΒΆ
Built-in aliases for common operations. User aliases in ~/.config/zshand/aliases.zsh load after this and can override.
16_widgets.zsh β Widget LoaderΒΆ
Loads ZLE widgets from widgets/ and user widgets/. Applies keybindings from config.toml via _az_bindkey_from_toml.
18_hooks.zsh β Hook ClassifierΒΆ
Classifies hooks as critical (sync) or lazy (deferred) and loads them. See HOOKS.md for details.
20_plugins.zsh β Plugin ManagerΒΆ
Loads Powerlevel10k theme, zsh-syntax-highlighting, and zsh-autosuggestions.
90_functions.zsh β Function LoaderΒΆ
Loads all function files from functions/ and user functions/, with override semantics (user files replace framework files with the same basename).
π User Overrides (rc.d/)ΒΆ
Place files in ~/.config/zshand/rc.d/:
- Same filename β replaces framework module entirely
- Different filename β both load in numeric order
# Override framework aliases completely
~/.config/zshand/rc.d/14_aliases.zsh
# Add custom options between vars and path
~/.config/zshand/rc.d/03_my_options.zsh
π Related DocumentsΒΆ
| Document | Purpose |
|---|---|
| π core/README.md | In-tree quick reference |
| ποΈ ARCHITECTURE.md | Full boot sequence |
| π€ USER_CONFIG.md | Override system (rc.d/) |
| π¨ STYLE_GUIDE.md | Naming and numbering conventions |