Skip to main content
BB

Bahrul Bangsawan

AvailableMakassar, Indonesia
BB

Bahrul Bangsawan

Growth Hacker at the intersection of Data, Marketing, and Tech. Helping brands scale with data-driven strategies and modern technology.

Available for HireMakassar, Indonesia 🇮🇩
Book a Call

Blog · Guides

Unlock Your Terminal Superpowers with macOS Aliases

A step-by-step guide to creating and using terminal aliases on macOS to streamline your command-line workflow with Claude CLI and other tools.

Terminal Aliases3 min read
Share
On this page

Unlock Your Terminal Superpowers with macOS Aliases

Imagine typing a single word and having your terminal run a whole symphony of commands — that’s the magic of aliases. On macOS, aliases let you turn long, repetitive commands into lightning-fast shortcuts. Whether you’re a developer juggling multiple AI backends or just someone who hates typing --dangerously-skip-permissions over and over, this guide will turn you into a terminal wizard. Let’s dive in and supercharge your workflow.

What You’ll Need Before You Start

Think of these as your toolbelt. Grab them now, and you’ll be set for life.

  • Homebrew – The missing package manager for macOS. Install it from brew.sh.
  • Zsh – Already your default shell if you’re on macOS Catalina or later (you’re golden).
  • Claude CLI – Anthropic’s command-line powerhouse. Install it with a single curl command.

Installing Homebrew and Claude CLI

Fire up your terminal and paste these commands. It’s like unlocking a treasure chest.

# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Claude CLI (native – recommended)
curl -fsSL https://claude.ai/install.sh | bash

# Alternative install methods
brew install --cask claude-code
bun add -g @anthropic-ai/claude-code

Understanding Shell Configuration Files

On macOS with Zsh, aliases live in two special places:

  • ~/.zshrc – Your main Zsh config file. This is where the magic happens.
  • ~/.zsh_aliases – A dedicated file for aliases (optional, but keeps things tidy).

Pro tip: Always backup before editing. One command, zero regrets.

cp ~/.zshrc ~/.zshrc.backup

Setting Up Your Aliases – Step by Step

  1. Open Your Zsh Configuration
    Use your favorite editor: nano ~/.zshrc, code ~/.zshrc, or zed ~/.zshrc.
  2. Drop in Your Aliases
    Paste the block below at the end of the file. Replace YOUR_API_KEY with your actual key from Z.AI or MiniMax (and never, ever commit it to Git).
  3. Apply the Changes
    Save the file, then run source ~/.zshrc or open a fresh terminal window.
  4. Verify Your Work
    Type alias to see all your shortcuts, or which claude-skip to check one.

Here’s the alias block that will turn your terminal into a multitool:

# Claude CLI Aliases
# ------------------
alias zai='ANTHROPIC_API_KEY="YOUR_API_KEY" \
  ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic" \
  API_TIMEOUT_MS="" \
  ANTHROPIC_MODEL="glm-4.7" \
  ANTHROPIC_SMALL_FAST_MODEL="glm-" \
  ANTHROPIC_DEFAULT_HAIKU_MODEL="glm-4.6" \
  ANTHROPIC_DEFAULT_SONNET_MODEL="glm-4.7" \
  ANTHROPIC_DEFAULT_OPUS_MODEL="glm-" \
  claude --dangerously-skip-permissions'

alias minimax='ANTHROPIC_API_KEY="YOUR_API_KEY" \
  ANTHROPIC_BASE_URL="https://api.minimax.io/anthropic" \
  API_TIMEOUT_MS="" \
  ANTHROPIC_MODEL="MiniMax-M" \
  ANTHROPIC_SMALL_FAST_MODEL="MiniMax-M2.1" \
  ANTHROPIC_DEFAULT_OPUS_MODEL="MiniMax-M2.1" \
  ANTHROPIC_DEFAULT_SONNET_MODEL="MiniMax-M" \
  ANTHROPIC_DEFAULT_HAIKU_MODEL="MiniMax-M2.1" \
  claude --dangerously-skip-permissions'

alias claude-skip='claude --dangerously-skip-permissions'

# Editor Shortcuts
# ----------------
alias edit-alias='zed ~/.zshrc'
alias edit-claude='zed ~/.claude.json'
alias edit-claude-skills='zed ~/.claude/skills/'
alias edit-claude-agents='zed ~/.claude/agents/'
alias edit-claude-commands='zed ~/.claude/commands/'
alias edit-claude-plugins='zed ~/.claude/plugins'
alias edit-sh='zed ~/.zsh_functions/'

Your terminal, now a powerhouse of shortcuts.

Putting Your Aliases to Work

Here are a few ways you’ll love using them:

  • Claude Skip: Run claude-skip to skip permission prompts and get straight to work.
  • Z.AI Backend: Type zai to use the Z.AI API – instant AI superpowers.
  • MiniMax Backend: Type minimax to switch to MiniMax’s models.

Editor Aliases Quick Reference

Alias – What it opens
AliasOpens
edit-alias~/.zshrc
edit-claude~/.claude.json
edit-claude-skills~/.claude/skills/
edit-claude-agents~/.claude/agents/
edit-claude-commands~/.claude/commands/
edit-claude-plugins~/.claude/plugins
edit-sh~/.zsh_functions/

Troubleshooting – When Aliases Go Rogue

Alias not found after adding?

You probably need to reload your shell. Run source ~/.zshrc or just open a new terminal window – that’s the “did you turn it off and on again?” of the Unix world.

“command not found: claude”

Make sure Claude CLI is installed globally. Run bun add -g @anthropic-ai/claude-code and verify with which claude.

API authentication errors?

Double-check your API key: is it correct, active, and properly quoted? No extra spaces around the = signs. And please, never paste a real key into a public file – use environment variables for production.

The Big Picture – How It All Fits Together

flowchart TD
    A[Start] --> B[Install Homebrew & Claude CLI]
    B --> C[Configure ~/.zshrc]
    C --> D[Add alias definitions]
    D --> E[source ~/.zshrc]
    E --> F{Verify?}
    F -->|Yes| G[Use aliases like a boss]
    F -->|No| H[Check errors or re-source]
    H --> C

That’s it. You’ve just turbocharged your Mac. Every time you type a short alias instead of a monstrosity of environment variables and flags, you’ll feel a little spark of joy. Now go forth and alias everything.