Goober Swarm » Docs » Development Edit on GitHub

Development

Repository layout

PathContents
orchestrator/main.pyFastAPI app: web UI, HTTP API, MCP server, terminal websocket
orchestrator/agents.pythe Goober roster and how each CLI is run (terminals, sessions, auth, health)
orchestrator/protocol.pythe swarm: queues, leads, subtasks, UCP-1, on/off, demos, conversations
orchestrator/db.pySQLite persistence
orchestrator/git_fs.pysandboxed workspace file access and git
orchestrator/browser.py, shot.js@SHOT / @FETCH: the VM's headless Chrome via puppeteer-core
orchestrator/static/index.htmlthe web app (single file, no build step)
scripts/provision.sheverything installed into the base image
packer/Packer template and cloud-init
scripts/appimage/, scripts/build_appimage.shthe AppImage launcher and its build
.github/workflows/appimage.ymlbuilds the AppImage and publishes it as the only release
docs-src/prose for these docs (the reference parts are read from the code)
docs-src/the hand-written parts of these docs

Hot reload

The host's orchestrator/ folder is mounted into the VM; the service runs uvicorn with --reload (polling, because 9p mounts don't deliver file events). Save a file on the host and the orchestrator restarts within a few seconds. Running tasks carry on by themselves, but the turn that was running is redone, so save in batches while the swarm is busy.

Logs: ssh -p 2222 aiuser@127.0.0.1 journalctl -u ai-orchestrator -f

Adding a Goober

  1. Install its CLI in scripts/provision.sh (and in the running VM).
  2. Add an AgentConfig to ROSTER in orchestrator/agents.py. {prompt} and {model} in commands are substituted.
  3. Optionally add it to LEAD_ORDER in orchestrator/protocol.py.
  4. Regenerate the docs.

AgentConfig fields:

FieldTypeDefaultMeaning
namestrrequired
providerstrrequired
cmdList[str]required"{prompt}" and "{model}" are substituted
auth_cmdList[str]required
talentsstrrequired
modelstr''default model; override per agent with <NAME>_MODEL in .env
auth_hintstr''
max_turnsint16
session_cmdOptional[List[str]]NoneLong-lived stream-json process: one conversation across all swarm turns (resumed with `resume_flag <id>`)
tui_cmdOptional[List[str]]Noneinteractive UI on the same conversation
resume_flagstr'-r'
auth_groupstr''agents sharing one login: verifying after auth covers the whole group
oc_sessionboolFalseopencode: keep one session per agent (`run --format json -s <id>`)
requires_envstr''e.g. OPENROUTER_API_KEY: not routable until that key is saved
logs_promptsboolFalsestealth/eval model: provider logs prompts; don't send secrets
auto_answersList[Tuple[str, str]]field(default_factory=list)(prompt text, reply) pairs answered automatically in interactive sessions, e.g. keychain fallbacks
image_argsList[str]field(default_factory=list)Empty: the image path goes into the prompt text and the agent opens it with its own viewer, if it can.

The AppImage

scripts/build_appimage.sh packs the git-tracked scripts (no VM images) with a launcher (scripts/appimage/AppRun) into dist/GooberSwarm-x86_64.AppImage. It downloads appimagetool into .tools/ the first time. The launcher copies the scripts to ~/.local/share/goober-swarm, runs ./vm.sh deps and ./vm.sh build in a terminal window when needed, starts the VM with GOOBER_HEADLESS=1 ./vm.sh up, opens the app in Chrome/Chromium --app mode with its own profile (falling back to the default browser), and stops the VM when that window closes. --down stops the VM, --dir prints the data folder.

Releasing: push a tag (git tag v2.1.0 && git push origin v2.1.0) or run the AppImage release workflow by hand. It builds the AppImage, publishes it, and deletes every older release, so releases/latest/download/GooberSwarm-x86_64.AppImage always points at the newest one.

Regenerating these docs

The website lives in its own repo, goober-swarm.github.io, served from its docs/ folder: the landing page (docs/index.html) is written by hand there; these docs (docs/docs/) and the landing page's Goober gallery are generated from this repo's code and docs-src/. The site repo regenerates them by itself every 30 minutes and on demand (its .github/workflows/docs.yml: Actions → docs → Run workflow). To do it by hand:

git clone https://github.com/goober-swarm/goober-swarm.github.io ../goober-swarm.github.io
python3 scripts/gen_docs.py          # write the site's docs/docs/ and gallery
python3 scripts/gen_docs.py --check  # fail if they're out of date

GOOBER_SITE=/path/to/site/docs points it elsewhere. The generator uses only the Python standard library. Reference sections (roster, API, MCP tools, tags, limits, commands, ports, keys) are read from the code; prose comes from docs-src/*.md.