mirror of
https://github.com/tiennm99/ai-coding-workflow-labs.git
synced 2026-09-18 22:22:31 +00:00
Move all PowerShell functions to ~/Documents/PowerShell/alias.ps1 and source it from $PROFILE, keeping the profile clean and aliases easy to manage independently.
1.6 KiB
1.6 KiB
My Claude Code Aliases
Aliases File: ~\Documents\PowerShell\alias.ps1
Keep all Claude aliases in a dedicated file, sourced from $PROFILE.
~\Documents\PowerShell\alias.ps1
function zclaude {
$env:ANTHROPIC_AUTH_TOKEN="your-api-key"
$env:ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
$env:API_TIMEOUT_MS="3000000"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL="GLM-5"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL="GLM-5"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL="GLM-5"
claude
}
# Skip permission prompts
function x { claude --dangerously-skip-permissions }
# Fast Haiku model
function h { claude --model claude-haiku-4-5-20251001 }
# Load diagrams from current project
function cdi {
$diagrams = Get-Content .ai\diagrams\*.md -Raw -ErrorAction SilentlyContinue
if ($diagrams) { claude --append-system-prompt $diagrams } else { claude }
}
How to Install
-
Create the aliases file (Claude will write this for you, or paste manually):
New-Item -Path "$HOME\Documents\PowerShell\alias.ps1" -ItemType File -Force -
Add one line to your
$PROFILEto source it:. "$HOME\Documents\PowerShell\alias.ps1"Open profile with:
notepad $PROFILE -
Reload your profile:
. $PROFILE -
Test it - type
zclaudein any PowerShell window.
Notes
- Environment variables set inside functions are scoped to the current session only.
- Edit
alias.ps1anytime to add new aliases - no need to touch$PROFILEagain. - You can version control
alias.ps1separately from your profile.