opencode-v1 / entrypoint.sh
z90486091
updated
05c76c0
raw
history blame contribute delete
497 Bytes
#!/bin/sh
# Set authentication from HuggingFace secret
if [ -n "$HF_OPENCODE_PASSWORD" ]; then
export OPENCODE_SERVER_PASSWORD="$HF_OPENCODE_PASSWORD"
fi
# Priority 1: Use local opencode.json file in root directory
if [ -f "/opencode.json" ]; then
sed "s/{env:LITELLM_API_KEY}/$LITELLM_API_KEY/g" /opencode.json > /tmp/opencode-processed.json
export OPENCODE_CONFIG="/tmp/opencode-processed.json"
fi
# Execute opencode with passed arguments
exec opencode "$@"