Spaces:
Sleeping
Sleeping
Commit History
-
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
-
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