Skip to content

Commit ff8c5a9

Browse files
committed
chore: clarify startup env validation
1 parent a5061b1 commit ff8c5a9

1 file changed

Lines changed: 28 additions & 4 deletions

File tree

server/start.sh

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@ ENV_EXAMPLE=apps/backend/.env.example
8383
if [ ! -f "$ENV_FILE" ]; then
8484
if [ -f "$ENV_EXAMPLE" ]; then
8585
cp "$ENV_EXAMPLE" "$ENV_FILE"
86-
warn ".env was created from .env.example. Please edit it and add your API keys:"
86+
warn ".env was created from .env.example. Please edit it and add the required model configuration:"
8787
warn " File: $ENV_FILE"
88-
warn " CLAUDE_API_KEY, VLM_API_KEY, ANTHROPIC_API_KEY"
88+
warn " Required: CLAUDE_API_KEY, CLAUDE_MODEL, CLAUDE_SMALL_MODEL, VLM_API_KEY, VLM_MODEL"
89+
warn " Optional: CLAUDE_BASE_URL, VLM_BASE_URL for OpenAI-compatible gateways"
90+
warn " Optional: ANTHROPIC_API_KEY only for Creator Agent SDK features"
8991
warn "Run this script again after editing the file."
9092
exit 0
9193
else
@@ -95,8 +97,30 @@ fi
9597

9698
set -a; source "$ENV_FILE" 2>/dev/null || true; set +a
9799

98-
if [ -z "$CLAUDE_API_KEY" ]; then
99-
warn "CLAUDE_API_KEY is not set. Please edit .env."
100+
REQUIRED_MODEL_VARS=(
101+
CLAUDE_API_KEY
102+
CLAUDE_MODEL
103+
CLAUDE_SMALL_MODEL
104+
VLM_API_KEY
105+
VLM_MODEL
106+
)
107+
108+
MISSING_MODEL_VARS=()
109+
for var_name in "${REQUIRED_MODEL_VARS[@]}"; do
110+
if [ -z "${!var_name}" ]; then
111+
MISSING_MODEL_VARS+=("$var_name")
112+
fi
113+
done
114+
115+
if [ "${#MISSING_MODEL_VARS[@]}" -gt 0 ]; then
116+
warn "Missing required model configuration in $ENV_FILE:"
117+
for var_name in "${MISSING_MODEL_VARS[@]}"; do
118+
warn " $var_name"
119+
done
120+
warn "Fill these values and run ./start.sh again."
121+
warn "If text and vision use the same provider, fill both CLAUDE_* and VLM_* explicitly."
122+
warn "ANTHROPIC_API_KEY is optional unless you use Creator Agent SDK features."
123+
exit 1
100124
fi
101125

102126
info ".env loaded"

0 commit comments

Comments
 (0)