Skip to content

Instantly share code, notes, and snippets.

@mdodsworth
Created February 13, 2026 00:48
Show Gist options
  • Select an option

  • Save mdodsworth/c7a6c575cfd5c7bf9d02debed10ec2e5 to your computer and use it in GitHub Desktop.

Select an option

Save mdodsworth/c7a6c575cfd5c7bf9d02debed10ec2e5 to your computer and use it in GitHub Desktop.
Sanitized fish aliases for sharing
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias cat='bat'
alias gti='git'
alias gs='git status'
alias gd='git diff'
alias gp='git pending'
alias gl='git log'
alias ga='git add -u'
alias gA='git add -A'
alias lg='lazygit'
alias tree='tree -C'
alias g='./gradlew'
alias c='cargo'
alias p='poetry'
alias macvim="open \"mvim://open?url=file://$1\""
alias vim='nvim'
alias v='vim'
alias cu='cursor'
alias ws='windsurf'
alias dc='docker-compose'
alias tf='terraform'
alias rgu='rg -u --hidden --glob "!.git/"'
alias pip=pip3
alias python=python3
alias oi='SHELL=(which bash) interpreter -y'
alias awslocal='aws --region=us-west-2 --endpoint-url=http://localhost:4566'
alias hm "history merge"
# Create or attach to a zmx session for the current worktree + role.
# Session format: "<worktree>.<role>" (e.g., "waitify-mono-charlie.codex").
# Roles with default launch commands: claude -> cld, codex -> cdx, opencode -> oc.
function __ts_worktree_slug
set -l root (command git rev-parse --show-toplevel 2>/dev/null)
set -l name ""
if test -n "$root"
set name (basename "$root")
else
set name (basename (pwd))
end
set -l slug (string lower -- $name)
set slug (string replace -a '.' '-' -- $slug)
set slug (string replace -a ' ' '-' -- $slug)
set slug (string replace -r -a '[^a-z0-9_-]' '-' -- $slug)
echo $slug
end
function __ts_role_slug --argument-names raw_role
if test -z "$raw_role"
echo "misc"
return
end
set -l role (string lower -- $raw_role)
switch $role
case open-code open_code oc open
set role "opencode"
end
set role (string replace -a '.' '-' -- $role)
set role (string replace -a ' ' '-' -- $role)
set role (string replace -r -a '[^a-z0-9_-]' '-' -- $role)
echo $role
end
function ts
if not command -q zmx
echo "zmx is not installed. Install with: brew install zmx"
return 1
end
set -l worktree (__ts_worktree_slug)
set -l action "attach"
set -l role "misc"
if test (count $argv) -gt 0
set -l first (string lower -- $argv[1])
switch $first
case ls list
set action "list"
case kill k
set action "kill"
if test (count $argv) -gt 1
set role (__ts_role_slug $argv[2])
end
case help -h --help
echo "usage: ts [role|list|kill [role]]"
echo "roles: misc (default), claude, codex, opencode"
return 0
case '*'
set role (__ts_role_slug $first)
end
end
switch $action
case list
set -l prefix "$worktree."
set -l prefix_re (string escape --style=regex -- $prefix)
set -l sessions (zmx list --short 2>/dev/null | string match -r "^$prefix_re.*")
if test (count $sessions) -eq 0
echo "no zmx sessions for $worktree"
return 0
end
printf '%s\n' $sessions
return 0
case kill
set -l session_name "$worktree.$role"
zmx kill $session_name
return $status
end
set -l session_name "$worktree.$role"
set -l session_re (string escape --style=regex -- $session_name)
set -l session_exists (zmx list --short 2>/dev/null | string match -r "^$session_re\$")
if test (count $session_exists) -gt 0
zmx attach $session_name
return $status
end
set -l attach_cmd
switch $role
case claude
set attach_cmd fish -lc "cld -y; exec fish -l"
case codex
set attach_cmd fish -lc "cdx -y; exec fish -l"
case opencode
set attach_cmd fish -lc "oc; exec fish -l"
end
if test (count $attach_cmd) -gt 0
zmx attach $session_name $attach_cmd
else
zmx attach $session_name
end
end
alias godex "codex --provider gemini -m gemini-2.5-pro-preview-06-05"
alias ccusage "npx ccusage@latest"
function update-fanfare-skills
set -l marketplace_dir ~/.claude/plugins/marketplaces/fanfare-skills
set -l cache_dir ~/.claude/plugins/cache/fanfare-skills
if not test -d $marketplace_dir/.git
echo "Fanfare skills marketplace not found at $marketplace_dir"
return 1
end
echo "Pulling latest fanfare-skills..."
git -C $marketplace_dir pull --ff-only 2>&1
if test $status -ne 0
echo "Failed to pull fanfare-skills"
return 1
end
if test -d $cache_dir
rm -rf $cache_dir
echo "Cache cleared."
end
echo "Done. Restart Claude Code to apply changes."
end
function claude-vertex
echo "Switching Claude Code to Vertex AI provider..."
set -gx CLAUDE_CODE_USE_VERTEX 1
set -gx CLOUD_ML_REGION <REDACTED_REGION>
set -gx ANTHROPIC_VERTEX_PROJECT_ID <REDACTED_PROJECT_ID>
echo "βœ“ Claude Code now using Vertex AI (Project: <REDACTED_PROJECT_ID>, Region: <REDACTED_REGION>)"
end
function claude-default
echo "Switching Claude Code to default provider..."
set -e CLAUDE_CODE_USE_VERTEX
set -e CLOUD_ML_REGION
set -e ANTHROPIC_VERTEX_PROJECT_ID
echo "βœ“ Claude Code now using default provider"
end
function claude-status
if test -n "$CLAUDE_CODE_USE_VERTEX"
echo "Claude Code is using: Vertex AI"
echo " Project ID: <REDACTED_PROJECT_ID>"
echo " Region: <REDACTED_REGION>"
else
echo "Claude Code is using: Default provider"
end
end
function cdx
set -l primary ""
if test (count $argv) -gt 0
set primary (string lower -- $argv[1])
end
if test "$primary" = "update"
npm install -g @openai/codex@latest
return
end
# Run Codex inside bash to avoid fish-specific env/quoting issues.
set -l args
set -l yolo_mode 0
# Parse arguments - extract -y/--yolo before passing to codex
for a in $argv
switch $a
case -y --yolo
set yolo_mode 1
case '*'
set -a args $a
end
end
set -l have_model 0
for a in $args
if test "$a" = "-m" -o "$a" = "--model"
set have_model 1
end
end
# Enable reasoning summaries for interactive CLI use
# (config.toml suppresses them by default for automated/scripted use)
set -l base_args \
-c 'model_reasoning_summary="auto"' \
-c hide_agent_reasoning=false
if test $yolo_mode -eq 1
set base_args $base_args --yolo
else
set base_args $base_args --full-auto
end
if test $have_model -eq 0
set base_args $base_args -m gpt-5.3-codex
end
# Set terminal title to "Codex" while running
printf '\033]0;Codex\007'
bash -lc 'codex "$@"' codex $base_args $args
# Restore terminal title to current directory after codex exits
printf '\033]0;%s\007' (prompt_pwd)
end
function cld
set -l task_id ""
set -l yolo_mode 0
set -l remaining_args
# Parse arguments - extract -t/--task and -y/--yolo before other processing
set -l i 1
while test $i -le (count $argv)
switch $argv[$i]
case -t --task
set i (math $i + 1)
if test $i -le (count $argv)
set task_id $argv[$i]
else
echo "Error: -t/--task requires a task name (e.g., ENG-101)"
return 1
end
case -y --yolo
set yolo_mode 1
case '*'
set -a remaining_args $argv[$i]
end
set i (math $i + 1)
end
# Check for subcommands
set -l primary ""
if test (count $remaining_args) -gt 0
set primary (string lower -- $remaining_args[1])
end
switch $primary
case update
brew upgrade claude-code
return
case vertex
claude-vertex
return
case default
claude-default
return
case status
claude-status
if test -n "$task_id"
echo " Task ID: $task_id"
end
return
end
# Set YOLO mode if requested
# NOTE: Using CLD_YOLO instead of CLAUDE_YOLO because Claude Code
# appears to filter out CLAUDE_* prefixed env vars in hook subprocesses
if test $yolo_mode -eq 1
set -gx CLD_YOLO 1
echo "🀠 YOLO mode enabled (unknown commands auto-approved, hard denials still enforced)"
echo ""
end
# Build claude command
if test -n "$task_id"
# Set task list environment variable for this session
set -lx CLAUDE_CODE_TASK_LIST_ID $task_id
# Check if -r or --resume flag is present
set -l has_resume 0
set -l filtered_args
for arg in $remaining_args
switch $arg
case -r --resume
set has_resume 1
case '*'
set -a filtered_args $arg
end
end
if test $has_resume -eq 1
echo "πŸ”„ Resuming task: $task_id"
echo ""
claude -r $task_id $filtered_args
else
echo "πŸ“‹ Task: $task_id (task list: ~/.claude/tasks/$task_id/)"
echo "πŸ’‘ To resume: cld -t $task_id -r"
echo ""
claude $filtered_args
end
else
claude $remaining_args
end
# Clean up YOLO env var after claude exits
if test $yolo_mode -eq 1
set -e CLD_YOLO
end
end
function oc
set -l primary ""
if test (count $argv) -gt 0
set primary (string lower -- $argv[1])
end
if test "$primary" = "update"
brew upgrade opencode
return
end
# Set terminal title to "Open Code" while running
printf '\033]0;Open Code\007'
opencode $argv
# Restore terminal title to current directory after open-code exits
printf '\033]0;%s\007' (prompt_pwd)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment