Created
August 9, 2026 16:45
-
-
Save akaak/a0e1d7836a577fb55bdbcf2bd8a8a1fe to your computer and use it in GitHub Desktop.
zshrc for claude-openrouter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cc-or() { | |
| local key_file="$HOME/.openrouter.env" | |
| if [[ ! -f "$key_file" ]]; then | |
| echo "cc-or: $key_file not found." >&2 | |
| return 1 | |
| fi | |
| ( | |
| source "$key_file" | |
| export ANTHROPIC_BASE_URL="https://openrouter.ai/api" | |
| export ANTHROPIC_API_KEY="$OPENROUTER_API_KEY" | |
| export ANTHROPIC_AUTH_TOKEN="" | |
| export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 | |
| export CLAUDE_CONFIG_DIR="$HOME/.claude-or" | |
| export ANTHROPIC_MODEL="z-ai/glm-4.6" | |
| command claude "$@" | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment