cmdcenter is a lightweight Go orchestrator where a central controller enforces deterministic workflow order and agents only execute commands and report events.
- v1. HTTP POST /poll and /event from agent to controller. Single session only.
-
Allow only one active session.
-
Outbound-only agents.
-
Agents use HTTP long-polling transport (
POST /poll, held up to 15s). -
Experiment sequences and commands are called steps defined in rules file.
-
Run agent with
-1to exit after session becomes terminal. -
Start test session when designated agent sends
POST /eventwithkind=init. -
initis accepted only when all agents declared inagents:are online. -
Rule file must contain exactly one
action: initstep, first and dependency-free. -
Agent process stays alive after session completion by default.
-
On graceful agent shutdown (for example
SIGTERM), agent sendskind=agent_exit.
See rules/demo.yaml.
Supported actions:
init: required exactly once, first step, single agent, no command/handle.start: requireshandleandcommand.program. Non-blocking.wait: requireshandleandforinany_started|success|failed|stopped|any.stop: requireshandle.exit: optional cleanup command.
Agent events reporting:
kind=handle_updateterminal status reports command completion.kind=step_finishedreports step completion.kind=agent_exitreports agent exit.
- Agents register while controller is idle.
- Initiator agent sends
kind=initevent withvars(experiment parameters). - Controller creates one active session only if all required agents are online, then schedules steps deterministically.
- When all steps reach terminal (
successorfailed), session closes. - New experiment requires a new
kind=initevent.
If any agent calls /register while session is active, controller returns 409 Conflict.
go build -o central ./cmd/controller
go build -o agent ./cmd/agentMost Termux phones are arm64, and the agent builds cleanly with pure Go:
GOOS=android GOARCH=arm64 CGO_ENABLED=0 go build -o agent-android ./cmd/agentOn the Termux device:
chmod +x agent-android
./agent-android -id=server -central=http://<controller-ip>:8443 -run_name=demo -token=server_secret -initNotes:
GOARCH=arm64is the recommended target for modern Android devices.GOARCH=arm(32-bit) requires cgo/external linking toolchain and will not build withCGO_ENABLED=0.
./central -rule=rules/demo.yaml -listen=:8443./agent -id=server -central=http://127.0.0.1:8443 -run_name=demo -token=server_secret -init -payload="port=5201,run_id=run-001"./agent -id=client -central=http://127.0.0.1:8443 -run_name=demo -token=client_secretStart another experiment later by sending another init event (or restart initiator with -init again when controller is idle).
POST /register: register agent identity while idle.POST /poll: fetch next command (noopwhen idle/no command).POST /event: reportinit,step_finished,handle_update,agent_exit.GET /session: inspect active session, or last terminal session snapshot.
When init is sent before all required agents are online, controller returns 409 with:
{
"status": "not_ready",
"message": "required agents offline",
"missing_agents": ["client"]
}