Download start.sh from kacapower/opencode: direct link, hf CLI and curl.
- Browser
- Download file 888 Bytes
-
https://huggingface.co/spaces/kacapower/opencode/resolve/main/start.sh
- Command line
-
hf download hf://spaces/kacapower/opencode/start.sh
-
curl -L -o start.sh https://huggingface.co/spaces/kacapower/opencode/resolve/main/start.sh
888 Bytes
| set -uo pipefail | |
| cd /home/node || exit 1 | |
| export OPENCODE_SERVER_USERNAME="opencode" | |
| export OPENCODE_SERVER_PASSWORD="loopback_internal_pass_777" | |
| echo "[start] hydrating from bucket" | |
| python3 /home/node/sync.py --pull || echo "[start] pull failed - starting with local files" | |
| echo "[start] launching sync daemon" | |
| python3 /home/node/sync.py & | |
| SYNC_PID=$! | |
| cleanup() { | |
| echo "[start] shutting down" | |
| kill -TERM "$SYNC_PID" 2>/dev/null | |
| wait "$SYNC_PID" 2>/dev/null | |
| kill "${OC_PID:-}" "${WEB_PID:-}" 2>/dev/null | |
| exit 0 | |
| } | |
| trap cleanup TERM INT | |
| echo "[start] launching opencode (loopback only)" | |
| opencode web --port 4096 --hostname 127.0.0.1 & | |
| OC_PID=$! | |
| echo "[start] launching shell on :7860" | |
| uvicorn app:app --host 0.0.0.0 --port 7860 --proxy-headers --no-server-header & | |
| WEB_PID=$! | |
| wait -n "$OC_PID" "$WEB_PID" | |
| echo "[start] a service exited - shutting down" | |
| cleanup | |