-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·34 lines (29 loc) · 982 Bytes
/
Copy pathdocker-entrypoint.sh
File metadata and controls
executable file
·34 lines (29 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
set -euo pipefail
# Copy seed auth files to writable locations so the CLI can refresh expired
# OAuth tokens. Seeds are mounted :ro to avoid race conditions between
# concurrent Claude CLI subprocesses writing to the same host file.
SEED="$HOME/.claude.json.seed"
AUTH="$HOME/.claude.json"
if [[ -f "$SEED" ]]; then
cp "$SEED" "$AUTH"
fi
CREDS_SEED="$HOME/.claude/.credentials.json.seed"
CREDS="$HOME/.claude/.credentials.json"
if [[ -f "$CREDS_SEED" ]]; then
cp "$CREDS_SEED" "$CREDS"
fi
if [[ ! -f "$CREDS" ]]; then
echo "Error: Claude CLI credentials not found." >&2
echo "" >&2
echo "Run on your host machine:" >&2
echo " ./scripts/export-auth.sh" >&2
echo "" >&2
echo "Then retry: docker compose run --rm understudy" >&2
exit 1
fi
if ! ls /app/prompts/*-system.md >/dev/null 2>&1; then
echo "Warning: no character prompts found in /app/prompts/" >&2
echo "Add a <name>-system.md file to the prompts/ directory." >&2
fi
exec "$@"