Skip to main content

Shell: Fish

Fish is the primary shell in this setup.

Zsh and Bash are also configured so the environment is usable even if you don't switch your login shell.

Relevant files:

Core Configโ€‹

Notable responsibilities in this file:

  • sets editor to nvim
  • exports SSH_AUTH_SOCK for 1Password
  • configures Homebrew path via homebrewPrefix prompt data
  • loads API keys from pass into environment variables
  • adds ~/bin and ~/.local/bin to PATH on login

It also initializes a few tools if present:

Startup Modelโ€‹

Fish setup in this repo is split by shell mode:

  • Login shell:
    • Adds Homebrew, ~/.local/bin, ~/bin, and mise shims to PATH.
  • Interactive shell:
    • Adds aliases (g, v, c, t, and others).
    • Defines the codex function, which routes through the managed ,codex wrapper.
    • Initializes prompt/tools (starship, zoxide, navi when installed).

If a command works in one terminal but not another, check whether the shell is login vs non-login.

Non-fish startup files are intentionally side-effect free for secret loading: pass-based API key exports run in fish config, not in home/readonly_dot_profile.tmpl.

Machine-local extrasโ€‹

Each profile sources an optional extra file last, if it exists. Chezmoi does not create or manage these files; keep them out of git.

ShellExtra fileSyntax
POSIX login (bash/zsh .profile)~/.profile.localPOSIX (export โ€ฆ)
Bash interactive~/.bashrc.localbash
Zsh interactive~/.zshrc.localzsh
Fish~/.config/fish/config.local.fishfish (set -gx โ€ฆ)

Missing files are a no-op. Prefer chmod 600 when the file holds secrets.

Fish conf.d/ runs before config.fish, so it cannot override managed settings. Put overrides in config.local.fish.

Fish cannot source POSIX export files. Use config.local.fish for fish, and ~/.profile.local for bash/zsh login env.

pass and 1Password remain the preferred secret path. These extras are the machine-local escape hatch.

Verification Workflowsโ€‹

Confirm effective shell + pathโ€‹

echo "$SHELL"
fish --version
echo "$PATH"

Confirm key runtime wiringโ€‹

echo "$SSH_AUTH_SOCK"

Confirm API key loading behaviorโ€‹

echo "${GEMINI_API_KEY:+set}"
echo "${OPENROUTER_API_KEY:+set}"

Ignore Globs (fd / ripgrep / fzf)โ€‹

This setup keeps a shared ignore-globs file used by fd/fzf defaults:

In fish, it's wired via:

Fish Pluginsโ€‹

Fish plugins are managed with Fisher:

Troubleshootingโ€‹

  • command not found for ,commands:
    • check ~/bin in PATH
    • run chezmoi apply again
  • Missing API keys:
    • verify pass is installed and unlocked
    • verify the expected secret paths exist in your password store

Making Fish Your Login Shellโ€‹

The setup script installs fish and will attempt to set it as your main shell: