19 lines
569 B
Bash
Executable file
19 lines
569 B
Bash
Executable file
#!/bin/bash
|
|
# Wrapper that sets ANTHROPIC_API_KEY from OpenClaw's auth config
|
|
export ANTHROPIC_API_KEY=$(python3 -c "
|
|
import json
|
|
with open('/home/openclaw/.openclaw/agents/main/agent/auth-profiles.json') as f:
|
|
data = json.load(f)
|
|
for key, profile in data.get('profiles', {}).items():
|
|
if 'anthropic' in key:
|
|
print(profile.get('token', ''))
|
|
break
|
|
" 2>/dev/null)
|
|
|
|
if [ -z "$ANTHROPIC_API_KEY" ]; then
|
|
echo "Error: Could not extract Anthropic API key from auth-profiles.json"
|
|
exit 1
|
|
fi
|
|
|
|
export PATH=$PATH:/usr/local/go/bin
|
|
exec claude "$@"
|