Skip to content

Reference

Everything it answers to.

14 commands and 8 tools, generated from the programs themselves rather than written down, so this page cannot describe one that does not exist.

The CLI

dayshift hands the broker a job from a shell, a script or a Makefile. Build it with make -C dayshift-cli-cpp install; global options --url and --json go before or after the command.

Jobs

dayshift submit [--runner R] [--workdir DIR] [--label L]... [--model M] [--effort E] [--tool T]... [--timeout S] [--wait] PROMPT|-
hand the broker a job; --wait prints the answer (prompt from an argument, -, or a pipe)
dayshift get ID
one job, with its prompt and its answer or error
dayshift wait ID [--timeout S]
wait for a job to finish and print its answer
dayshift jobs [--status S] [--service S] [--runner R] [--limit N]
list jobs, newest first
dayshift chat CONVERSATION [PROMPT|-] [--wait]
show a conversation, or add a turn to it
dayshift cancel ID
cancel a job that has not started
dayshift rm ID
delete a finished job

Broker

dayshift status
dispatch, gates, queue depth and failing runners
dayshift runners
configured runners and their health
dayshift hosts
connected hosts: labels, runners' health there, slots, memory, load, gate
dayshift watch
print a line whenever a job changes (long-poll)
dayshift suspend
pause dispatch for every caller (operator token)
dayshift resume
resume dispatch (operator token)

About

dayshift version
print the CLI's version

Exit codes

So a script can tell a failed job from a broker that is down from one that said no, because each has a different fix.

0
ok
1
the job failed or was canceled
2
usage
3
nothing answered at DAYSHIFT_URL, or what answered is not dayshift
4
broker refused

Environment

The environment wins; ~/.dayshift/config supplies defaults for a shell that set nothing.

DAYSHIFT_URL
the broker (default http://127.0.0.1:14080, or the /api vhost in front of it)
DAYSHIFT_TOKEN
bearer token: an operator token, or your own caller token
DAYSHIFT_RUNNER
runner for submit when --runner is not given (default claude)
DAYSHIFT_CONFIG
config file of KEY=VALUE defaults (default ~/.dayshift/config)
DAYSHIFT_CA
CA certificate to verify an https:// broker against (default: the system store)
DAYSHIFT_ALLOW_PLAINTEXT
set to 1 to send the token over plain http:// to a remote broker anyway

The MCP server

The MCP server gives an agent the broker as tools, over stdio. It offers five tools that only read. The three that start or change work exist only when DAYSHIFT_MCP_ALLOW_WRITES=1 is set. Pausing dispatch is never a tool, because that stops every caller.

Always available

dayshift_get_conversation

A conversation's turns, oldest first, each with its prompt and answer. Every job opens a conversation; its conversation_id is on the job.

  • conversation_id string, required
  • max_chars integer — Longest answer to return inline (default 20000); a longer one is cut and says so

dayshift_get_job

One job: status, prompt, and its answer (when done) or its error (when failed). An error says whose fault it was — the job's own limits, or the runner being broken — which decides whether a retry can help.

  • id string, required — A job id, e.g. job-20260921T153012Z-17
  • max_chars integer — Longest answer to return inline (default 20000); a longer one is cut and says so

dayshift_list_jobs

Jobs, newest first, as summaries (id, status, runner, service, a prompt excerpt). Use dayshift_get_job for one job's full answer. A caller token sees only its own jobs; an operator token sees all.

  • status queued | running | done | error | canceled
  • service string — Only jobs submitted under this service label
  • runner string
  • host string — Only jobs that ran on this host; dayshift_status lists them
  • limit integer — How many (default 20)

dayshift_status

The broker's state: whether dispatch is open, suspended or held by a resource gate (and why), how many jobs are running and queued, and each runner's health. Check this before submitting if work seems stuck.

dayshift_wait

Wait for a job to finish, up to timeout_seconds, then return it as dayshift_get_job would. If it is still going when the time is up, you get its current state with still_running: true — call again to keep waiting. The job itself is never affected by giving up.

  • id string, required
  • timeout_seconds integer — How long to wait (default 120)
  • max_chars integer — Longest answer to return inline (default 20000); a longer one is cut and says so

With writes allowed

dayshift_cancel_job

writes

Cancel a job that has not started yet. A running job cannot be canceled from here.

  • id string, required

dayshift_reply

writes

Add a turn to a conversation. The runner resumes the same session, so it remembers the earlier turns. One turn at a time: while the previous turn is still running the broker refuses (turn_in_flight).

  • conversation_id string, required
  • prompt string, required
  • model string
  • effort string

dayshift_submit_job

writes

Hand the broker a job: an agent CLI run with this prompt, queued behind the broker's resource limits. Returns at once with the job id and conversation id — it does NOT wait. Use dayshift_wait for the answer. workdir is a path on the machine that RUNS the job, not yours: by default the broker's host; with labels, whichever connected host has them (e.g. ["home-src"] for the workstation's ~/src). A job no connected host can take waits, and says why.

  • prompt string, required
  • runner string — Runner id (default claude); dayshift_status lists them
  • workdir string — Directory on the broker's host to run in
  • model string — Only for a runner that accepts_model; otherwise the broker refuses
  • effort string — Only for a runner that accepts_effort
  • allowed_tools string[] — Override the runner's default tool allowlist
  • timeout_seconds integer
  • labels string[] — Labels the host must have; dayshift_status lists each agent's labels