@sebastienrousseau/dotfiles 0.2.508 → 0.2.511
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/README.md +5 -5
- package/docs/COPYRIGHT +1 -1
- package/docs/GOVERNANCE.md +2 -2
- package/docs/adr/ADR-011-nushell-tier3-keep.md +2 -2
- package/docs/articles/.pages +6 -0
- package/docs/articles/2026-07-05-custom-mkdocs-material-dark-theme.md +216 -0
- package/docs/articles/2026-07-05-fish-startup-abbr.md +153 -0
- package/docs/articles/2026-07-05-master-to-main-rename-runbook.md +128 -0
- package/docs/articles/index.md +36 -0
- package/docs/guides/INSTALL.md +3 -3
- package/docs/index.md +116 -27
- package/docs/interop/A2A.md +2 -2
- package/docs/interop/POWERSHELL.md +4 -4
- package/docs/manual/00-introduction.md +3 -3
- package/docs/manual/01-concepts/02-trust-model.md +3 -3
- package/docs/manual/01-concepts/04-fleet.md +1 -1
- package/docs/manual/02-tutorials/01-first-install.md +1 -1
- package/docs/manual/02-tutorials/05-deploy-fleet.md +2 -2
- package/docs/manual/03-reference/02-config-files.md +1 -1
- package/docs/manual/03-reference/04-templates.md +1 -1
- package/docs/manual/04-cookbook/01-recipes.md +1 -1
- package/docs/manual/04-cookbook/02-troubleshooting.md +1 -1
- package/docs/manual/05-appendices/B-security-checklist.md +1 -1
- package/docs/manual/command-index.md +76 -1
- package/docs/manual/index.md +1 -1
- package/docs/operations/ARCHITECTURE_ROADMAP.md +145 -0
- package/docs/operations/CI_CADENCE.md +2 -2
- package/docs/operations/COMPLETIONS.md +2 -2
- package/docs/operations/COVERAGE.md +4 -4
- package/docs/operations/DRIFT.md +1 -1
- package/docs/operations/MAINTENANCE.md +6 -6
- package/docs/operations/PERFORMANCE.md +6 -6
- package/docs/operations/RELIABILITY.md +1 -1
- package/docs/operations/ROADMAP_V0_2_503.md +1 -1
- package/docs/operations/TRACEABILITY.md +2 -0
- package/docs/operations/TRUSTED_AGENT_WORKSTATION.md +6 -6
- package/docs/operations/VERSION_SYNC.md +3 -3
- package/docs/reference/UTILS.md +82 -0
- package/docs/security/AUDIT_BYPASS.md +3 -3
- package/docs/security/AUTOMATION_SECRETS.md +1 -1
- package/docs/security/CI_PINNING.md +10 -10
- package/docs/security/COMMIT_SIGNING.md +10 -10
- package/docs/security/DEPS_DEV_EXCEPTIONS.md +4 -4
- package/docs/security/DISCLOSURE.md +3 -3
- package/docs/security/INCIDENT_RESPONSE.md +1 -1
- package/docs/security/INSTALL_VERIFICATION.md +2 -2
- package/docs/security/MCP_POLICY.md +4 -4
- package/docs/security/SCORECARD.md +7 -7
- package/docs/security/SECURITY_CHECKLIST.md +1 -1
- package/docs/security/SHELL_EXEMPTIONS.md +2 -2
- package/docs/security/SOUP_REGISTER.md +4 -4
- package/docs/stylesheets/extra.css +444 -0
- package/docs/themes/hero-shot.svg +1 -1
- package/install.sh +17 -6
- package/package.json +1 -1
- package/scripts/ci/check-copyright-headers.sh +1 -1
- package/scripts/ci/check-shell-preamble.sh +1 -1
- package/scripts/ci/guard-gitleaks-checkout.sh +1 -1
- package/scripts/diagnostics/aliases-manifest.sh +19 -1
- package/scripts/diagnostics/verify_state.sh +6 -2
- package/scripts/diagnostics/version-locks.sh +10 -6
- package/scripts/dot/commands/agent.sh +12 -7
- package/scripts/dot/commands/ai.sh +8 -5
- package/scripts/dot/commands/appearance.sh +14 -1
- package/scripts/dot/commands/completion.sh +134 -0
- package/scripts/dot/commands/core.sh +8 -0
- package/scripts/dot/commands/diagnostics.sh +16 -0
- package/scripts/dot/commands/fleet.sh +11 -4
- package/scripts/dot/commands/lint.sh +55 -30
- package/scripts/dot/commands/registry.sh +7 -1
- package/scripts/dot/commands/secrets.sh +61 -7
- package/scripts/dot/commands/security.sh +8 -0
- package/scripts/dot/commands/tools.sh +11 -2
- package/scripts/dot/powershell/Dot.psm1 +1 -1
- package/scripts/git-hooks/pre-commit-audit.sh +1 -1
- package/scripts/ops/heal-tools.sh +28 -0
- package/scripts/ops/teleport.sh +2 -2
- package/scripts/qa/examples-coverage.sh +94 -0
- package/scripts/tools/detect-collisions.py +19 -1
- package/scripts/version-sync.sh +36 -2
- package/docs/_config.yml +0 -59
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
This file documents all notable changes to this project.
|
|
4
4
|
|
|
5
|
+
## v0.2.511 — 2026-07-08
|
|
6
|
+
|
|
7
|
+
Bug-fix release: restore shell aliases that were silently dropped after the CD-completion fragment.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **`reload`, `r`, `mkcd`, `quit` — and every alias/function defined after the CD-completion block — were undefined** whenever `compdef` was not yet available when `90-ux-aliases.sh` was sourced (profiles that don't run `compinit`, and fast-startup shells). The zsh branch of `defaults/.chezmoitemplates/aliases/cd/cd-completion.aliases.sh` skipped completion registration with a **file-scope `return 0`**; because that fragment is inlined into the single concatenated `90-ux-aliases.sh`, the bare `return` aborted the whole file, dropping `set_default_aliases()` (which defines `reload` et al.) and everything after it. Replaced the early-return with a positive `if command -v compdef …; then … fi` guard, so only the completion block is skipped when `compdef` is not ready.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- **`scripts/version-sync.sh`**: excluded the two dated release write-ups (`docs/articles/2026-07-05-*.md`) from version verification. They record the release they shipped in ("shipped in v0.2.510" + release-tag link) as historical fact; the `--verify` pass was false-flagging those refs as inconsistent even though the update pass correctly leaves them alone.
|
|
16
|
+
|
|
17
|
+
## v0.2.510 — 2026-07-05
|
|
18
|
+
|
|
19
|
+
Post-v0.2.509 quality-of-life release: default branch renamed `master` → `main`, docs site relit with a custom dark + terminal-green MkDocs Material theme, shells warmed up (fish alias→abbr, zsh PATH prune), font bumped to 20pt across every terminal template, themes rebuilt from wallpapers.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- **Custom docs theme** (#960). doc.dotfiles.io now serves MkDocs Material with a bespoke palette (near-black `#0b0e14` background, terminal-green `#7ee787` accent), Inter + JetBrains Mono fonts, hero + 8-card feature grid landing page. Header, tabs, sidebar, TOC, admonitions, code blocks, tables, custom scrollbar all restyled in `docs/stylesheets/extra.css`.
|
|
24
|
+
- **CLAUDE.md `## Handing over commands` rule** (#959). Cross-project preference deployed to `~/.claude/CLAUDE.md`: when Claude Code needs the user to run shell steps themselves, it must hand them over as one runnable script file, not fenced code blocks or scattered one-liners.
|
|
25
|
+
- **`mirror-main-to-master` workflow** (#961). Fast-forwards `master` from `main` on every push during the rename grace period so bookmarked `raw.githubusercontent.com/…/master/…` install URLs keep resolving. Retire on 2027-07-05 per tracking issue #962.
|
|
26
|
+
- **fish alias-cache pre-warm** (#964). New `run_onchange_after_30-regen-fish-alias-cache.sh.tmpl` regenerates `~/.cache/fish/bash-aliases.fish` at chezmoi-apply time when the alias sources change, so the first fish shell after apply doesn't pay ~200ms rebuilding the cache from scratch.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- **Default branch: `master` → `main`** (#961). GitHub-side rename plus 96 in-repo edits (workflow triggers, docs URIs, install URLs, ruleset filename, git aliases). Every `raw.githubusercontent.com/…/master/…` and `github.com/…/blob/master/…` reference now points at `/main/`. Workflow `pull_request:` / `push:` triggers keep `master` as a grace-period fallback until the mirror is retired.
|
|
31
|
+
- **Portability + missing commands** (#953). Ships as part of v0.2.509 via PR #953 (already tagged) — cross-platform fixes for macOS/BSD/Alpine/openSUSE (base64 `-D` fallback, `sort -V` stdin buffering, `date +%s%3N` guards, zypper/apk/pkg package-manager detection) plus wiring for `dot teleport`, `dot uninstall`, `dot policy`, `dot secret-audit`, `dot completion <bash|zsh|fish|nu>`, `dot fonts patch`. Cross-shell parity for `dot secrets load --shell posix|fish|nu` and auto-secret-load in bash/fish/nushell. See [v0.2.509 release notes](https://github.com/sebastienrousseau/dotfiles/releases/tag/v0.2.509).
|
|
32
|
+
- **Terminal font 12 → 20** (#963). `defaults/.chezmoidata.toml` and every terminal template (alacritty, wezterm, ghostty, kitty, waybar) bumped so a fresh install reads at 20pt across the surface.
|
|
33
|
+
- **Themes rebuilt** (#963). K-Means CIELAB color extraction re-run over all 206 detected wallpapers → 752 theme sections. Five dark themes removed where the underlying wallpaper is inherently light-toned (hello, iphone, valentine, modern, firewatch) — their `-light` counterparts kept.
|
|
34
|
+
- **Zsh PATH prune** (#963). The pre-existing dedup+prune tail in `00-core-paths.sh` was gated behind `[ -z "$ZSH_VERSION" ]`, so zsh never pruned. Now runs native zsh path-array iteration for zsh (89 → 77 entries with no non-existent dirs) alongside the existing bash 4+ associative-array and bash 3.x awk paths.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- **Fish startup 217 ms → 119 ms** (#963). `defaults/dot_config/fish/conf.d/aliases.fish.tmpl` now writes the bash-bridge cache as `abbr --add NAME -- VALUE` instead of `alias NAME=VALUE`. Fish's `alias` builtin creates one function per entry (~183 µs); `abbr` is a command-line-time expansion at ~40 µs. Sourcing the same 878-entry cache went 170 ms → 34 ms. Cache self-heals on upgrade (staleness now also fires on the old `alias` format).
|
|
39
|
+
- **Scorecard code-scanning alerts** (this release, #965). Nine `TokenPermissionsID` alerts closed by adding top-level `permissions: contents: read` (least-privilege default) to workflows that only declared job-level write permissions. One `PinnedDependenciesID` alert closed by hash-locking `requirements-docs.txt` via `pip-compile --generate-hashes` and switching pages.yml to `pip install --require-hashes`.
|
|
40
|
+
|
|
41
|
+
### Housekeeping
|
|
42
|
+
|
|
43
|
+
- Bumped `package.json`, `defaults/.chezmoidata.toml`, and every managed markdown reference from `v0.2.508` → `v0.2.510` (26 files consistent).
|
|
44
|
+
- Pruned the stale `feat/v0.2.509` local branch (its remote was deleted at merge time).
|
|
45
|
+
- Retired the `.git/*.sh` session helper scripts left over from the rename + docs-theme + housekeeping PRs.
|
|
46
|
+
|
|
5
47
|
## v0.2.508 — 2026-06-30
|
|
6
48
|
|
|
7
49
|
Makes `dot apply` / `dot update` behave like an OS package-manager update —
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://github.com/sebastienrousseau/dotfiles/actions"><img src="https://img.shields.io/github/actions/workflow/status/sebastienrousseau/dotfiles/ci.yml?style=for-the-badge&logo=githubactions&logoColor=white" alt="Build" /></a>
|
|
13
|
-
<a href="https://github.com/sebastienrousseau/dotfiles/releases/latest"><img src="https://img.shields.io/badge/Version-v0.2.
|
|
13
|
+
<a href="https://github.com/sebastienrousseau/dotfiles/releases/latest"><img src="https://img.shields.io/badge/Version-v0.2.511-blue?style=for-the-badge&logo=semanticrelease&logoColor=white" alt="Version" /></a>
|
|
14
14
|
<a href="https://github.com/sebastienrousseau/dotfiles/releases"><img src="https://img.shields.io/github/downloads/sebastienrousseau/dotfiles/total?style=for-the-badge&logo=github&logoColor=white" alt="Downloads" /></a>
|
|
15
15
|
<a href="https://codespaces.new/sebastienrousseau/dotfiles"><img src="https://img.shields.io/badge/Open%20in-Codespaces-blue?style=for-the-badge&logo=github&logoColor=white" alt="Open in GitHub Codespaces" /></a>
|
|
16
16
|
<a href="https://scorecard.dev/viewer/?uri=github.com/sebastienrousseau/dotfiles"><img src="https://img.shields.io/ossf-scorecard/github.com/sebastienrousseau/dotfiles?style=for-the-badge&logo=linuxfoundation&logoColor=white&label=OpenSSF%20Scorecard" alt="OpenSSF Scorecard" /></a>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
--idle-time-limit 1 --rows 30 --cols 100 \
|
|
31
31
|
--title "Dotfiles: install → doctor → theme"
|
|
32
32
|
# in the recording shell:
|
|
33
|
-
# curl -fsSL https://raw.githubusercontent.com/sebastienrousseau/dotfiles/
|
|
33
|
+
# curl -fsSL https://raw.githubusercontent.com/sebastienrousseau/dotfiles/main/install.sh | bash
|
|
34
34
|
# dot doctor
|
|
35
35
|
# dot theme rebuild --force
|
|
36
36
|
# then Ctrl-D to stop
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
curl -fsSL -o /tmp/dotfiles-install.sh \
|
|
55
|
-
https://raw.githubusercontent.com/sebastienrousseau/dotfiles/v0.2.
|
|
55
|
+
https://raw.githubusercontent.com/sebastienrousseau/dotfiles/v0.2.511/install.sh
|
|
56
56
|
echo "d5a04c5e2813a93a63c8ecce9655cf3d107f6068862c6eba84a92cf22f801c7e /tmp/dotfiles-install.sh" \
|
|
57
57
|
| shasum -a 256 -c
|
|
58
58
|
bash /tmp/dotfiles-install.sh
|
|
@@ -61,7 +61,7 @@ bash /tmp/dotfiles-install.sh
|
|
|
61
61
|
**Trust-source one-liner** (skips the SHA check — fine for sandboxes and ephemeral CI, not recommended for primary workstations):
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
bash -c "$(curl -fsSL https://raw.githubusercontent.com/sebastienrousseau/dotfiles/
|
|
64
|
+
bash -c "$(curl -fsSL https://raw.githubusercontent.com/sebastienrousseau/dotfiles/main/install.sh)"
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
Then verify and explore:
|
|
@@ -80,7 +80,7 @@ Silent install (no prompts):
|
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
82
|
DOTFILES_SILENT=1 DOTFILES_NONINTERACTIVE=1 \
|
|
83
|
-
bash -c "$(curl -fsSL https://raw.githubusercontent.com/sebastienrousseau/dotfiles/
|
|
83
|
+
bash -c "$(curl -fsSL https://raw.githubusercontent.com/sebastienrousseau/dotfiles/main/install.sh)"
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
Docker sandbox:
|
package/docs/COPYRIGHT
CHANGED
package/docs/GOVERNANCE.md
CHANGED
|
@@ -22,7 +22,7 @@ exist.
|
|
|
22
22
|
## Contribution flow
|
|
23
23
|
|
|
24
24
|
1. **Issue** for non-trivial work. Confirm scope before coding.
|
|
25
|
-
2. **Branch** off `
|
|
25
|
+
2. **Branch** off `main`: `feat/<scope>`, `fix/<scope>`,
|
|
26
26
|
`docs/<scope>`, etc.
|
|
27
27
|
3. **PR** with description following the template:
|
|
28
28
|
- Summary (1–3 bullets)
|
|
@@ -51,7 +51,7 @@ For breaking changes or substantial new features:
|
|
|
51
51
|
- **Backwards compatibility** (what breaks, migration path)
|
|
52
52
|
- **Alternatives considered** (with reasons rejected)
|
|
53
53
|
- **Unresolved questions**
|
|
54
|
-
2. Open a PR labelled `rfc` against `
|
|
54
|
+
2. Open a PR labelled `rfc` against `main`.
|
|
55
55
|
3. Comment window: 14 days minimum.
|
|
56
56
|
4. Maintainer renders a decision (accept / accept-with-changes /
|
|
57
57
|
reject) with public reasoning in the PR.
|
|
@@ -137,8 +137,8 @@ plugin system, bash bridge for aliases) await an actual user request.
|
|
|
137
137
|
|
|
138
138
|
## References
|
|
139
139
|
|
|
140
|
-
- [`dot_config/nushell/cached_eval.nu`](
|
|
141
|
-
- [`dot_config/nushell/env.nu.tmpl`](
|
|
140
|
+
- [`dot_config/nushell/cached_eval.nu`](https://github.com/sebastienrousseau/dotfiles/blob/main/defaults/dot_config/nushell/cached_eval.nu) — the new module.
|
|
141
|
+
- [`dot_config/nushell/env.nu.tmpl`](https://github.com/sebastienrousseau/dotfiles/blob/main/defaults/dot_config/nushell/env.nu.tmpl) — adopter.
|
|
142
142
|
- ADR-007 (Multi-Shell Parity Strategy) — establishes the tier definitions.
|
|
143
143
|
- ADR-002 (Shell Performance Optimization Strategy) — establishes `_cached_eval` semantics this module ports.
|
|
144
144
|
- Issue [#880](https://github.com/sebastienrousseau/dotfiles/issues/880).
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Custom Documentation Sites in 2026: Building a Distinctive Dark-Themed Developer Reference on MkDocs Material Without Forking"
|
|
3
|
+
description: A three-file recipe for a bespoke MkDocs Material theme — terminal-green on near-black, custom hero + card grid, hash-locked build. No custom_dir, no fork.
|
|
4
|
+
date: 2026-07-05
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Custom Documentation Sites in 2026: Building a Distinctive Dark-Themed Developer Reference on MkDocs Material Without Forking
|
|
8
|
+
|
|
9
|
+
*Documentation is the public API surface of an open-source project; the difference between the default Material theme and a bespoke palette is the difference between "reads like every other project" and "reads like this specific project".*
|
|
10
|
+
|
|
11
|
+
*Sebastien Rousseau · Published 5 Jul 2026 · 11 min read*
|
|
12
|
+
|
|
13
|
+
## Why Documentation Aesthetics Matter in 2026 #
|
|
14
|
+
|
|
15
|
+
An open-source project's documentation site is the first surface an evaluator touches — before the README, before the release notes, before the code. In 2026, the density of developer-tool competition means that visual differentiation carries measurable weight: does the site feel like a curated product, or does it feel like a Jekyll-Cayman default from 2019? The felt distinction shapes adoption decisions before the reader has read a single sentence.
|
|
16
|
+
|
|
17
|
+
The reference standard for "distinctive open-source documentation" is [docs.n8n.io](https://docs.n8n.io) — dark, polished, opinionated, immediately identifiable as n8n's. n8n runs on GitBook, a commercial SaaS. Most open-source projects, [.dotfiles](https://doc.dotfiles.io) included, cannot justify GitBook's licensing but can invest in MkDocs Material customisation to achieve equivalent visual distinction on an open-source stack.
|
|
18
|
+
|
|
19
|
+
This article documents the migration of [doc.dotfiles.io](https://doc.dotfiles.io) from Jekyll's Cayman theme (the default when GitHub Pages serves markdown without a MkDocs configuration) to a fully customised MkDocs Material theme with a terminal-green-on-near-black palette, custom typography, and a hero + card-grid landing page.
|
|
20
|
+
|
|
21
|
+
## The Custom Docs Theme 2026 Architecture Lens #
|
|
22
|
+
|
|
23
|
+
MkDocs Material's customisation surface has four distinct layers, each with different capabilities and constraints:
|
|
24
|
+
|
|
25
|
+
| Layer | Design Decision | Why It Matters | Risk if Mishandled |
|
|
26
|
+
|---|---|---|---|
|
|
27
|
+
| **Palette declaration** | `mkdocs.yml` `theme.palette.primary: custom` + `accent: custom` | Signals to MkDocs Material that CSS custom properties will drive the palette rather than a named preset (green, teal, indigo, etc.) | Named presets constrain the palette to Material Design's colour tokens; `custom` unlocks arbitrary hex values via CSS variables |
|
|
28
|
+
| **CSS custom-property overrides** | `docs/stylesheets/extra.css` sets `--md-primary-fg-color`, `--md-accent-fg-color`, `--md-default-bg-color`, `--md-code-bg-color` under `[data-md-color-scheme="slate"]` | The single source of truth for the palette. Every Material component reads from these variables | Overriding component-level CSS rules rather than variables creates unmaintainable per-component drift as MkDocs Material upgrades |
|
|
29
|
+
| **Component restyling** | Same `extra.css` overrides selectors like `.md-header`, `.md-nav__link`, `.grid.cards > ul > li` | Where the "feels bespoke" work happens — spacing, borders, hover states, gradients, backdrop blur | Under-styling produces "Material Design in a different colour"; over-styling drifts away from Material's ergonomic defaults |
|
|
30
|
+
| **Landing-page markup** | `docs/index.md` with Front-Matter `hide: [navigation, toc]` + `<section class="dot-hero">` + `<div class="grid cards" markdown>` | The homepage is the highest-impact surface; it should not look like a table of contents | Default MkDocs Material index reads like documentation; a custom hero reads like a product page |
|
|
31
|
+
|
|
32
|
+
## Key Documentation-UX Signals #
|
|
33
|
+
|
|
34
|
+
| Signal | Operational Benchmark | Reference | Technical Platform Implementation |
|
|
35
|
+
|---|---|---|---|
|
|
36
|
+
| **Time-to-first-CTA** | Hero action button visible above the fold in ≤ 100 ms of first-paint | Landing-page conversion norms | Custom hero section with primary and secondary CTAs immediately below the site title |
|
|
37
|
+
| **Palette Distinctiveness** | Primary accent color is unique to the project, not a Material Design preset | Brand recognition | CSS custom property overrides on `[data-md-color-scheme]` selectors |
|
|
38
|
+
| **Reading Contrast** | WCAG AA compliance on all text-on-background pairs | Accessibility gate | `--md-default-fg-color` (`#e4e7ec`) on `--md-default-bg-color` (`#0b0e14`) = 15.6:1 ratio |
|
|
39
|
+
| **Cognitive Load per Section** | Feature-card grid on landing page (visual chunking) rather than a bulleted link list | Landing-page ergonomics | `<div class="grid cards" markdown>` + 8 cards with material icons |
|
|
40
|
+
| **Build Reproducibility** | `mkdocs.yml` + `docs/stylesheets/extra.css` under version control; hashes locked in `requirements-docs.txt` | Supply-chain hygiene | `pip-compile --generate-hashes` + `pip install --require-hashes` in the Pages workflow |
|
|
41
|
+
| **Cache Cost at Edge** | CDN TTL respected; theme changes propagate to `doc.<domain>` within 10 minutes | Deployment latency | Cloudflare (or equivalent) `max-age=600` on the site |
|
|
42
|
+
|
|
43
|
+
## Diagnosis: What "Default MkDocs Material" Leaves on the Table #
|
|
44
|
+
|
|
45
|
+
An out-of-the-box MkDocs Material site with `primary: teal, accent: teal` and no `extra_css` is visually acceptable — but it is one of many thousand acceptable sites that look identically acceptable. The named presets are constrained to Google's Material Design palette; the sidebar, header, and content surface all read as "Material default".
|
|
46
|
+
|
|
47
|
+
For a project positioning itself as "an opinionated developer platform, not a library", the visual signal that the docs are *the product's* docs — not somebody else's — is a marketing surface, not a decoration. The lift is contained to three files:
|
|
48
|
+
|
|
49
|
+
- `mkdocs.yml` — palette selector configuration
|
|
50
|
+
- `docs/stylesheets/extra.css` — the actual palette + typography + component overrides
|
|
51
|
+
- `docs/index.md` — hero + card grid replacing the default index
|
|
52
|
+
|
|
53
|
+
No template overrides (`custom_dir`), no plugin authoring, no JavaScript. All the customisation lives in files MkDocs Material is explicitly designed to consume.
|
|
54
|
+
|
|
55
|
+
## Remediation: The Three-File Custom Theme #
|
|
56
|
+
|
|
57
|
+
### `mkdocs.yml` Palette Configuration
|
|
58
|
+
|
|
59
|
+
The magic value that unlocks CSS-driven colours is `primary: custom` (and `accent: custom`). Under `[data-md-color-scheme="slate"]`, MkDocs Material's dark variant, every component reads its colours from CSS custom properties that we get to define.
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
theme:
|
|
63
|
+
name: material
|
|
64
|
+
font:
|
|
65
|
+
text: Inter
|
|
66
|
+
code: JetBrains Mono
|
|
67
|
+
palette:
|
|
68
|
+
- media: "(prefers-color-scheme: dark)"
|
|
69
|
+
scheme: slate
|
|
70
|
+
primary: custom
|
|
71
|
+
accent: custom
|
|
72
|
+
- media: "(prefers-color-scheme: light)"
|
|
73
|
+
scheme: default
|
|
74
|
+
primary: custom
|
|
75
|
+
accent: custom
|
|
76
|
+
features:
|
|
77
|
+
- navigation.tabs
|
|
78
|
+
- navigation.tabs.sticky
|
|
79
|
+
- navigation.footer
|
|
80
|
+
- content.code.copy
|
|
81
|
+
|
|
82
|
+
extra_css:
|
|
83
|
+
- stylesheets/extra.css
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The `navigation.tabs.sticky` feature keeps the top-level navigation visible on scroll, which pairs with the hero + card grid to keep the site feeling like a product page rather than a scrolling article.
|
|
87
|
+
|
|
88
|
+
### `docs/stylesheets/extra.css` — Palette + Component Overrides
|
|
89
|
+
|
|
90
|
+
The stylesheet is organised in five zones: CSS custom properties for the palette, typography, dark-scheme palette overrides, per-component restyling, and the custom hero + grid-card styles.
|
|
91
|
+
|
|
92
|
+
```css
|
|
93
|
+
:root {
|
|
94
|
+
--dot-green: #7ee787; /* terminal green — primary */
|
|
95
|
+
--dot-green-bright: #b0f5b7; /* hover / focused */
|
|
96
|
+
--dot-green-dim: #4a9153; /* muted */
|
|
97
|
+
--dot-bg: #0b0e14; /* near-black base */
|
|
98
|
+
--dot-bg-elev: #111621; /* elevated card */
|
|
99
|
+
--dot-fg: #e4e7ec;
|
|
100
|
+
--dot-fg-muted: #94a3b8;
|
|
101
|
+
--dot-border: #1f2937;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[data-md-color-scheme="slate"] {
|
|
105
|
+
--md-default-bg-color: var(--dot-bg);
|
|
106
|
+
--md-default-fg-color: var(--dot-fg);
|
|
107
|
+
--md-primary-fg-color: var(--dot-green);
|
|
108
|
+
--md-accent-fg-color: var(--dot-green-bright);
|
|
109
|
+
--md-typeset-a-color: var(--dot-green);
|
|
110
|
+
--md-code-bg-color: #161b26;
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The choice of `#7ee787` (GitHub's terminal green) as the accent is deliberate: it reads as "developer tool" to the target audience without being GitHub-branded, and the WCAG contrast on the `#0b0e14` background exceeds 12:1 for text and 4.5:1 for the accent-on-background — comfortably above AA thresholds.
|
|
115
|
+
|
|
116
|
+
Component overrides are targeted at the highest-impact surfaces:
|
|
117
|
+
|
|
118
|
+
```css
|
|
119
|
+
/* Header: blurred backdrop-saturate for a floating feel */
|
|
120
|
+
.md-header {
|
|
121
|
+
background-color: rgba(11, 14, 20, 0.92);
|
|
122
|
+
backdrop-filter: saturate(180%) blur(12px);
|
|
123
|
+
border-bottom: 1px solid var(--dot-border);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Grid cards on landing page — hover lift + accent glow */
|
|
127
|
+
.md-typeset .grid.cards > :is(ul, ol) > li {
|
|
128
|
+
background: var(--dot-bg-elev);
|
|
129
|
+
border: 1px solid var(--dot-border);
|
|
130
|
+
border-radius: 12px;
|
|
131
|
+
transition: transform 180ms ease, border-color 180ms ease;
|
|
132
|
+
}
|
|
133
|
+
.md-typeset .grid.cards > :is(ul, ol) > li:hover {
|
|
134
|
+
transform: translateY(-2px);
|
|
135
|
+
border-color: rgba(126, 231, 135, 0.35);
|
|
136
|
+
box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### `docs/index.md` — Hero + Grid Cards
|
|
141
|
+
|
|
142
|
+
The landing page is not documentation — it is a product surface. MkDocs Material's `md_in_html` extension allows Markdown to nest inside a custom HTML section:
|
|
143
|
+
|
|
144
|
+
```markdown
|
|
145
|
+
---
|
|
146
|
+
hide:
|
|
147
|
+
- navigation
|
|
148
|
+
- toc
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
<section class="dot-hero" markdown>
|
|
152
|
+
|
|
153
|
+
# .dotfiles
|
|
154
|
+
|
|
155
|
+
<p class="tagline">Cross-platform, signed, local-first dotfiles…</p>
|
|
156
|
+
|
|
157
|
+
<div class="buttons">
|
|
158
|
+
<a class="primary" href="guides/INSTALL/">Install →</a>
|
|
159
|
+
<a href="https://github.com/sebastienrousseau/dotfiles">GitHub</a>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
</section>
|
|
163
|
+
|
|
164
|
+
## What's inside
|
|
165
|
+
|
|
166
|
+
<div class="grid cards" markdown>
|
|
167
|
+
|
|
168
|
+
- :material-console:{ .lg .middle } **Multi-shell parity**
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
Bash, Zsh, Fish, Nushell — same aliases, functions, prompt, and completions.
|
|
173
|
+
|
|
174
|
+
[→ Shell hub](https://doc.dotfiles.io/reference/UTILS/)
|
|
175
|
+
|
|
176
|
+
</div>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The `hide: [navigation, toc]` front-matter removes the sidebar and right-column table-of-contents on this page only — the landing page gets the full canvas, sub-pages retain the standard docs layout.
|
|
180
|
+
|
|
181
|
+
## Verification: Build, Deploy, Contrast #
|
|
182
|
+
|
|
183
|
+
The custom theme adds ~12 KB of CSS to the built site. Local `mkdocs build --clean` completes in ~2 seconds. The Pages workflow uses hash-locked dependencies (`pip install --require-hashes -r requirements-docs.txt`) to keep the build reproducible across MkDocs Material and its 30+ transitive dependencies.
|
|
184
|
+
|
|
185
|
+
Accessibility contrast measured on the deployed site:
|
|
186
|
+
|
|
187
|
+
- Body text (`#e4e7ec` on `#0b0e14`) — **15.6:1** (WCAG AAA)
|
|
188
|
+
- Accent (`#7ee787` on `#0b0e14`) — **12.4:1** (WCAG AAA)
|
|
189
|
+
- Muted text (`#94a3b8` on `#0b0e14`) — **7.2:1** (WCAG AAA)
|
|
190
|
+
|
|
191
|
+
Cloudflare CDN cache invalidation after Pages deploy: ~10 minutes on `max-age=600`. Fetching the GitHub Pages origin (`sebastienrousseau.github.io/dotfiles/`) reflects the new theme immediately; the CDN-fronted custom domain propagates within one cache TTL.
|
|
192
|
+
|
|
193
|
+
## Return on Resilience #
|
|
194
|
+
|
|
195
|
+
| Metric | Before (Jekyll Cayman) | After (Custom MkDocs Material) |
|
|
196
|
+
|---|---|---|
|
|
197
|
+
| Page weight | 2.9 KB | 14.8 KB (compressed 4.2 KB) |
|
|
198
|
+
| Time to visible hero | ~800 ms (no hero) | ~150 ms |
|
|
199
|
+
| WCAG AA compliance | Passes body text; hero absent | Passes AAA on all text pairs |
|
|
200
|
+
| Landing-page CTAs | 0 (link list only) | 4 (primary + 3 secondary) |
|
|
201
|
+
| Visual differentiation from default | Zero | Distinctive palette + hero + grid |
|
|
202
|
+
| Build reproducibility | Jekyll on `github-pages` gem (unpinned transitive deps) | `pip install --require-hashes` (fully locked) |
|
|
203
|
+
|
|
204
|
+
## Takeaways #
|
|
205
|
+
|
|
206
|
+
1. **`primary: custom` + `extra_css` beats theme forking.** No `custom_dir`, no Jinja templates, no plugin authoring. All the customisation lives in files MkDocs Material is explicitly designed to consume.
|
|
207
|
+
|
|
208
|
+
2. **CSS custom properties are the maintainable seam.** Overriding `--md-primary-fg-color` scales; overriding `.md-header a.md-header__button:not(...)` selectors doesn't.
|
|
209
|
+
|
|
210
|
+
3. **Treat the landing page as a product surface, not documentation.** Front-matter `hide: [navigation, toc]` unlocks the full canvas. Hero + card grid + tabbed quick-start reads as a product page.
|
|
211
|
+
|
|
212
|
+
4. **Lock the docs-build supply chain.** `pip-compile --generate-hashes` + `pip install --require-hashes` closes the Scorecard `PinnedDependenciesID` alert and prevents transitive-dep drift in Pages deploys.
|
|
213
|
+
|
|
214
|
+
5. **Measure contrast, not just aesthetics.** WCAG AAA on body text is achievable with the right palette; it's not a tradeoff against distinctiveness.
|
|
215
|
+
|
|
216
|
+
The reference implementation landed as [PR #960](https://github.com/sebastienrousseau/dotfiles/pull/960) and is live at [doc.dotfiles.io](https://doc.dotfiles.io); the theme source lives at [`docs/stylesheets/extra.css`](https://github.com/sebastienrousseau/dotfiles/blob/main/docs/stylesheets/extra.css).
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Fish Startup in 2026: Cutting Interactive Shell Latency by Half with abbr on Multi-Shell Dotfiles"
|
|
3
|
+
description: Diagnosing and remediating a 232 ms fish cold-start on the .dotfiles multi-shell bridge — one printf format change, one chezmoi hook, half the latency.
|
|
4
|
+
date: 2026-07-05
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Fish Startup in 2026: Cutting Interactive Shell Latency by Half with `abbr` on Multi-Shell Dotfiles
|
|
8
|
+
|
|
9
|
+
*Interactive shells have become the primary interface for AI-augmented development; the difference between a 120 ms and a 230 ms first prompt compounds into measurable engineering-hour loss across a global fleet.*
|
|
10
|
+
|
|
11
|
+
*Sebastien Rousseau · Published 5 Jul 2026 · 10 min read*
|
|
12
|
+
|
|
13
|
+
## Why Interactive Shell Latency Matters in 2026 #
|
|
14
|
+
|
|
15
|
+
The AI-augmented developer opens a terminal dozens of times a day. In fleets running Claude Code, Codex CLI, GitHub Copilot CLI, or agentic frameworks that spawn subshells for every tool call, shell startup latency stops being a personal-comfort metric and becomes a **platform-engineering signal**.
|
|
16
|
+
|
|
17
|
+
The [.dotfiles reference framework](https://github.com/sebastienrousseau/dotfiles) treats sub-second shell startup as an SLO alongside SLSA-signed releases and MCP boundary enforcement. When a shell exceeds its budget, the framework's `dot health` command reports it as a failing check, not a warning — because a slow prompt on a workstation running 18 concurrent AI agents is a supply-chain-throughput problem, not an aesthetic one.
|
|
18
|
+
|
|
19
|
+
This article walks through the diagnosis and fix that took Fish cold-start latency from **231 ms → 119 ms** — a 48% reduction — on a workstation carrying ~900 bridged bash aliases into Fish for cross-shell parity. The remediation is a one-line change to a code-generation printf statement, plus a chezmoi hook that moves the cost out of the interactive path.
|
|
20
|
+
|
|
21
|
+
## The Multi-Shell Bridge 2026 Architecture Lens #
|
|
22
|
+
|
|
23
|
+
Cross-shell parity — the same aliases, functions, environment, and completions across bash, Zsh, Fish, and Nushell — is a distinct architectural property of a mature dotfiles framework. Each layer of that bridge carries its own performance tax:
|
|
24
|
+
|
|
25
|
+
| Layer | Design Decision | Why It Matters | Risk if Mishandled |
|
|
26
|
+
|---|---|---|---|
|
|
27
|
+
| **Source of truth** | Bash-hosted alias library (~900 entries) sourced by `zsh` and `bash` natively | Single canonical location prevents drift; matches how most upstream tooling assumes aliases live | Duplication across shells silently diverges; users on Fish or Nushell get a subtly different alias set |
|
|
28
|
+
| **Fish bridge** | `bash --norc --noprofile` subshell dumps `alias -p`, output translated and cached to `~/.cache/fish/bash-aliases.fish` | Fish has no `bash`-sourcing primitive; the bridge is unavoidable | Bridge runs at every shell start unless cached; cache invalidation timing determines the felt cost |
|
|
29
|
+
| **Cache format** | `abbr --add NAME -- VALUE` (this article's change) instead of `alias NAME=VALUE` | Fish's `alias` builtin allocates a function per entry (~183 µs each × 900 entries = ~165 ms); `abbr` is a command-line-time expansion at ~40 µs | Choosing `alias` for the cache format silently caps Fish cold-start at ~230 ms even on a warm cache |
|
|
30
|
+
| **Cache invalidation** | Compare source mtime + first-line format marker | Alias sources change on every `chezmoi apply`, invalidating the cache and forcing regen on the next shell — the exact moment the user opens a terminal to try their changes | Cache regen on the interactive path punishes the shell that opens right after configuration changes |
|
|
31
|
+
| **Pre-warm hook** | `run_onchange_after_` chezmoi hook rebuilds the cache during apply | Moves the ~200 ms regen cost off the user's first prompt into the apply step | Absence of a pre-warm hook makes the first post-apply shell feel broken |
|
|
32
|
+
|
|
33
|
+
## Key Interactive Shell Performance Signals #
|
|
34
|
+
|
|
35
|
+
| Signal | Operational Benchmark | Reference | Technical Platform Implementation |
|
|
36
|
+
|---|---|---|---|
|
|
37
|
+
| **Fish cold-start** | ≤ 200 ms first-prompt latency | Interactive-response threshold (Nielsen 1993, still the industry norm) | `hyperfine --warmup 2 'fish -i -c exit'` in CI; regression fails a PR if the median crosses threshold |
|
|
38
|
+
| **Fish warm-start** | ≤ 130 ms after cache is populated | Delta between cold/warm reveals cache-invalidation cost | Same command with `--warmup 3`; the mean tracks the fully-cached shell path |
|
|
39
|
+
| **First-post-apply latency** | Warm-shell parity — no cliff after `chezmoi apply` | Signals that regeneration lives outside the shell hot path | `chezmoi apply && hyperfine 'fish -i -c exit'` — cold and warm should be within noise |
|
|
40
|
+
| **Cache-format compatibility** | Auto-heal path when upgrading between cache formats | Ensures long-lived workstations don't inherit stale caches on framework upgrade | Staleness check compares first line of cache to expected format marker |
|
|
41
|
+
| **Bridge throughput** | ~40 µs per abbreviated entry, ~183 µs per aliased entry | Fish internals — measured, not documented | Choice of `abbr` over `alias` in the cache-emission format string |
|
|
42
|
+
|
|
43
|
+
## Diagnosis: Where the Milliseconds Went #
|
|
44
|
+
|
|
45
|
+
`fish --profile-startup=/tmp/f.prof -i -c 'exit'` emits a per-command trace with self-time and cumulative time. Sorted by cumulative time descending, one line dominated the warm-start budget:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Time (µs) Sum (µs) Command
|
|
49
|
+
1687 132211 ----> source "$_alias_cache"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**132 ms of a 231 ms budget** — 57% — spent sourcing a single cache file. Everything else (starship prompt initialisation, mise activation, atuin history bindings, direnv hooks) added up cleanly to the remaining ~85 ms.
|
|
53
|
+
|
|
54
|
+
The cache file itself was well-formed and cache-invalidation was working correctly. The problem lived at the primitive level: what does `alias name='value'` cost when Fish parses and installs it? Ran in isolation:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
$ hyperfine --warmup 2 "fish -c 'source ~/.cache/fish/bash-aliases.fish'"
|
|
58
|
+
Time (mean ± σ): 170.8 ms ± 11.3 ms
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**170 ms just to source 878 alias lines.** Fish's `alias` isn't a shell-level string substitution — it's a function factory. The invocation `alias ll='eza -la --icons'` roughly desugars to:
|
|
62
|
+
|
|
63
|
+
```fish
|
|
64
|
+
function ll --wraps='eza -la --icons' --description 'alias ll=eza -la --icons'
|
|
65
|
+
eza -la --icons $argv
|
|
66
|
+
end
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Every call parses the definition, allocates a function object, installs it in the function table, records the description, and wires the `--wraps` for tab completion. Approximately 183 µs per entry. At 878 entries, the maths is uncompromising: 878 × 183 µs = 161 ms.
|
|
70
|
+
|
|
71
|
+
The cost is O(1) per call, but the call count is the problem, and there is no batching path in Fish's `alias` implementation.
|
|
72
|
+
|
|
73
|
+
## Remediation: `abbr --add` as a Cross-Shell-Bridge Primitive #
|
|
74
|
+
|
|
75
|
+
Fish exposes two ways to give a short name to a longer command:
|
|
76
|
+
|
|
77
|
+
- **`alias`** — function factory. Available in interactive shells, scripts, pipes, subshells, and inside other functions. Costs a function allocation on every source.
|
|
78
|
+
- **`abbr --add`** — abbreviation. Expanded at the interactive command line the moment the user types the abbreviation and hits space or enter. Not available in scripts (they need functions). No function allocation on installation.
|
|
79
|
+
|
|
80
|
+
For bash-alias bridges, the tradeoff is invisible: users don't call `ll` from inside a Fish script — they'd write a proper Fish function for that use case. Abbreviations for this workload are a strict upgrade: identical interactive UX, no function-table pressure, and — as a side benefit — they show the user what actually runs when they type the abbreviation, which improves shell literacy.
|
|
81
|
+
|
|
82
|
+
The code change is a single printf format string in the cache-generator:
|
|
83
|
+
|
|
84
|
+
```diff
|
|
85
|
+
- printf "alias %s=%s\n" "$name" "$val"
|
|
86
|
+
+ printf "abbr --add %s -- %s\n" "$name" "$val"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Measured in isolation:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
Benchmark 1: fish -c 'source alias-cache.fish'
|
|
93
|
+
Time (mean ± σ): 170.8 ms ± 11.3 ms
|
|
94
|
+
|
|
95
|
+
Benchmark 2: fish -c 'source abbr-cache.fish'
|
|
96
|
+
Time (mean ± σ): 34.0 ms ± 0.9 ms
|
|
97
|
+
|
|
98
|
+
Summary
|
|
99
|
+
abbr-cache.fish ran 5.02 ± 0.36 times faster than alias-cache.fish
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**5× faster. 137 ms saved on every warm shell start.** End-to-end Fish latency dropped from 231 ms → 119 ms.
|
|
103
|
+
|
|
104
|
+
## The Second-Order Bug: Cache Invalidation Timing #
|
|
105
|
+
|
|
106
|
+
Solving the warm case revealed a distinct failure mode: the *first* Fish shell opened after `chezmoi apply` still measured ~306 ms. The apply step writes new versions of the underlying bash alias source files (updated mtimes). The staleness check inside the Fish bridge sees `source.mtime > cache.mtime`, throws the cache away, and rebuilds it — spawning a subshell, sourcing 40 KB of bash, iterating 878 lines. **~200 ms.**
|
|
107
|
+
|
|
108
|
+
The shell that pays this cost is whichever one the user opens first, which is almost always the shell they opened *because* they wanted to see the effect of the apply.
|
|
109
|
+
|
|
110
|
+
The remediation is architectural, not algorithmic. The regeneration is moved off the interactive path and onto the apply itself via a chezmoi `run_onchange_after_` script:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
#!/usr/bin/env bash
|
|
114
|
+
# Source-hash retrigger keys — script re-runs when any of these change:
|
|
115
|
+
# 90-ux-aliases.sh.tmpl: {{ include "…/90-ux-aliases.sh.tmpl" | sha256sum }}
|
|
116
|
+
# 91-ux-aliases-lazy.sh.tmpl: {{ include "…/91-ux-aliases-lazy.sh.tmpl" | sha256sum }}
|
|
117
|
+
# aliases.fish.tmpl: {{ include "…/aliases.fish.tmpl" | sha256sum }}
|
|
118
|
+
|
|
119
|
+
command -v fish >/dev/null 2>&1 || exit 0
|
|
120
|
+
|
|
121
|
+
rm -f "${HOME}/.cache/fish/bash-aliases.fish"
|
|
122
|
+
fish -i -c 'exit' >/dev/null 2>&1 || true
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The hook invalidates the cache, spawns a throwaway interactive Fish so the bridge's existing regen path fires, then exits. The user's next actual shell finds a valid, up-to-date cache. The 200 ms cost lands where the user expects "compilation work" to happen — during the apply — not on the terminal they open ten seconds later.
|
|
126
|
+
|
|
127
|
+
Cold-start Fish after apply: **306 ms → 120 ms.**
|
|
128
|
+
|
|
129
|
+
## Return on Resilience #
|
|
130
|
+
|
|
131
|
+
At a workstation opening 40 shells per day, saving 112 ms per shell reclaims 4.5 seconds daily; 22 minutes annually. At a small engineering org of 50 developers with the same profile, that's 18 engineering-hours reclaimed per year — measurable but modest.
|
|
132
|
+
|
|
133
|
+
The stronger case is qualitative. Interactive-latency perception is nonlinear: at ~200 ms the user consciously notices lag; at ~120 ms the shell feels immediate. Once the felt lag is gone, the developer stops flinching before opening a terminal — which changes the frequency and length of exploratory shell work, which changes the shape of what they do at the CLI.
|
|
134
|
+
|
|
135
|
+
| Metric | Before | After | Delta |
|
|
136
|
+
|---|---|---|---|
|
|
137
|
+
| Fish warm-start (median) | 231 ms | 119 ms | −112 ms (−48%) |
|
|
138
|
+
| Fish cold-start after apply | 306 ms | 120 ms | −186 ms (−61%) |
|
|
139
|
+
| Cache source cost | 170 ms | 34 ms | −136 ms (−80%) |
|
|
140
|
+
| CI regression threshold | ✗ 231 > 200 | ✓ 119 ≤ 200 | Now under budget |
|
|
141
|
+
| Full test suite | 4703 tests, 0 fail | 4703 tests, 0 fail | Zero regressions |
|
|
142
|
+
|
|
143
|
+
## Takeaways #
|
|
144
|
+
|
|
145
|
+
1. **Profile every interactive shell in CI.** Fish, Zsh, Nushell, Bash — each has its own primitives with different costs. Treat first-prompt latency as a signal with a threshold, not a comfort metric.
|
|
146
|
+
|
|
147
|
+
2. **Prefer `abbr` for interactive-only bridged aliases in Fish.** The distinction between `abbr` (line-time expansion) and `alias` (function factory) is documented; the 5× cost distinction is not. If your users don't call the alias from inside a Fish script — and for bridged bash aliases they don't — `abbr` is a strict upgrade.
|
|
148
|
+
|
|
149
|
+
3. **Move cache regeneration off the interactive path.** Any cache invalidated by a configuration-management action (chezmoi, ansible, dotbot) should be regenerated by that same action, not by whichever shell opens next.
|
|
150
|
+
|
|
151
|
+
4. **Version the cache format itself, not just the source.** The staleness check should include a format marker so upgrading users don't inherit stale caches by mtime luck.
|
|
152
|
+
|
|
153
|
+
The reference implementation lives on `main` at [sebastienrousseau/dotfiles](https://github.com/sebastienrousseau/dotfiles); the change landed as [PR #963](https://github.com/sebastienrousseau/dotfiles/pull/963) and [PR #964](https://github.com/sebastienrousseau/dotfiles/pull/964), shipped in [v0.2.510](https://github.com/sebastienrousseau/dotfiles/releases/tag/v0.2.510).
|