@sebastienrousseau/dotfiles 0.2.481 → 0.2.499
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/docs/ARCHITECTURE.md +29 -196
- package/docs/COMPLIANCE.md +10 -10
- package/docs/COPYRIGHT +3 -4
- package/docs/OPERATIONS.md +38 -65
- package/docs/PLAN.md +3 -3
- package/docs/PR_DESCRIPTION.md +85 -84
- package/docs/ROADMAP.md +11 -11
- package/docs/ROADMAP_legacy.md +556 -0
- package/docs/SECURITY_CHECKLIST.md +1 -1
- package/docs/TASK.md +4 -4
- package/docs/WALKTHROUGH.md +33 -152
- package/package.json +17 -5
- package/scripts/backup.sh +142 -0
- package/scripts/banner.sh +20 -0
- package/scripts/benchmark.sh +20 -0
- package/scripts/build.sh +41 -0
- package/scripts/clean.sh +31 -0
- package/scripts/compile.sh +54 -0
- package/scripts/copy.sh +108 -0
- package/scripts/{tools/detect-collisions.py → detect-collisions.py} +1 -1
- package/scripts/doctor.sh +79 -0
- package/scripts/dotfiles.sh +63 -0
- package/scripts/download.sh +35 -0
- package/scripts/help.sh +57 -0
- package/scripts/lock-configs.sh +57 -0
- package/scripts/package.sh +46 -0
- package/scripts/ssh.sh +55 -0
- package/scripts/teleport.sh +23 -0
- package/scripts/{tests/test-aliases.sh → test-aliases.sh} +3 -3
- package/scripts/test_smoke.sh +88 -0
- package/scripts/unpack.sh +28 -0
- package/scripts/{diagnostics/verify_state.sh → verify_state.sh} +21 -21
- package/templates/projects/go/README.md +0 -4
- package/templates/projects/node/README.md +0 -4
- package/templates/projects/python/README.md +0 -4
- package/templates/projects/python/pyproject.toml +0 -15
- package/CHANGELOG.md +0 -285
- package/LICENSE +0 -1283
- package/README.md +0 -315
- package/docs/ALIASES.md +0 -128
- package/docs/FEATURES.md +0 -166
- package/docs/FONTS.md +0 -147
- package/docs/INSTALL.md +0 -119
- package/docs/KEYS.md +0 -40
- package/docs/KEY_ROTATION.md +0 -219
- package/docs/LEGACY_ROADMAP.md +0 -142
- package/docs/NEOVIM_IDE_GUIDE.md +0 -52
- package/docs/README.md +0 -269
- package/docs/REPO_AUDIT.md +0 -23
- package/docs/SCREENSHOTS.md +0 -116
- package/docs/SECRETS.md +0 -76
- package/docs/SECURITY.md +0 -30
- package/docs/TESTING.md +0 -190
- package/docs/TOOLS.md +0 -146
- package/docs/TROUBLESHOOTING.md +0 -112
- package/docs/UTILS.md +0 -105
- package/docs/WSL2_NIX_TROUBLESHOOTING.md +0 -723
- package/docs/adr/ADR-001-ci-cd-pipeline.md +0 -101
- package/docs/adr/ADR-002-shell-performance.md +0 -121
- package/docs/adr/ADR-003-security-first.md +0 -140
- package/docs/adr/ADR-004-cli-architecture.md +0 -157
- package/docs/adr/ADR-005-chezmoi-choice.md +0 -89
- package/docs/adr/ADR-006-shell-selection.md +0 -115
- package/docs/adr/README.md +0 -33
- package/docs/themes/README.md +0 -20
- package/dot_config/aider/aider.conf.yml +0 -32
- package/dot_config/alacritty/alacritty.toml.tmpl +0 -483
- package/dot_config/ansible/ansible.cfg.tmpl +0 -11
- package/dot_config/atuin/config.toml +0 -23
- package/dot_config/bat/config +0 -8
- package/dot_config/brave-flags.conf.tmpl +0 -7
- package/dot_config/btop/btop.conf +0 -16
- package/dot_config/btop/themes/tokyonight.theme +0 -34
- package/dot_config/bun/bunfig.toml.tmpl +0 -33
- package/dot_config/claude/mcp_servers.json +0 -49
- package/dot_config/clippy.toml +0 -55
- package/dot_config/containers/containers.conf +0 -14
- package/dot_config/curl/dot_curlrc +0 -18
- package/dot_config/dlv/config.yml +0 -39
- package/dot_config/docker/config.json.tmpl +0 -15
- package/dot_config/dotfiles/boot/README.md +0 -11
- package/dot_config/dotfiles/grub/README.md +0 -11
- package/dot_config/dotfiles/lock/README.md +0 -11
- package/dot_config/dotfiles/versions.env.tmpl +0 -19
- package/dot_config/duf/duf.conf +0 -6
- package/dot_config/duti/defaults.duti +0 -5
- package/dot_config/emoji/emoji.txt +0 -34
- package/dot_config/fastfetch/config.jsonc +0 -28
- package/dot_config/firefox/user.js +0 -8
- package/dot_config/flatpak/flatpak.list +0 -4
- package/dot_config/fontconfig/fonts.conf.tmpl +0 -44
- package/dot_config/gem/gemrc +0 -9
- package/dot_config/gh/config.yml +0 -12
- package/dot_config/ghostty/config.tmpl +0 -661
- package/dot_config/git/attributes +0 -12
- package/dot_config/git/config.tmpl +0 -77
- package/dot_config/git/ignore +0 -27
- package/dot_config/gnupg/gpg-agent.conf.tmpl +0 -11
- package/dot_config/go/aliases.sh +0 -61
- package/dot_config/go/env.sh +0 -24
- package/dot_config/go/golangci.yml +0 -118
- package/dot_config/go/gopls.json +0 -30
- package/dot_config/goose/config.yaml +0 -29
- package/dot_config/gtk-3.0/gtk.css.tmpl +0 -305
- package/dot_config/gtk-3.0/settings.ini.tmpl +0 -66
- package/dot_config/gtk-4.0/gtk.css.tmpl +0 -309
- package/dot_config/gtk-4.0/settings.ini.tmpl +0 -21
- package/dot_config/htop/htoprc +0 -20
- package/dot_config/ice/README.md +0 -13
- package/dot_config/inputrc +0 -2
- package/dot_config/ipython/profile_default/ipython_config.py.tmpl +0 -5
- package/dot_config/just/justfile +0 -104
- package/dot_config/k9s/config.yaml.tmpl +0 -65
- package/dot_config/k9s/skins/catppuccin-mocha.yaml +0 -116
- package/dot_config/karabiner/karabiner.json +0 -14
- package/dot_config/kitty/kitty.conf.tmpl +0 -517
- package/dot_config/lazydocker/config.yml +0 -186
- package/dot_config/lazygit/config.yml +0 -23
- package/dot_config/lsd/config.yaml +0 -19
- package/dot_config/mas/masapps.txt +0 -5
- package/dot_config/minikube/config.json +0 -13
- package/dot_config/mise/config.toml +0 -41
- package/dot_config/mongosh/mongoshrc.js +0 -67
- package/dot_config/mycli/myclirc +0 -67
- package/dot_config/nano/nanorc +0 -28
- package/dot_config/ncdu/config +0 -12
- package/dot_config/nvim/init.lua +0 -4
- package/dot_config/nvim/lazy-lock.json +0 -27
- package/dot_config/nvim/lua/config/autocmds.lua +0 -63
- package/dot_config/nvim/lua/config/keymaps.lua +0 -87
- package/dot_config/nvim/lua/config/lazy.lua +0 -34
- package/dot_config/nvim/lua/config/options.lua +0 -48
- package/dot_config/nvim/lua/plugins/coding.lua +0 -234
- package/dot_config/nvim/lua/plugins/dap.lua +0 -201
- package/dot_config/nvim/lua/plugins/editor.lua +0 -59
- package/dot_config/nvim/lua/plugins/git.lua +0 -9
- package/dot_config/nvim/lua/plugins/lsp.lua +0 -221
- package/dot_config/nvim/lua/plugins/markdown.lua +0 -17
- package/dot_config/nvim/lua/plugins/rust.lua +0 -33
- package/dot_config/nvim/lua/plugins/sessions.lua +0 -32
- package/dot_config/nvim/lua/plugins/ui.lua +0 -537
- package/dot_config/nvim/snippets/all.lua +0 -9
- package/dot_config/nvim/snippets/python.lua +0 -16
- package/dot_config/pip/pip.conf.tmpl +0 -32
- package/dot_config/pypoetry/config.toml.tmpl +0 -6
- package/dot_config/pyrightconfig.json.tmpl +0 -5
- package/dot_config/raycast/README.md +0 -13
- package/dot_config/redis/redisclirc +0 -41
- package/dot_config/shell/00-container-detect.sh +0 -53
- package/dot_config/shell/00-core-paths.sh.tmpl +0 -95
- package/dot_config/shell/05-core-safety.sh.tmpl +0 -13
- package/dot_config/shell/40-ls-colors.sh.tmpl +0 -31
- package/dot_config/shell/50-logic-functions.sh.tmpl +0 -10
- package/dot_config/shell/90-theme-switch.sh +0 -70
- package/dot_config/shell/90-ux-aliases.sh.tmpl +0 -35
- package/dot_config/shell/91-ux-aliases-lazy.sh.tmpl +0 -23
- package/dot_config/shell/Brewfile +0 -207
- package/dot_config/shell/Brewfile.cask +0 -92
- package/dot_config/shell/Brewfile.cli +0 -119
- package/dot_config/shell/README.md +0 -267
- package/dot_config/shell/custom/context_suggest.zsh +0 -68
- package/dot_config/shell/custom/error_analysis.zsh +0 -45
- package/dot_config/sops/dot_sops.yaml +0 -23
- package/dot_config/starship.toml.tmpl +0 -124
- package/dot_config/task/Taskfile.yml +0 -86
- package/dot_config/tflint/tflint.hcl.tmpl +0 -9
- package/dot_config/tmux/tmux.conf.tmpl +0 -181
- package/dot_config/topgrade/topgrade.toml.tmpl +0 -42
- package/dot_config/vscode/extensions.txt +0 -11
- package/dot_config/vscode/settings.json.tmpl +0 -123
- package/dot_config/waybar/style.css +0 -8
- package/dot_config/wezterm/wezterm.lua.tmpl +0 -236
- package/dot_config/wget/wgetrc +0 -12
- package/dot_config/yarn/yarnrc.yml.tmpl +0 -36
- package/dot_config/yazi/yazi.toml +0 -40
- package/dot_config/zellij/config.kdl +0 -79
- package/dot_config/zsh/dot_zprofile +0 -13
- package/dot_config/zsh/dot_zshenv +0 -6
- package/dot_config/zsh/dot_zshrc.tmpl +0 -199
- package/dot_config/zsh/rc.d/05-ssh-agent.zsh +0 -5
- package/dot_config/zsh/rc.d/10-env.zsh.tmpl +0 -28
- package/dot_config/zsh/rc.d/20-zinit.zsh.tmpl +0 -22
- package/dot_config/zsh/rc.d/30-options.zsh.tmpl +0 -123
- package/dot_config/zsh/rc.d/40-bell.zsh.tmpl +0 -20
- package/dot_config/zsh/rc.d/50-login-fortune.zsh.tmpl +0 -9
- package/dot_local/bin/executable_ai_core +0 -130
- package/dot_local/bin/executable_b64 +0 -59
- package/dot_local/bin/executable_dot +0 -178
- package/dot_local/bin/executable_dot_completion +0 -55
- package/dot_local/bin/executable_epoch +0 -62
- package/dot_local/bin/executable_extract +0 -108
- package/dot_local/bin/executable_git-ai-commit +0 -160
- package/dot_local/bin/executable_git-ai-diff +0 -154
- package/dot_local/bin/executable_hash +0 -123
- package/dot_local/bin/executable_hex +0 -79
- package/dot_local/bin/executable_ip +0 -37
- package/dot_local/bin/executable_jsonv +0 -54
- package/dot_local/bin/executable_jwt +0 -78
- package/dot_local/bin/executable_kill-port +0 -59
- package/dot_local/bin/executable_lorem +0 -103
- package/dot_local/bin/executable_regex +0 -96
- package/dot_local/bin/executable_tmux-sessionizer +0 -187
- package/dot_local/bin/executable_tour +0 -137
- package/dot_local/bin/executable_update +0 -108
- package/dot_local/bin/executable_uuid +0 -57
- package/dot_local/bin/executable_yamlv +0 -39
- package/dot_local/bin/executable_zig-install +0 -89
- package/dot_local/bin/voice_ops +0 -7
- package/dot_local/share/bash-completion/completions/dot +0 -54
- package/dot_local/share/zsh/completions/.keep +0 -0
- package/install.sh +0 -255
- package/scripts/ci/validate-ci-config.sh +0 -222
- package/scripts/demo/record.sh +0 -41
- package/scripts/diagnostics/benchmark.sh +0 -201
- package/scripts/diagnostics/doctor.sh +0 -115
- package/scripts/diagnostics/drift-dashboard.sh +0 -26
- package/scripts/diagnostics/health.sh +0 -356
- package/scripts/diagnostics/history-analysis.sh +0 -77
- package/scripts/diagnostics/security-score.sh +0 -392
- package/scripts/dot/commands/appearance.sh +0 -63
- package/scripts/dot/commands/core.sh +0 -130
- package/scripts/dot/commands/diagnostics.sh +0 -100
- package/scripts/dot/commands/meta.sh +0 -117
- package/scripts/dot/commands/restore.sh +0 -209
- package/scripts/dot/commands/secrets.sh +0 -81
- package/scripts/dot/commands/security.sh +0 -73
- package/scripts/dot/commands/tools.sh +0 -228
- package/scripts/dot/lib/utils.sh +0 -72
- package/scripts/fonts/install-nerd-fonts.sh +0 -59
- package/scripts/fonts/patch-fonts.sh +0 -34
- package/scripts/ops/chezmoi-apply.sh +0 -42
- package/scripts/ops/chezmoi-diff.sh +0 -14
- package/scripts/ops/chezmoi-remove.sh +0 -43
- package/scripts/ops/chezmoi-update.sh +0 -16
- package/scripts/ops/heal.sh +0 -466
- package/scripts/ops/health-check.sh +0 -380
- package/scripts/ops/rollback.sh +0 -531
- package/scripts/ops/teleport.sh +0 -32
- package/scripts/secrets/age-init.sh +0 -69
- package/scripts/secrets/create-secrets-file.sh +0 -44
- package/scripts/secrets/encrypt-ssh-key.sh +0 -42
- package/scripts/security/backup.sh +0 -17
- package/scripts/security/dns-doh.sh +0 -29
- package/scripts/security/encryption-check.sh +0 -39
- package/scripts/security/enforce-policies.sh +0 -339
- package/scripts/security/firewall.sh +0 -34
- package/scripts/security/lock-configs.sh +0 -57
- package/scripts/security/lock-screen.sh +0 -33
- package/scripts/security/manage-secrets.sh +0 -415
- package/scripts/security/telemetry-kill.sh +0 -28
- package/scripts/security/usb-safety.sh +0 -29
- package/scripts/tests/README.md +0 -241
- package/scripts/tests/benchmark.sh +0 -91
- package/scripts/tests/framework/assertions.sh +0 -283
- package/scripts/tests/framework/mocks.sh +0 -201
- package/scripts/tests/framework/test_runner.sh +0 -189
- package/scripts/tests/integration/test_install.sh +0 -237
- package/scripts/tests/performance/benchmark_runner.sh +0 -156
- package/scripts/tests/performance/regression_check.sh +0 -73
- package/scripts/tests/performance/stress_test.sh +0 -65
- package/scripts/tests/test-docker.sh +0 -48
- package/scripts/tests/unit/test_ai_aliases.sh +0 -158
- package/scripts/tests/unit/test_ai_cli_checks.sh +0 -47
- package/scripts/tests/unit/test_backup.sh +0 -227
- package/scripts/tests/unit/test_case_functions.sh +0 -238
- package/scripts/tests/unit/test_cd_aliases.sh +0 -367
- package/scripts/tests/unit/test_dot_cli.sh +0 -217
- package/scripts/tests/unit/test_encode64.sh +0 -67
- package/scripts/tests/unit/test_environment.sh +0 -78
- package/scripts/tests/unit/test_extract.sh +0 -163
- package/scripts/tests/unit/test_framework_edge_cases.sh +0 -113
- package/scripts/tests/unit/test_genpass.sh +0 -298
- package/scripts/tests/unit/test_install_edge_cases.sh +0 -167
- package/scripts/tests/unit/test_installers.sh +0 -172
- package/scripts/tests/unit/test_keygen.sh +0 -68
- package/scripts/tests/unit/test_logging.sh +0 -96
- package/scripts/tests/unit/test_os_detection_comprehensive.sh +0 -388
- package/scripts/tests/unit/test_package_managers_comprehensive.sh +0 -321
- package/scripts/tests/unit/test_prependpath.sh +0 -66
- package/scripts/tests/unit/test_prependpath_refactored.sh +0 -89
- package/scripts/tests/unit/test_rd.sh +0 -230
- package/scripts/tests/unit/test_security_fixes.sh +0 -130
- package/scripts/tests/unit/test_security_scripts.sh +0 -87
- package/scripts/tests/unit/test_template_validation.sh +0 -238
- package/scripts/tests/unit/test_utility_functions.sh +0 -144
- package/scripts/tests/unit/test_wave1_alias_split.sh +0 -132
- package/scripts/tests/unit/test_wave1_ci_pinning.sh +0 -61
- package/scripts/tests/unit/test_wave1_gitleaks_config.sh +0 -52
- package/scripts/tests/unit/test_wave1_heal_fixes.sh +0 -97
- package/scripts/tests/unit/test_wave1_install_gpg.sh +0 -35
- package/scripts/tests/unit/test_wave1_zshenv_path.sh +0 -89
- package/scripts/tests/unit/test_wave1_zshrc_lazy_hook.sh +0 -115
- package/scripts/tests/unit/test_wave2_dot_new_guard.sh +0 -75
- package/scripts/tests/unit/test_zipf.sh +0 -76
- package/scripts/theme/apply-gnome-theme.sh +0 -297
- package/scripts/theme/install-boot-logo.sh +0 -61
- package/scripts/theme/install-catppuccin-themes.sh +0 -346
- package/scripts/theme/install-cursors.sh +0 -24
- package/scripts/theme/install-file-icons.sh +0 -25
- package/scripts/theme/install-grub-theme.sh +0 -51
- package/scripts/theme/install-lock-icon.sh +0 -29
- package/scripts/theme/switch.sh +0 -250
- package/scripts/theme/wallpaper-rotate.sh +0 -82
- package/scripts/theme/wallpaper-sync.sh +0 -42
- package/scripts/tools/cmatrix.sh +0 -20
- package/scripts/tools/emoji-picker.sh +0 -45
- package/scripts/tools/figlet-banner.sh +0 -17
- package/scripts/tools/log-rotate.sh +0 -29
- package/scripts/tools/lolcat-wrap.sh +0 -18
- package/scripts/tools/pipes.sh +0 -47
- package/scripts/tuning/linux.sh +0 -175
- package/scripts/tuning/macos.sh +0 -46
- package/templates/projects/molecule/README.md +0 -7
- package/templates/projects/molecule/converge.yml +0 -7
- package/templates/projects/molecule/molecule.yml +0 -16
- package/templates/projects/packer/README.md +0 -15
- package/templates/projects/packer/main.pkr.hcl +0 -15
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Enhanced Shell Benchmark with Per-Component Profiling
|
|
3
|
-
# Usage: dot benchmark [--detailed|--profile|--compare]
|
|
4
|
-
|
|
5
|
-
set -euo pipefail
|
|
6
|
-
|
|
7
|
-
# Colors
|
|
8
|
-
RED='\033[0;31m'
|
|
9
|
-
GREEN='\033[0;32m'
|
|
10
|
-
YELLOW='\033[1;33m'
|
|
11
|
-
BLUE='\033[0;34m'
|
|
12
|
-
CYAN='\033[0;36m'
|
|
13
|
-
NC='\033[0m'
|
|
14
|
-
|
|
15
|
-
BENCHMARK_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/dotfiles/benchmarks"
|
|
16
|
-
mkdir -p "$BENCHMARK_DIR"
|
|
17
|
-
|
|
18
|
-
# Parse arguments
|
|
19
|
-
DETAILED=false
|
|
20
|
-
PROFILE=false
|
|
21
|
-
COMPARE=false
|
|
22
|
-
while [[ $# -gt 0 ]]; do
|
|
23
|
-
case "$1" in
|
|
24
|
-
--detailed | -d)
|
|
25
|
-
DETAILED=true
|
|
26
|
-
shift
|
|
27
|
-
;;
|
|
28
|
-
--profile | -p)
|
|
29
|
-
PROFILE=true
|
|
30
|
-
shift
|
|
31
|
-
;;
|
|
32
|
-
--compare | -c)
|
|
33
|
-
COMPARE=true
|
|
34
|
-
shift
|
|
35
|
-
;;
|
|
36
|
-
*) shift ;;
|
|
37
|
-
esac
|
|
38
|
-
done
|
|
39
|
-
|
|
40
|
-
print_header() {
|
|
41
|
-
echo -e "\n${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
42
|
-
echo -e "${CYAN} Shell Performance Benchmark${NC}"
|
|
43
|
-
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}\n"
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
# Basic timing function
|
|
47
|
-
time_command() {
|
|
48
|
-
local start end
|
|
49
|
-
start=$(python3 -c 'import time; print(int(time.time() * 1000))')
|
|
50
|
-
eval "$1" >/dev/null 2>&1
|
|
51
|
-
end=$(python3 -c 'import time; print(int(time.time() * 1000))')
|
|
52
|
-
echo $((end - start))
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
# Per-component profiling using zprof
|
|
56
|
-
run_zsh_profile() {
|
|
57
|
-
echo -e "${BLUE}Running Zsh profiler (zprof)...${NC}\n"
|
|
58
|
-
|
|
59
|
-
zsh -c '
|
|
60
|
-
zmodload zsh/zprof
|
|
61
|
-
source ~/.zshenv 2>/dev/null
|
|
62
|
-
source ~/.config/zsh/.zshrc 2>/dev/null
|
|
63
|
-
zprof
|
|
64
|
-
' 2>/dev/null | head -30
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
# Benchmark individual components
|
|
68
|
-
benchmark_components() {
|
|
69
|
-
echo -e "${BLUE}Per-Component Timing:${NC}\n"
|
|
70
|
-
printf "%-35s %8s\n" "Component" "Time (ms)"
|
|
71
|
-
echo "───────────────────────────────────────────────"
|
|
72
|
-
|
|
73
|
-
# zshenv (bootloader)
|
|
74
|
-
local zshenv_time
|
|
75
|
-
zshenv_time=$(time_command "zsh -c 'source ~/.zshenv 2>/dev/null; exit'")
|
|
76
|
-
printf "%-35s %8s\n" "zshenv (bootloader)" "${zshenv_time}ms"
|
|
77
|
-
|
|
78
|
-
# Core shell options
|
|
79
|
-
local options_time
|
|
80
|
-
options_time=$(time_command "zsh -c 'source ~/.config/zsh/rc.d/30-options.zsh 2>/dev/null; exit'" 2>/dev/null || echo "N/A")
|
|
81
|
-
printf "%-35s %8s\n" "rc.d/30-options.zsh" "${options_time}ms"
|
|
82
|
-
|
|
83
|
-
# Zinit plugins
|
|
84
|
-
local zinit_time
|
|
85
|
-
zinit_time=$(time_command "zsh -c 'source ~/.config/zsh/rc.d/20-zinit.zsh 2>/dev/null; exit'" 2>/dev/null || echo "N/A")
|
|
86
|
-
printf "%-35s %8s\n" "rc.d/20-zinit.zsh (plugins)" "${zinit_time}ms"
|
|
87
|
-
|
|
88
|
-
# Tool initializations
|
|
89
|
-
for tool in starship atuin zoxide fzf direnv; do
|
|
90
|
-
if command -v "$tool" >/dev/null 2>&1; then
|
|
91
|
-
local tool_time
|
|
92
|
-
case "$tool" in
|
|
93
|
-
starship) tool_time=$(time_command "starship init zsh >/dev/null") ;;
|
|
94
|
-
atuin) tool_time=$(time_command "atuin init zsh >/dev/null") ;;
|
|
95
|
-
zoxide) tool_time=$(time_command "zoxide init zsh >/dev/null") ;;
|
|
96
|
-
fzf) tool_time=$(time_command "true") ;; # FZF sourced from file
|
|
97
|
-
direnv) tool_time=$(time_command "direnv hook zsh >/dev/null") ;;
|
|
98
|
-
esac
|
|
99
|
-
printf "%-35s %8s\n" "$tool init" "${tool_time}ms"
|
|
100
|
-
fi
|
|
101
|
-
done
|
|
102
|
-
|
|
103
|
-
echo "───────────────────────────────────────────────"
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
# Run hyperfine benchmark
|
|
107
|
-
run_hyperfine() {
|
|
108
|
-
if ! command -v hyperfine >/dev/null 2>&1; then
|
|
109
|
-
echo -e "${YELLOW}hyperfine not installed. Using basic timing.${NC}"
|
|
110
|
-
local times=()
|
|
111
|
-
for _ in {1..5}; do
|
|
112
|
-
times+=("$(time_command "zsh -i -c exit")")
|
|
113
|
-
done
|
|
114
|
-
local sum=0
|
|
115
|
-
for t in "${times[@]}"; do sum=$((sum + t)); done
|
|
116
|
-
echo -e "\n${GREEN}Average startup time: $((sum / 5))ms${NC}"
|
|
117
|
-
return
|
|
118
|
-
fi
|
|
119
|
-
|
|
120
|
-
echo -e "\n${BLUE}Running hyperfine benchmark (10 runs, 3 warmup)...${NC}\n"
|
|
121
|
-
hyperfine --warmup 3 --runs 10 --shell=none \
|
|
122
|
-
--export-json "$BENCHMARK_DIR/latest.json" \
|
|
123
|
-
'zsh -i -c exit'
|
|
124
|
-
|
|
125
|
-
# Extract and display results
|
|
126
|
-
if [[ -f "$BENCHMARK_DIR/latest.json" ]]; then
|
|
127
|
-
local mean_ms
|
|
128
|
-
mean_ms=$(jq '.results[0].mean * 1000 | floor' "$BENCHMARK_DIR/latest.json")
|
|
129
|
-
local min_ms
|
|
130
|
-
min_ms=$(jq '.results[0].min * 1000 | floor' "$BENCHMARK_DIR/latest.json")
|
|
131
|
-
local max_ms
|
|
132
|
-
max_ms=$(jq '.results[0].max * 1000 | floor' "$BENCHMARK_DIR/latest.json")
|
|
133
|
-
|
|
134
|
-
echo -e "\n${GREEN}Results:${NC}"
|
|
135
|
-
echo " Mean: ${mean_ms}ms"
|
|
136
|
-
echo " Min: ${min_ms}ms"
|
|
137
|
-
echo " Max: ${max_ms}ms"
|
|
138
|
-
|
|
139
|
-
# Performance rating
|
|
140
|
-
if [[ $mean_ms -lt 100 ]]; then
|
|
141
|
-
echo -e "\n${GREEN}⚡ Excellent (<100ms)${NC}"
|
|
142
|
-
elif [[ $mean_ms -lt 200 ]]; then
|
|
143
|
-
echo -e "\n${GREEN}✓ Good (<200ms)${NC}"
|
|
144
|
-
elif [[ $mean_ms -lt 500 ]]; then
|
|
145
|
-
echo -e "\n${YELLOW}⚠ Acceptable (<500ms)${NC}"
|
|
146
|
-
else
|
|
147
|
-
echo -e "\n${RED}✗ Slow (>500ms) - optimization needed${NC}"
|
|
148
|
-
fi
|
|
149
|
-
|
|
150
|
-
# Save with timestamp for history
|
|
151
|
-
cp "$BENCHMARK_DIR/latest.json" "$BENCHMARK_DIR/$(date +%Y%m%d_%H%M%S).json"
|
|
152
|
-
fi
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
# Compare with previous benchmarks
|
|
156
|
-
compare_benchmarks() {
|
|
157
|
-
echo -e "${BLUE}Benchmark History:${NC}\n"
|
|
158
|
-
|
|
159
|
-
local files
|
|
160
|
-
files=$(find "$BENCHMARK_DIR" -name "*.json" -type f | sort -r | head -10)
|
|
161
|
-
|
|
162
|
-
if [[ -z "$files" ]]; then
|
|
163
|
-
echo "No benchmark history found."
|
|
164
|
-
return
|
|
165
|
-
fi
|
|
166
|
-
|
|
167
|
-
printf "%-20s %10s %10s %10s\n" "Date" "Mean" "Min" "Max"
|
|
168
|
-
echo "────────────────────────────────────────────────"
|
|
169
|
-
|
|
170
|
-
for f in $files; do
|
|
171
|
-
local basename
|
|
172
|
-
basename=$(basename "$f" .json)
|
|
173
|
-
if [[ "$basename" == "latest" ]]; then continue; fi
|
|
174
|
-
|
|
175
|
-
local mean min max
|
|
176
|
-
mean=$(jq '.results[0].mean * 1000 | floor' "$f" 2>/dev/null || echo "N/A")
|
|
177
|
-
min=$(jq '.results[0].min * 1000 | floor' "$f" 2>/dev/null || echo "N/A")
|
|
178
|
-
max=$(jq '.results[0].max * 1000 | floor' "$f" 2>/dev/null || echo "N/A")
|
|
179
|
-
|
|
180
|
-
printf "%-20s %10sms %10sms %10sms\n" "$basename" "$mean" "$min" "$max"
|
|
181
|
-
done
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
# Main execution
|
|
185
|
-
print_header
|
|
186
|
-
|
|
187
|
-
if $PROFILE; then
|
|
188
|
-
run_zsh_profile
|
|
189
|
-
elif $COMPARE; then
|
|
190
|
-
compare_benchmarks
|
|
191
|
-
elif $DETAILED; then
|
|
192
|
-
benchmark_components
|
|
193
|
-
echo ""
|
|
194
|
-
run_hyperfine
|
|
195
|
-
else
|
|
196
|
-
run_hyperfine
|
|
197
|
-
fi
|
|
198
|
-
|
|
199
|
-
echo -e "\n${CYAN}Tip: Run 'dot benchmark --detailed' for per-component timing${NC}"
|
|
200
|
-
echo -e "${CYAN} Run 'dot benchmark --profile' for zprof analysis${NC}"
|
|
201
|
-
echo -e "${CYAN} Run 'dot benchmark --compare' for history${NC}\n"
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# MIT License
|
|
3
|
-
# Copyright (c) 2026 Sebastien Rousseau
|
|
4
|
-
# See LICENSE file for details.
|
|
5
|
-
|
|
6
|
-
# Script: doctor.sh
|
|
7
|
-
# Description: Diagnostics tool for the dotfiles environment.
|
|
8
|
-
# Checks dependencies, paths, and configuration integrity.
|
|
9
|
-
|
|
10
|
-
set -euo pipefail
|
|
11
|
-
|
|
12
|
-
# Colors (respect NO_COLOR: https://no-color.org)
|
|
13
|
-
if [[ -z "${NO_COLOR:-}" ]] && [[ -t 1 ]]; then
|
|
14
|
-
GREEN='\033[0;32m'
|
|
15
|
-
RED='\033[0;31m'
|
|
16
|
-
YELLOW='\033[1;33m'
|
|
17
|
-
NC='\033[0m'
|
|
18
|
-
else
|
|
19
|
-
GREEN='' RED='' YELLOW='' NC=''
|
|
20
|
-
fi
|
|
21
|
-
|
|
22
|
-
echo " Dotfiles Doctor - System Diagnostics"
|
|
23
|
-
echo "-------------------------------------"
|
|
24
|
-
|
|
25
|
-
Errors=0
|
|
26
|
-
Warnings=0
|
|
27
|
-
|
|
28
|
-
log_success() { echo -e "${GREEN} $1${NC}"; }
|
|
29
|
-
log_fail() {
|
|
30
|
-
echo -e "${RED} $1${NC}"
|
|
31
|
-
Errors=$((Errors + 1))
|
|
32
|
-
}
|
|
33
|
-
log_warn() {
|
|
34
|
-
echo -e "${YELLOW}️ $1${NC}"
|
|
35
|
-
Warnings=$((Warnings + 1))
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
# 1. Check Dependencies
|
|
39
|
-
echo "Checking Core Dependencies..."
|
|
40
|
-
for cmd in git curl chezmoi starship rg bat; do
|
|
41
|
-
if command -v "$cmd" &>/dev/null; then
|
|
42
|
-
log_success "Found $cmd: $(command -v "$cmd")"
|
|
43
|
-
else
|
|
44
|
-
log_fail "Missing $cmd"
|
|
45
|
-
fi
|
|
46
|
-
done
|
|
47
|
-
|
|
48
|
-
echo -e "\nChecking Optional AI CLIs..."
|
|
49
|
-
for cmd in claude gemini sgpt ollama opencode aider; do
|
|
50
|
-
if command -v "$cmd" &>/dev/null; then
|
|
51
|
-
log_success "Found $cmd: $(command -v "$cmd")"
|
|
52
|
-
else
|
|
53
|
-
log_warn "Missing $cmd (optional)"
|
|
54
|
-
fi
|
|
55
|
-
done
|
|
56
|
-
|
|
57
|
-
# 2. Check XDG Compliance
|
|
58
|
-
echo -e "\nChecking Environment..."
|
|
59
|
-
if [[ -z "${XDG_CONFIG_HOME:-}" ]]; then
|
|
60
|
-
log_warn "XDG_CONFIG_HOME is not set (Defaulting to ~/.config)"
|
|
61
|
-
else
|
|
62
|
-
log_success "XDG_CONFIG_HOME=$XDG_CONFIG_HOME"
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
if [[ -z "${PIPX_HOME:-}" ]]; then
|
|
66
|
-
log_warn "PIPX_HOME is not set (Check paths configuration)"
|
|
67
|
-
else
|
|
68
|
-
log_success "PIPX_HOME=$PIPX_HOME"
|
|
69
|
-
fi
|
|
70
|
-
|
|
71
|
-
# 3. Check Chezmoi State
|
|
72
|
-
echo -e "\nChecking Chezmoi State..."
|
|
73
|
-
if chezmoi verify &>/dev/null; then
|
|
74
|
-
log_success "Chezmoi state is synchronized"
|
|
75
|
-
else
|
|
76
|
-
log_fail "Chezmoi state has drifted (Run 'dot drift' to see details)"
|
|
77
|
-
fi
|
|
78
|
-
|
|
79
|
-
# 4. Check Critical Files
|
|
80
|
-
echo -e "\nChecking Critical Files..."
|
|
81
|
-
if [[ -f "$HOME/.zshrc" ]]; then
|
|
82
|
-
log_success "Found .zshrc"
|
|
83
|
-
else
|
|
84
|
-
log_fail "Missing .zshrc"
|
|
85
|
-
fi
|
|
86
|
-
|
|
87
|
-
# 5. Check for Broken Symlinks (Ghost Links)
|
|
88
|
-
echo -e "\nChecking for Broken Symlinks..."
|
|
89
|
-
broken_links=0
|
|
90
|
-
while IFS= read -r -d '' link; do
|
|
91
|
-
if [[ ! -e "$link" ]]; then
|
|
92
|
-
log_warn "Broken symlink: $link -> $(readlink "$link")"
|
|
93
|
-
broken_links=$((broken_links + 1))
|
|
94
|
-
fi
|
|
95
|
-
done < <(find "$HOME" -maxdepth 3 -type l -print0 2>/dev/null)
|
|
96
|
-
|
|
97
|
-
if [[ $broken_links -eq 0 ]]; then
|
|
98
|
-
log_success "No broken symlinks found"
|
|
99
|
-
else
|
|
100
|
-
log_warn "$broken_links broken symlink(s) detected"
|
|
101
|
-
fi
|
|
102
|
-
|
|
103
|
-
# Summary
|
|
104
|
-
echo -e "\n-------------------------------------"
|
|
105
|
-
if [[ $Errors -eq 0 ]]; then
|
|
106
|
-
if [[ $Warnings -eq 0 ]]; then
|
|
107
|
-
echo -e "${GREEN}All systems healthy! ${NC}"
|
|
108
|
-
else
|
|
109
|
-
echo -e "${YELLOW}System healthy with $Warnings warnings.${NC}"
|
|
110
|
-
fi
|
|
111
|
-
else
|
|
112
|
-
echo -e "${RED}Found $Errors errors and $Warnings warnings.${NC}"
|
|
113
|
-
echo "Run 'dot heal' to attempt auto-repair."
|
|
114
|
-
exit 1
|
|
115
|
-
fi
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
if ! command -v chezmoi >/dev/null; then
|
|
5
|
-
echo "chezmoi not found." >&2
|
|
6
|
-
exit 1
|
|
7
|
-
fi
|
|
8
|
-
|
|
9
|
-
echo "=== Dotfiles Drift Dashboard ==="
|
|
10
|
-
|
|
11
|
-
status=$(chezmoi status || true)
|
|
12
|
-
if [[ -z "$status" ]]; then
|
|
13
|
-
echo "Clean: no local drift detected."
|
|
14
|
-
exit 0
|
|
15
|
-
fi
|
|
16
|
-
|
|
17
|
-
printf "\nChanged files:\n"
|
|
18
|
-
printf '%s\n' "$status"
|
|
19
|
-
|
|
20
|
-
count=$(printf '%s\n' "$status" | wc -l | tr -d ' ')
|
|
21
|
-
printf "\nTotal: %s\n" "$count"
|
|
22
|
-
|
|
23
|
-
if [[ "${DOTFILES_DRIFT_SHOW_DIFF:-0}" = "1" ]]; then
|
|
24
|
-
printf "\n--- Diff (excluding scripts/install/tests) ---\n"
|
|
25
|
-
chezmoi diff --exclude scripts --exclude install --exclude tests || true
|
|
26
|
-
fi
|
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Dotfiles Health Check Dashboard
|
|
3
|
-
# Usage: dot health [--verbose|-v] [--json]
|
|
4
|
-
|
|
5
|
-
set -euo pipefail
|
|
6
|
-
|
|
7
|
-
# Colors
|
|
8
|
-
RED='\033[0;31m'
|
|
9
|
-
GREEN='\033[0;32m'
|
|
10
|
-
YELLOW='\033[1;33m'
|
|
11
|
-
BLUE='\033[0;34m'
|
|
12
|
-
CYAN='\033[0;36m'
|
|
13
|
-
GRAY='\033[0;90m'
|
|
14
|
-
NC='\033[0m'
|
|
15
|
-
|
|
16
|
-
# Parse arguments (VERBOSE exported for potential use by sourced scripts)
|
|
17
|
-
export VERBOSE=false
|
|
18
|
-
JSON_OUTPUT=false
|
|
19
|
-
while [[ $# -gt 0 ]]; do
|
|
20
|
-
case "$1" in
|
|
21
|
-
--verbose | -v)
|
|
22
|
-
VERBOSE=true
|
|
23
|
-
shift
|
|
24
|
-
;;
|
|
25
|
-
--json)
|
|
26
|
-
JSON_OUTPUT=true
|
|
27
|
-
shift
|
|
28
|
-
;;
|
|
29
|
-
*) shift ;;
|
|
30
|
-
esac
|
|
31
|
-
done
|
|
32
|
-
|
|
33
|
-
# Health check results
|
|
34
|
-
declare -A RESULTS
|
|
35
|
-
TOTAL_CHECKS=0
|
|
36
|
-
PASSED_CHECKS=0
|
|
37
|
-
WARNINGS=0
|
|
38
|
-
FAILURES=0
|
|
39
|
-
|
|
40
|
-
check() {
|
|
41
|
-
local name="$1"
|
|
42
|
-
local status="$2"
|
|
43
|
-
local message="${3:-}"
|
|
44
|
-
|
|
45
|
-
TOTAL_CHECKS=$((TOTAL_CHECKS + 1))
|
|
46
|
-
|
|
47
|
-
case "$status" in
|
|
48
|
-
pass)
|
|
49
|
-
PASSED_CHECKS=$((PASSED_CHECKS + 1))
|
|
50
|
-
# shellcheck disable=SC2034
|
|
51
|
-
RESULTS["$name"]="pass"
|
|
52
|
-
if ! $JSON_OUTPUT; then
|
|
53
|
-
printf "${GREEN}✓${NC} %-35s ${GREEN}OK${NC}\n" "$name"
|
|
54
|
-
fi
|
|
55
|
-
;;
|
|
56
|
-
warn)
|
|
57
|
-
WARNINGS=$((WARNINGS + 1))
|
|
58
|
-
# shellcheck disable=SC2034
|
|
59
|
-
RESULTS["$name"]="warn"
|
|
60
|
-
if ! $JSON_OUTPUT; then
|
|
61
|
-
printf "${YELLOW}⚠${NC} %-35s ${YELLOW}WARNING${NC}"
|
|
62
|
-
[[ -n "$message" ]] && printf " ${GRAY}%s${NC}" "$message"
|
|
63
|
-
printf "\n"
|
|
64
|
-
fi
|
|
65
|
-
;;
|
|
66
|
-
fail)
|
|
67
|
-
FAILURES=$((FAILURES + 1))
|
|
68
|
-
# shellcheck disable=SC2034
|
|
69
|
-
RESULTS["$name"]="fail"
|
|
70
|
-
if ! $JSON_OUTPUT; then
|
|
71
|
-
printf "${RED}✗${NC} %-35s ${RED}FAILED${NC}"
|
|
72
|
-
[[ -n "$message" ]] && printf " ${GRAY}%s${NC}" "$message"
|
|
73
|
-
printf "\n"
|
|
74
|
-
fi
|
|
75
|
-
;;
|
|
76
|
-
esac
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
print_header() {
|
|
80
|
-
if ! $JSON_OUTPUT; then
|
|
81
|
-
echo -e "\n${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
82
|
-
echo -e "${CYAN} Dotfiles Health Dashboard${NC}"
|
|
83
|
-
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}\n"
|
|
84
|
-
fi
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
check_section() {
|
|
88
|
-
if ! $JSON_OUTPUT; then
|
|
89
|
-
echo -e "\n${BLUE}▸ $1${NC}"
|
|
90
|
-
echo "───────────────────────────────────────────────"
|
|
91
|
-
fi
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
# === Core Checks ===
|
|
95
|
-
run_checks() {
|
|
96
|
-
# --- Dotfiles Core ---
|
|
97
|
-
check_section "Dotfiles Core"
|
|
98
|
-
|
|
99
|
-
# Chezmoi
|
|
100
|
-
if command -v chezmoi >/dev/null 2>&1; then
|
|
101
|
-
check "Chezmoi installed" "pass"
|
|
102
|
-
# Check if source dir exists
|
|
103
|
-
if [[ -d "${HOME}/.local/share/chezmoi" ]] || [[ -d "${HOME}/.dotfiles" ]]; then
|
|
104
|
-
check "Chezmoi source directory" "pass"
|
|
105
|
-
else
|
|
106
|
-
check "Chezmoi source directory" "fail" "Not found"
|
|
107
|
-
fi
|
|
108
|
-
else
|
|
109
|
-
check "Chezmoi installed" "fail" "Not installed"
|
|
110
|
-
fi
|
|
111
|
-
|
|
112
|
-
# Git
|
|
113
|
-
if command -v git >/dev/null 2>&1; then
|
|
114
|
-
check "Git installed" "pass"
|
|
115
|
-
if git config user.email >/dev/null 2>&1; then
|
|
116
|
-
check "Git user configured" "pass"
|
|
117
|
-
else
|
|
118
|
-
check "Git user configured" "warn" "Email not set"
|
|
119
|
-
fi
|
|
120
|
-
else
|
|
121
|
-
check "Git installed" "fail"
|
|
122
|
-
fi
|
|
123
|
-
|
|
124
|
-
# --- Shell ---
|
|
125
|
-
check_section "Shell Environment"
|
|
126
|
-
|
|
127
|
-
# Zsh
|
|
128
|
-
if command -v zsh >/dev/null 2>&1; then
|
|
129
|
-
check "Zsh installed" "pass"
|
|
130
|
-
if [[ "$SHELL" == *"zsh"* ]]; then
|
|
131
|
-
check "Zsh is default shell" "pass"
|
|
132
|
-
else
|
|
133
|
-
check "Zsh is default shell" "warn" "Current: $SHELL"
|
|
134
|
-
fi
|
|
135
|
-
else
|
|
136
|
-
check "Zsh installed" "fail"
|
|
137
|
-
fi
|
|
138
|
-
|
|
139
|
-
# Zinit
|
|
140
|
-
if [[ -d "${ZINIT_HOME:-$HOME/.local/share/zinit}" ]]; then
|
|
141
|
-
check "Zinit plugin manager" "pass"
|
|
142
|
-
else
|
|
143
|
-
check "Zinit plugin manager" "warn" "Not found"
|
|
144
|
-
fi
|
|
145
|
-
|
|
146
|
-
# Starship
|
|
147
|
-
if command -v starship >/dev/null 2>&1; then
|
|
148
|
-
check "Starship prompt" "pass"
|
|
149
|
-
else
|
|
150
|
-
check "Starship prompt" "warn" "Not installed"
|
|
151
|
-
fi
|
|
152
|
-
|
|
153
|
-
# --- Development Tools ---
|
|
154
|
-
check_section "Development Tools"
|
|
155
|
-
|
|
156
|
-
# Node.js
|
|
157
|
-
if command -v node >/dev/null 2>&1; then
|
|
158
|
-
local node_version
|
|
159
|
-
node_version=$(node --version 2>/dev/null)
|
|
160
|
-
check "Node.js ($node_version)" "pass"
|
|
161
|
-
else
|
|
162
|
-
check "Node.js" "warn" "Not installed"
|
|
163
|
-
fi
|
|
164
|
-
|
|
165
|
-
# fnm
|
|
166
|
-
if command -v fnm >/dev/null 2>&1; then
|
|
167
|
-
check "fnm (Node version manager)" "pass"
|
|
168
|
-
else
|
|
169
|
-
check "fnm" "warn" "Not installed"
|
|
170
|
-
fi
|
|
171
|
-
|
|
172
|
-
# Python
|
|
173
|
-
if command -v python3 >/dev/null 2>&1; then
|
|
174
|
-
local py_version
|
|
175
|
-
py_version=$(python3 --version 2>/dev/null | cut -d' ' -f2)
|
|
176
|
-
check "Python ($py_version)" "pass"
|
|
177
|
-
else
|
|
178
|
-
check "Python" "warn" "Not installed"
|
|
179
|
-
fi
|
|
180
|
-
|
|
181
|
-
# Rust
|
|
182
|
-
if command -v rustc >/dev/null 2>&1; then
|
|
183
|
-
check "Rust toolchain" "pass"
|
|
184
|
-
else
|
|
185
|
-
check "Rust toolchain" "warn" "Not installed"
|
|
186
|
-
fi
|
|
187
|
-
|
|
188
|
-
# Go
|
|
189
|
-
if command -v go >/dev/null 2>&1; then
|
|
190
|
-
check "Go" "pass"
|
|
191
|
-
else
|
|
192
|
-
check "Go" "warn" "Not installed"
|
|
193
|
-
fi
|
|
194
|
-
|
|
195
|
-
# --- CLI Tools ---
|
|
196
|
-
check_section "CLI Tools"
|
|
197
|
-
|
|
198
|
-
local tools=("fzf" "ripgrep:rg" "fd" "bat" "eza" "zoxide" "atuin" "delta" "jq" "yq" "sops" "mise" "just" "zellij" "hyperfine")
|
|
199
|
-
for tool in "${tools[@]}"; do
|
|
200
|
-
local name="${tool%%:*}"
|
|
201
|
-
local cmd="${tool##*:}"
|
|
202
|
-
if command -v "$cmd" >/dev/null 2>&1; then
|
|
203
|
-
check "$name" "pass"
|
|
204
|
-
else
|
|
205
|
-
check "$name" "warn" "Not installed"
|
|
206
|
-
fi
|
|
207
|
-
done
|
|
208
|
-
|
|
209
|
-
# --- Editors ---
|
|
210
|
-
check_section "Editors"
|
|
211
|
-
|
|
212
|
-
if command -v nvim >/dev/null 2>&1; then
|
|
213
|
-
check "Neovim" "pass"
|
|
214
|
-
if [[ -d "${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lazy" ]]; then
|
|
215
|
-
check "Neovim plugins (lazy.nvim)" "pass"
|
|
216
|
-
else
|
|
217
|
-
check "Neovim plugins" "warn" "Lazy.nvim not found"
|
|
218
|
-
fi
|
|
219
|
-
else
|
|
220
|
-
check "Neovim" "warn" "Not installed"
|
|
221
|
-
fi
|
|
222
|
-
|
|
223
|
-
# --- Terminal ---
|
|
224
|
-
check_section "Terminal"
|
|
225
|
-
|
|
226
|
-
if command -v ghostty >/dev/null 2>&1 || [[ -d "/Applications/Ghostty.app" ]]; then
|
|
227
|
-
check "Ghostty terminal" "pass"
|
|
228
|
-
else
|
|
229
|
-
check "Ghostty terminal" "warn" "Not installed"
|
|
230
|
-
fi
|
|
231
|
-
|
|
232
|
-
# Fonts - check both Linux and macOS font locations
|
|
233
|
-
local font_found=false
|
|
234
|
-
if fc-list 2>/dev/null | grep -qi "JetBrains"; then
|
|
235
|
-
font_found=true
|
|
236
|
-
elif [[ -d "$HOME/Library/Fonts" ]] && compgen -G "$HOME/Library/Fonts/"*[Jj]et[Bb]rains* >/dev/null 2>&1; then
|
|
237
|
-
font_found=true
|
|
238
|
-
elif [[ -d "$HOME/.local/share/fonts" ]] && compgen -G "$HOME/.local/share/fonts/"*[Jj]et[Bb]rains* >/dev/null 2>&1; then
|
|
239
|
-
font_found=true
|
|
240
|
-
fi
|
|
241
|
-
|
|
242
|
-
if $font_found; then
|
|
243
|
-
check "JetBrains Mono Nerd Font" "pass"
|
|
244
|
-
else
|
|
245
|
-
check "JetBrains Mono Nerd Font" "warn" "Not installed"
|
|
246
|
-
fi
|
|
247
|
-
|
|
248
|
-
# --- Security ---
|
|
249
|
-
check_section "Security"
|
|
250
|
-
|
|
251
|
-
# Age encryption
|
|
252
|
-
if command -v age >/dev/null 2>&1; then
|
|
253
|
-
check "Age encryption" "pass"
|
|
254
|
-
if [[ -f "${HOME}/.config/chezmoi/key.txt" ]]; then
|
|
255
|
-
check "Age key configured" "pass"
|
|
256
|
-
else
|
|
257
|
-
check "Age key configured" "warn" "Key not found"
|
|
258
|
-
fi
|
|
259
|
-
else
|
|
260
|
-
check "Age encryption" "warn" "Not installed"
|
|
261
|
-
fi
|
|
262
|
-
|
|
263
|
-
# SSH
|
|
264
|
-
if [[ -f "${HOME}/.ssh/id_ed25519" ]] || [[ -f "${HOME}/.ssh/id_rsa" ]]; then
|
|
265
|
-
check "SSH keys present" "pass"
|
|
266
|
-
else
|
|
267
|
-
check "SSH keys present" "warn" "No keys found"
|
|
268
|
-
fi
|
|
269
|
-
|
|
270
|
-
# GPG
|
|
271
|
-
if command -v gpg >/dev/null 2>&1; then
|
|
272
|
-
if gpg --list-secret-keys 2>/dev/null | grep -q sec; then
|
|
273
|
-
check "GPG keys" "pass"
|
|
274
|
-
else
|
|
275
|
-
check "GPG keys" "warn" "No secret keys"
|
|
276
|
-
fi
|
|
277
|
-
else
|
|
278
|
-
check "GPG" "warn" "Not installed"
|
|
279
|
-
fi
|
|
280
|
-
|
|
281
|
-
# --- Performance ---
|
|
282
|
-
check_section "Performance"
|
|
283
|
-
|
|
284
|
-
# Shell startup time
|
|
285
|
-
if command -v zsh >/dev/null 2>&1; then
|
|
286
|
-
local startup_time
|
|
287
|
-
startup_time=$({ time zsh -i -c exit; } 2>&1 | grep real | awk '{print $2}' | sed 's/[ms]//g')
|
|
288
|
-
# Try to parse the time (handle different formats)
|
|
289
|
-
if [[ -n "$startup_time" ]]; then
|
|
290
|
-
# Simple check - if startup mentions 0m0, it's under 1 second
|
|
291
|
-
check "Shell startup time" "pass"
|
|
292
|
-
else
|
|
293
|
-
check "Shell startup time" "warn" "Could not measure"
|
|
294
|
-
fi
|
|
295
|
-
fi
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
print_summary() {
|
|
299
|
-
if $JSON_OUTPUT; then
|
|
300
|
-
echo "{"
|
|
301
|
-
echo " \"total\": $TOTAL_CHECKS,"
|
|
302
|
-
echo " \"passed\": $PASSED_CHECKS,"
|
|
303
|
-
echo " \"warnings\": $WARNINGS,"
|
|
304
|
-
echo " \"failures\": $FAILURES,"
|
|
305
|
-
echo " \"score\": $((PASSED_CHECKS * 100 / TOTAL_CHECKS))"
|
|
306
|
-
echo "}"
|
|
307
|
-
return
|
|
308
|
-
fi
|
|
309
|
-
|
|
310
|
-
local score=$((PASSED_CHECKS * 100 / TOTAL_CHECKS))
|
|
311
|
-
|
|
312
|
-
echo -e "\n${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
313
|
-
echo -e "${CYAN} Summary${NC}"
|
|
314
|
-
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}\n"
|
|
315
|
-
|
|
316
|
-
echo -e " Total checks: ${TOTAL_CHECKS}"
|
|
317
|
-
echo -e " ${GREEN}Passed:${NC} ${PASSED_CHECKS}"
|
|
318
|
-
echo -e " ${YELLOW}Warnings:${NC} ${WARNINGS}"
|
|
319
|
-
echo -e " ${RED}Failures:${NC} ${FAILURES}"
|
|
320
|
-
echo ""
|
|
321
|
-
|
|
322
|
-
# Health score bar
|
|
323
|
-
local bar_width=30
|
|
324
|
-
local filled=$((score * bar_width / 100))
|
|
325
|
-
local empty=$((bar_width - filled))
|
|
326
|
-
|
|
327
|
-
printf " Health Score: ["
|
|
328
|
-
if [[ $score -ge 80 ]]; then
|
|
329
|
-
printf '%s' "${GREEN}"
|
|
330
|
-
elif [[ $score -ge 60 ]]; then
|
|
331
|
-
printf '%s' "${YELLOW}"
|
|
332
|
-
else
|
|
333
|
-
printf '%s' "${RED}"
|
|
334
|
-
fi
|
|
335
|
-
printf "%${filled}s" | tr ' ' '█'
|
|
336
|
-
printf '%s' "${NC}"
|
|
337
|
-
printf "%${empty}s" | tr ' ' '░'
|
|
338
|
-
printf "] %s%%\n\n" "${score}"
|
|
339
|
-
|
|
340
|
-
if [[ $score -ge 90 ]]; then
|
|
341
|
-
echo -e " ${GREEN}⚡ Excellent! Your dotfiles are in great shape.${NC}"
|
|
342
|
-
elif [[ $score -ge 70 ]]; then
|
|
343
|
-
echo -e " ${GREEN}✓ Good! Minor improvements possible.${NC}"
|
|
344
|
-
elif [[ $score -ge 50 ]]; then
|
|
345
|
-
echo -e " ${YELLOW}⚠ Fair. Consider addressing warnings.${NC}"
|
|
346
|
-
else
|
|
347
|
-
echo -e " ${RED}✗ Needs attention. Multiple issues found.${NC}"
|
|
348
|
-
fi
|
|
349
|
-
|
|
350
|
-
echo ""
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
# Main
|
|
354
|
-
print_header
|
|
355
|
-
run_checks
|
|
356
|
-
print_summary
|