Skip to content
JoannaaKLPublic

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

Dotfiles

Shell Lint

Opinionated workstation + Codespaces bootstrap.

Features

  • Idempotent install.sh that picks Homebrew (macOS) or apt (Linux, Codespaces) and sets up:
    • Packages from the Brewfile
    • Oh My Zsh and the Spaceship theme
    • Neovim with a minimal config bootstrap
    • Meslo Nerd Font (a Brewfile cask on macOS)
    • Symlinks that never overwrite or repoint anything (existing files are backed up)
    • ~/.zshrc and ~/.gitconfig as local files that load the shared ones, so tools that edit them never touch tracked files
  • Safety nets: scan-secrets.sh (run by git hooks and CI), strict permissions for credential files, doctor.sh
  • A private overlay (snapshot-private.sh) that carries non-secret local files to a new Mac
  • Managed Codespaces SSH config export (export_codespace_cfg)
  • Codespace cleanup utility (clean-codespaces.sh --dry-run)
  • Custom multi-model PR review/fix loop with the multi-model-pr-loop Copilot skill
  • Shell linting, tests and secret checks via GitHub Actions + local make lint test.

Libraries and Packages

Shell & Terminal

  • Oh My Zsh - Zsh framework for managing configuration
  • Spaceship Prompt - Minimalistic and powerful Zsh prompt
  • tmux - Terminal multiplexer
  • fzf - Command-line fuzzy finder

Editors

  • Neovim - Hyperextensible Vim-based text editor

CLI Utilities

  • bat - A cat clone with syntax highlighting
  • ripgrep - Fast line-oriented search tool
  • GitHub CLI - GitHub's official command-line tool
  • GitHub Copilot CLI - Standalone coding agent used by the PR review commands

Fonts

Development Tools

  • ShellCheck - Static analysis tool for shell scripts

Oh My Zsh Plugins

  • git - Git aliases and functions
  • alias-finder - Find existing aliases
  • kubectl - Kubectl autocompletion and aliases
  • docker - Docker autocompletion and aliases
  • gh - GitHub CLI autocompletion

Setup Instructions

Prerequisites

  • macOS: Homebrew installed (the installer stops and prints the install command if it is missing)
  • Linux/Codespaces: apt-get available (the installer installs zsh and the other tools)
  • Both: git and curl

Installation

  1. Clone the repository:

    git clone https://github.com/JoannaaKL/dotfiles.git
    cd dotfiles
  2. Run the install script:

    ./install.sh
  3. Start a new shell or source the configuration:

    source ~/.zshrc

What the Install Script Does

The install.sh script performs the following actions:

  1. Preflight checks - Verifies git and curl (and Homebrew on macOS)
  2. Git hooks - Enables .githooks for this clone unless core.hooksPath or a custom hook is already set. This comes first because it needs no network, so the secret scan is on even if a later step fails
  3. Packages
    • macOS: brew bundle --no-upgrade with the Brewfile, so tools that are already installed are not upgraded, plus the Copilot CLI cask when copilot is missing
    • Linux/Codespaces: one apt-get install for whatever is missing (bat is exposed as bat although Debian names it batcat), then gh on its own because the shared .gitconfig calls gh auth git-credential and not every apt release has it. A package failure, or a system without apt-get, only warns and the rest of the install carries on
    • Every platform: an existing ~/.netrc is set to mode 600 first, and a proxy entry is never appended through a symlinked ~/.netrc
  4. Private overlay (optional) - Restores files from ~/.dotfiles-private/home (owner-only: mode 600, or 700 for files that are executable in the overlay) where the target does not exist yet, skipping any path behind a symlinked directory; the overlay's Brewfile is installed as the last step
  5. Symlinks - .tmux.conf, .spaceship.zsh, .gitmessage and the global ignore file .gitignore_global (as ~/.gitignore). Existing files are backed up. A symlink that points somewhere else, for example into another clone, is left alone; DOTFILES_FORCE=1 ./install.sh repoints it
  6. Local config files - ~/.zshrc and ~/.gitconfig (see Local config and safety) and a private ~/.zshrc.local created from the template. An existing file is replaced only after a verified backup, and a failing step leaves it as it was. A block that is already current needs no write, so a read-only file is fine, and a refresh keeps the file's mode
  7. Tools - Neovim config (a missing nvim only warns, and a symlinked ~/.config/nvim is left alone), Oh My Zsh (cloned, not piped from curl), the Spaceship theme (skipped without Oh My Zsh; an incomplete directory is moved aside and the theme link is always ensured), and the Meslo Nerd Font on Linux workstations (macOS gets it from the Brewfile, Codespaces renders fonts in the client). The two clones are network steps: if one fails, the installer says so, finishes the remaining steps and exits 1
  8. PR review and catchup commands - Links pr-review, pr-address-feedback, pr-review-loop, catchup and their Copilot skills

Manual Setup (Optional)

If you prefer to install components individually:

Local config and safety

This repository is public, so machine-specific or secret data stays out of tracked files.

File in $HOME Kind Purpose
.tmux.conf, .spaceship.zsh, .gitmessage, .gitignore symlink into the repo shared config (.gitignore links to .gitignore_global)
.zshrc, .gitconfig regular local file a managed block loads the shared file from the repo; everything else in the file is local
.zshrc.local regular local file, mode 600 your hosts, proxies and other private settings; start from .zshrc.local.example

Tools such as Git Credential Manager, bun, uv and the Agency CLI append to ~/.zshrc or run git config --global. When those two files were symlinks into this repo, the edits landed in tracked files, and one git add -A could have published an Entra tenant ID, a work username and absolute home paths. They now land in the local files instead. Keep tokens and keys in a password manager (for example 1Password), never in a dotfile.

Safety nets:

  • scan-secrets.sh scans tracked files, the index (--staged) or all history (--history) for GitHub, AWS and Slack tokens, AWS secret keys, Azure storage and Service Bus keys, PEM and PGP private keys, JWTs, bearer and Basic auth headers, credentials embedded in URLs (a user and password before the @, percent-encoded or not), credential-like key = value assignments (a quoted value of 8 or more characters, or an unquoted one of 8 or more that contains a digit; a letters-only unquoted passphrase is not caught), netrc entries (also with machine, login and password on separate lines) and npm passwords, Entra/Azure tenant and subscription IDs, hard-coded /Users/<name>/ paths and credential file names, including ones a merge commit introduces. Binary files are searched as text, so a credential cannot hide in one. Its output does not depend on your git settings (color.ui, grep.column, ...). It prints file:line [rule] and never the matched value, and it fails closed: exit 2 if git or the denylist cannot be read, or if SCAN_SECRETS_DENYLIST names a file that does not exist. Private patterns (internal hostnames) must not appear in a public repo, so list them one regex per line in the untracked ~/.config/dotfiles/denylist; snapshot-private.sh carries that file to the private overlay and ./doctor.sh warns when it is missing. The scanner is a backstop, not proof that nothing sensitive is present.
  • Git hooks (.githooks) run the scanner on pre-commit (the index) and pre-push (every commit the remote does not have yet, which also covers merge commits and a secret added then removed). The push boundary is the SHA the remote advertises, never a possibly stale remote-tracking ref, and a new branch is scanned in full. Both hooks fail closed: a missing or non-executable scanner blocks the commit or push. --no-verify skips them; GitHub secret scanning with push protection is the server-side backstop.
  • ./doctor.sh reports tool-written edits behind symlinks, loose permissions on ~/.netrc, ~/.ssh keys and ~/.zshrc.local, IdentityFile paths that do not exist and a missing scanner denylist. --fix only runs chmod; --time also measures zsh startup.
  • Ignore files: .gitignore applies to this repo only. .gitignore_global is deployed as ~/.gitignore (core.excludesfile) and applies to every repo, so it holds only specific patterns. It still ignores *mcp*.json on purpose, because MCP client configs can contain tokens; that also hides intended files such as .vscode/mcp.json, which need git add -f.

Moving to a new Mac

  1. Old Mac: run ./snapshot-private.sh (add --with-skills for your Copilot skills). It copies non-secret local files (.zshrc.local, .zshenv, .zprofile, .gitconfig, .ssh/config, the scanner denylist, ...) and a Brewfile of everything installed into ~/.dotfiles-private, skipping anything that looks like a credential. It never writes through a symlink inside the overlay, and it adds an exception to the overlay's own .gitignore for any copied file that your global ignore would hide (the shipped one lists .zshrc.local), so a plain git add -A picks everything up. It never deletes anything from the overlay: a file it did not refresh this time (its source is gone here, or it was skipped) is listed as "Not refreshed", so you can remove an obsolete one before it is restored onto the next Mac. Review it, then push it to a private repository, for example gh repo create dotfiles-private --private --source ~/.dotfiles-private --push.
  2. Secrets: keep SSH keys, access tokens and the .netrc token in 1Password (or similar), not in any repository. macOS Migration Assistant is the alternative for a 1:1 copy of everything.
  3. New Mac: install Homebrew, then
    git clone https://github.com/JoannaaKL/dotfiles.git ~/dotfiles
    git clone <your private repo> ~/.dotfiles-private   # optional overlay
    ~/dotfiles/install.sh
    install.sh restores overlay files (owner-only: 600, or 700 for executables) only where the target is missing and refreshes the managed blocks when the clone moved. A block that loads another clone which still exists is left alone (DOTFILES_FORCE=1 ./install.sh repoints it), so installing from a temporary worktree cannot break your shell. It installs the overlay's Brewfile last, and a failing entry there only warns, so it can never block the links and wrappers.
  4. Sign in again (gh auth login, copilot login), restore keys and tokens from the password manager, and run ./doctor.sh to confirm nothing is missing.

Upgrading an existing machine

Older installs symlinked ~/.zshrc and ~/.gitconfig into the repo. install.sh converts them only when the repo copy has no local edits; otherwise it leaves them untouched and says so. If ./doctor.sh reports uncommitted edits behind those symlinks:

  1. Save the tool-added lines outside the repo (the patch can hold tenant IDs and usernames, so never commit or share it): git -C ~/dotfiles diff -- .zshrc .gitconfig > ~/dotfiles-local.patch && chmod 600 ~/dotfiles-local.patch
  2. Copy the shell lines you still need (PATH additions, tool setup, proxies, employer hosts) from the patch into ~/.zshrc.local. The shared .zshrc already sources it, so nothing changes yet and PATH never loses a tool such as copilot.
  3. Reset the clone, update it and install: git -C ~/dotfiles checkout -- .zshrc .gitconfig && git -C ~/dotfiles pull && ~/dotfiles/install.sh. The two symlinks become local files.
  4. Copy the Git settings you still need (credential helpers, per-host entries) from the patch into ~/.gitconfig, below the managed block. Then run ./doctor.sh --fix.

Git reads the shared settings through the [include] in ~/.gitconfig, so every normal git command sees them. git config --global --get <key> and --global --list only read the local file; use git config --get <key> or git config --list --show-origin for the effective values.

Multi-model PR Review Loop

The custom multi-model-pr-loop skill runs repeated review/fix rounds with two distinct Copilot model IDs per round. It is separate from the GitHub Copilot app's built-in PR review.

In a new app session, say:

Use the multi-model-pr-loop skill on <PR URL>

The shell command keeps its original name:

export PATH="$HOME/.local/bin:/opt/homebrew/bin:$PATH"
pr-review-loop <pr-url> [max-iters]

Install the standalone copilot CLI separately and authenticate with copilot login and gh auth login. Node.js, git, and jq must also be on PATH. The old gh copilot extension is not a substitute for the standalone CLI.

The loop uses a blobless temporary checkout and stops at PASS or the iteration cap, which defaults to 6. Checkouts with fixes are kept because the commits are not pushed. Review-only checkouts can be removed automatically by passing an explicit output path to pr-review. No GitHub review is posted.

As of 2026-09-07, the default pool contains 19 public model IDs from the authenticated Copilot CLI catalog, including GPT-6 Astra. auto and internal-only models are excluded. This is a snapshot, not automatic model discovery; availability depends on the subscription and organization policies.

See the PR review commands guide for the full model pool, custom model overrides, review-only and fix-only commands, and exit codes.

Repository Checks

Run locally:

make lint     # shellcheck on every tracked Bash script, plus scan-secrets.sh --tracked
make test     # fixture tests (temporary HOME, brew and apt stubbed)
make doctor   # check this machine; ./doctor.sh --fix tightens credential file permissions
make hooks    # enable the git hooks (install.sh already does)

The CI workflow runs make lint and make test on every push and pull request. Its actions are pinned to commit SHAs and kept current by Dependabot.

Codespaces SSH Config Export

./export_codespace_cfg

This inserts/updates a managed block in ~/.ssh/config between markers:

# >>> codespaces (managed) >>>
# <<< codespaces (managed) <<<

Cleaning Shutdown Codespaces

Preview:

./clean-codespaces.sh --dry-run

Execute deletions:

./clean-codespaces.sh

Future Ideas

  • Brewfile / apt manifest abstraction
  • Tmux plugin manager integration
  • Advanced Neovim config module

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages