βοΈ ZSHAND Core ModulesΒΆ
π Core modules are the heart of the framework β they run after startup and before user post.d. They configure PATH, shell options, completions, aliases, widgets, hooks, plugins, and function autoloading. Load order is strictly numeric (02 β 04 β β¦ β 90).
π Related documentsΒΆ
| Pipeline | Architecture (boot sequence) Β· Startup (what runs before core) |
| Override | Config (rc.d/, same basename = replace) |
| Build | Build System (zprime, 06_engine) Β· Hooks (18_hooks) |
| Index | Documentation Index |
In this doc: Module reference β Numbering β Module details β User overrides (rc.d/)
Per-module API pages
Generated docs for each file (dependencies, usage) live under Source β api (e.g. source/core/06_engine.md). Run just docs-api after changing headers.
Override without forking
Put a file in ~/.config/zshand/rc.d/ with the same basename (e.g. 14_aliases.zsh) to replace a core module. Different name = add in order. Full layout: Config.
π 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 |
|---|---|
| ποΈ Architecture | Boot sequence and where core fits |
| π Startup | What runs before core (bootstrap, TOML, safe mode) |
| π€ Config | Override via rc.d/, config.toml, env |
| πͺ¨ Hooks | How 18_hooks.zsh classifies and loads hooks |
| π Header Standard | Module header format and doc generation |
| π Documentation Index | Full doc nav |