Spaces:
Sleeping
Sleeping
File size: 497 Bytes
e2feace 05c76c0 0e0683f e2feace |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#!/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 "$@" |