Skip to content

Ship tcode-headless as a Docker image with a compose template for NAS and homelab hosts #811

Closed

Description

@Tryanks

Problem

The headless machine is the natural way to run Tcode on a NAS or homelab server, but it has no container distribution. The install path in docs/remote.md is a manual download, unpack and install of a tarball, and the user then installs each agent CLI by hand. Self-hosted users expect a docker compose up experience; the first question from a NAS user was "is there a Docker repo, or do I have to build it myself?", and the comparison point was an agent product already shipped in the NAS vendor's Docker app store.

The repository has crates/traverse-server/Dockerfile with a TODO that the release workflow does not publish images, and nothing at all for tcode-headless.

Expected behavior

  • Image. A tcode-headless image built from the release binaries (--features web, so the browser app is embedded), published for linux/amd64 and linux/arm64 on every release from .github/workflows/release.yml. The traverse-server TODO is resolved by the same publishing step.
  • Compose template. A commented docker-compose.yml in the repository and the release notes. It must cover:
    • a volume for the data directory, since traverse.json holds the machine key and losing it invalidates every pairing;
    • UDP 47420 for Traverse and TCP 47420 for the browser listener, with --browser-listen 0.0.0.0:47420 and TCODE_PASSWORD set, or network_mode: host as the LAN-friendly alternative;
    • PUID/PGID so files the agents write into mounted project directories are not owned by root;
    • project directories mounted under one documented path.
  • Agent CLIs. A list variable such as TCODE_AGENTS=claude,codex,pi,opencode,cursor,grok selects which CLIs are present. The default is all of them; an empty value is none. The image ships only the headless binary and a Node runtime, as the :slim image this issue first described, and installs the listed CLIs into a cached volume on first start, so disk-constrained NAS hosts do not pay for CLIs they do not use. An installed CLI is reused offline and updates itself as it does outside a container. Any ACP agent command the user supplies must also be reachable.
  • Login inside the container. Each agent's credential directory is persisted on the data volume so logins survive restarts. The documentation has a per-agent table: which login flows work from a Tcode terminal pane inside the container (device code, pasted URL), which need an API key through an environment variable instead, and which rely on a localhost browser callback and therefore cannot complete in a container.
  • Docker socket passthrough (optional). A commented-out /var/run/docker.sock mount lets agents start sibling containers. It is opt-in, labelled as host-root-equivalent, and is not docker-in-docker.

Acceptance criteria

  • docker compose up on an amd64 and an arm64 Linux host starts the machine, prints the invitation, and a phone or desktop can pair with it over Traverse and over the LAN.
  • The browser app is reachable at http://<host>:47420/ and asks for the configured password.
  • Restarting the container keeps the machine id, all pairings, and every agent's login.
  • Setting TCODE_AGENTS to a subset makes only those providers available in the client; an empty list stays usable as a machine with no providers.
  • A file written by an agent into a mounted project directory is owned by PUID:PGID.
  • Every supported provider is documented with its working in-container login method, verified on at least one host.
  • The release workflow publishes the images for both architectures; no manual build step remains.

Out of scope

Per-project sandbox containers spawned by Tcode itself. Socket passthrough is the escape hatch until that is designed separately.

Decisions changed during implementation

  • One image, the :slim design. This issue first had a default image with all six CLIs inside and a :slim image that installs them on first start. Only the second ships. A bundled image freezes the CLIs at the image's release, so it needs pinned versions and a release cycle to update them, and it weighs about 3 GB; installed into the volume, each CLI runs its current release and updates itself, as on a desktop. What is given up: a host with no internet cannot install a CLI on its first start (the machine still starts, and the next start tries again).
  • Versions. Each CLI installs at its current release the first time it is selected; nothing is pinned in the repository.

Activity

  1. added
    enhancement
    on Oct 13, 2026
  2. lcisconl commented on Oct 15, 2026

    @lcisconl
    Contributor

    @Tryanks  私ができるので、これからどうぞ宜しくお願い致します。

  3. added 19 commits that reference this issue on Oct 22, 2026
  4. Tryanks commented on Oct 24, 2026

    @Tryanks
    OwnerAuthor

    Merged in #888 (744fc93). Status against the acceptance criteria:

    • Image, release publishing for amd64 and arm64 with no manual step: published by v0.3.0-rc.1 to rc.3; from Docker images and Compose template (#811); machine groups (#935) #888 on there is one image, which installs the selected CLIs at start (see Decisions changed during implementation above).
    • Browser app at http://<host>:47420/ asks for the password: release smoke check.
    • TCODE_AGENTS subset and empty list: release smoke check.
    • Files written into /projects owned by PUID:PGID: release smoke check.
    • Pairing over Traverse from a container, and from a physical phone: only LAN pairing with the native probe is checked.
    • Restart keeps every agent's login: credential files persist across restarts and UID changes; no real account login was done.
    • Every provider's in-container login method verified on at least one host: documented in docs/docker.md from each CLI's documentation, not yet verified with accounts.

    Left open for the three unchecked items.

  5. Tryanks commented on Oct 24, 2026

    @Tryanks
    OwnerAuthor

    #952 (25ce877) settles where each agent keeps its state: docs/research/agent-persistence.md traces logins, configuration, history and updates for all six CLIs to their docs, source and packages. With only /data persisted they all survive restarts and image upgrades, none uses a keyring on Linux, and only scratch files in /tmp are lost. It also makes Codex, pi and OpenCode updatable from Tcode's provider settings in the container. The login criteria above still need a real account login per agent.

  6. Tryanks commented on Oct 24, 2026

    @Tryanks
    OwnerAuthor

    Fixed by #888 (744fc93) and #952 (25ce877): one image published for amd64 and arm64 on release, compose template, TCODE_AGENTS, PUID/PGID, and agent state persisted under /data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions