Add Claude Code usage notes for sub-agent workflow
This commit is contained in:
parent
a6afccf123
commit
e769311db4
5 changed files with 59 additions and 18 deletions
|
|
@ -1,19 +1,10 @@
|
|||
#!/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)
|
||||
#!/usr/bin/env bash
|
||||
# Claude Code CLI wrapper
|
||||
# Usage: claude-code "task description" [working-dir]
|
||||
set -euo pipefail
|
||||
|
||||
if [ -z "$ANTHROPIC_API_KEY" ]; then
|
||||
echo "Error: Could not extract Anthropic API key from auth-profiles.json"
|
||||
exit 1
|
||||
fi
|
||||
TASK="${1:?Usage: claude-code <task> [working-dir]}"
|
||||
WORKDIR="${2:-$(pwd)}"
|
||||
|
||||
export PATH=$PATH:/usr/local/go/bin
|
||||
exec claude "$@"
|
||||
cd "$WORKDIR"
|
||||
exec claude -p "$TASK" --allowedTools "Edit,Write,Bash"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue