Spaces:
Running
Running
Commit History
-
Run as a GitHub Codespace
A third home for the same image, alongside Hugging Face Spaces and Railway, and the only one that needs no account the user does not already have. A dev container starts with its entrypoint overridden, so the image's ENTRYPOINT never runs and the server has to be started explicitly. That happens in postStartCommand rather than postCreateCommand because codespaces stop after 30 minutes idle: only postStartCommand runs again on resume, which is what makes this behave like a server instead of a dev box to be restarted by hand. The port is declared public in portsAttributes because there is no REST endpoint for port visibility — a client that provisions codespaces cannot otherwise expose anything without a human toggling it in the UI. Public is only safe here because entrypoint.sh refuses to start without OPENCODE_SERVER_PASSWORD; every route on this server runs shell commands, so a missing password has to fail loudly rather than publish an open shell. State goes under /workspaces rathe…930c3ef
-
Let the agent manage Hugging Face repos when HF_TOKEN is set
Installs the official hf CLI (in a venv, since Debian's Python is externally-managed) and, at boot, drops agents/hf-spaces.md in as opencode's global AGENTS.md — the config-dir path applies to every session regardless of which directory is open, so the guidance does not depend on a workspace file that an ephemeral container would lose. With no HF_TOKEN present the file is removed instead, so the instructions never advertise access the container does not have. The doc leads with "never print the token" because session transcripts are shareable, and it draws the line at creating repos: deleting, renaming or changing visibility needs the user's confirmation first. Image grows ~134MB for python3 plus the CLI. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>e1f9a64 -
Sync the HF Space from CI on every push to main
Builds the image on a runner, boots it, and asserts the three things that matter — it exits nonzero without OPENCODE_SERVER_PASSWORD, answers /api/health with basic auth, and serves the web UI on / — before pushing anything. A Dockerfile that only breaks on the Space would otherwise leave it parked in BUILD_ERROR with no signal here. The push is forced because GitHub is the source of truth; a hand-edit in the Space's web UI should not be able to block a deploy. The HF username is derived from the token via whoami rather than stored, which also turns a bad token into a clear error instead of an opaque git failure. Finally the job polls the Space until it reports RUNNING so a red check means a broken deploy, not just a failed push. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>e85a4d4
-
Add deployable opencode server image for HF Spaces and Railway
One Dockerfile serving both hosts. entrypoint.sh resolves the port at runtime ($PORT on Railway, 7860 to match app_port on HF Spaces), detects a writable /data mount and points the XDG dirs and workspace at it so sessions, provider logins and code survive restarts, and refuses to start without OPENCODE_SERVER_PASSWORD — every route on this server allows shell execution, so basic auth is not optional on a public URL. opencode is installed at build time rather than on first boot, since a free Space's filesystem is ephemeral and would otherwise re-download the release on every cold start. The installer hardcodes $HOME/.opencode/bin and ignores OPENCODE_INSTALL_DIR, so the binary is moved onto the shared PATH afterwards. The node images already ship a uid-1000 user, which is what HF Spaces requires, so `node` is reused instead of adding a colliding one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>5bd2d41