Development
Layout
Section titled “Layout”server/ Bun + Elysia backend src/index.ts app, auth guard, static files src/cli.ts `hermithub` executable: serve, set-password, disable-2fa, doctor, version src/agents.ts agent registry (install, login, launch) + /api/agents src/sessions.ts project sessions (tmux) + /api/sessions src/tasks.ts system tasks: installs and logins in tmux + /api/tasks src/worktrees.ts git worktrees per project (parallel tasks) + /api/projects/:project/worktrees src/integrations.ts GitHub, git identity, SSH key src/terminal.ts WebSocket ⇄ tmux attach bridge src/tmux.ts tmux helpers (dedicated socket "hermithub") src/auth.ts setup token, password login, cookies, origin check src/files.ts, git.ts, search.ts, projects.ts, paths.tsweb/ React 19 + Vite frontend (Eden Treaty client typed from the server)docker/ entrypoint (PUID/PGID remap) and shell profileDockerfile multi-stage: deps → build → runtimescripts/ build-binaries.ts: standalone executables → dist/install.sh installer: standalone executable (default) or Dockersite/ website: landing page + docs (Astro Starlight, Cloudflare Pages)Sessions are tmux sessions on a private socket. Metadata (project, worktree, mode, label, task) is stored as tmux
user options (@hub_*), so the server can restart without losing track of running sessions.
Run locally
Section titled “Run locally”With Bun and tmux installed:
bun installbun run build # frontend → web/dist (or `bun run dev:web` for Vite with HMR)DATA_DIR=.data PROJECTS_DIR=$PWD/.data/projects bun run dev:serverThe setup link is printed on start. Bun reads .env from the working directory automatically.
Without Bun on the host, ./bunx.sh runs it in the oven/bun image:
./bunx.sh bun install./bunx.sh bun test server./bunx.sh bun run buildBuild and run the image
Section titled “Build and run the image”docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d --buildBuild the standalone executable
Section titled “Build the standalone executable”bun run build:bin --host # this platform only → dist/hermithub-<os>-<arch>bun run build:bin # every release target (Linux x64/arm64 glibc and musl, macOS x64/arm64)bun run build:bin linux-arm64 # specific targetsIt builds the frontend and compiles server/src/cli.ts with bun build --compile. A generated entry point embeds
every web/dist file (server/src/web-embed.ts), so the executable needs nothing next to it. web/dist on disk
(or WEB_DIST) still takes priority when it exists. Test the install script against a local build with
HERMITHUB_DOWNLOAD_URL=file://$PWD/dist bash install.sh.
Checks
Section titled “Checks”bun run typecheckbun test serverCI runs both, builds the frontend and the image, and smoke-tests a standalone executable. Tagging vX.Y.Z publishes a
multi-arch image to GHCR and attaches the executables plus SHA256SUMS to the GitHub release.
Agent skill
Section titled “Agent skill”skills/hermithub/SKILL.md documents the installer for AI agents. When installer flags, .env options or
operating commands change, update it (and references/troubleshooting.md), then check it with
claude plugin validate --strict ..
Website
Section titled “Website”site/ is the website (landing page and docs), built with Astro Starlight and deployed to Cloudflare Pages at
https://hermithub.pages.dev. The docs pages are generated from docs/*.md on every build
(site/scripts/sync-docs.ts), so edit the files in docs/, not the generated copies. Links between docs files
(installation.md) become site links, and links outside docs/ point to GitHub.
cd sitebun installbun run dev # http://localhost:4321bun run build # → site/dist, fails on broken internal linksThe landing page is site/src/content/docs/index.mdx. Screenshots in site/src/assets/screenshots are taken from
a throwaway instance with demo projects, never from real data.
The Website workflow builds the site on pull requests that touch docs/ or site/, and deploys it on pushes to
main. One-time setup:
- In Cloudflare: Workers & Pages → Create → Pages → Direct Upload, name the project
hermithub. - Create an API token with the Cloudflare Pages: Edit permission and note your account ID.
- Add them as repository secrets
CLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_ID.
To deploy by hand: bun run build && bunx wrangler pages deploy dist --project-name=hermithub.
Releasing
Section titled “Releasing”- Update
CHANGELOG.mdand theversioninpackage.json. git tag v0.2.0 && git push --tags.