Susan

susan

All setups

susan talks to the dashboard (the nexus-dashboard service; see the glossary) over its HTTP API. It submits a run (one execution of a workflow, a YAML file of steps that an AI agent follows) and attaches it to an item (a unit of work of the dashboard, on which the run posts its questions), lists runs, reads the state of one run, follows it until it ends, cancels it, totals the tokens a project used per model, and checks the stack of a folder before any commit. The dashboard passes reads, follow-ups, cancellations and stack dry runs on to the operator (the nexus-operator service that starts runs and holds their queue): susan never reaches the operator directly. It works the same way in the workstation and homelab setups.

The source is in cmd/susan/ of the repository. From a clone, go build ./cmd/susan builds the binary.

Human-readable output and error messages are written in French. JSON output uses stable English keys and codes, in snake_case (item_created, queue_position).

Synopsis

susan submit --project P --workflow W [--item I] [--input name=value]...
susan list [--project P] [--state S]
susan get RUN
susan watch RUN
susan cancel RUN
susan usage --project P [--since 24h|DATE] [--until DATE]
susan stack check --project P [--dir D]
susan solo login [--endpoint URL] [--project NAME]
susan help | --help | -h

Every command accepts --output text (default) or --output json. Options can come before or after the run identifier: susan get RUN --output json and susan get --output json RUN are equivalent.

CommandDashboard route
submitPOST /api/runs
listGET /api/operator/v1/runs
getGET /api/operator/v1/runs/{id}
watchGET /api/operator/v1/runs/{id}/events
cancelPOST /api/operator/v1/runs/{id}/cancel
usageGET /api/operator/v1/usage
stack checkPOST /api/operator/v1/stacks/check
solo loginnone: the command reads the token through Docker

The /api/operator/v1/... routes form the relay: the dashboard passes them on to the operator and returns its answer as is.

Connection to the dashboard

KeyVariableKey of susan/config.json
Address of the dashboardSUSAN_ENDPOINTendpoint
Client tokenSUSAN_TOKENtoken

The client token is the token susan presents to the dashboard, as Authorization: Bearer <token> on every request. It is distinct from the API token of the operator, which only the dashboard holds.

The address is an https:// URL with a host name. http:// is accepted only on the loopback (localhost, 127.0.0.0/8, ::1). An address with a user name, a password, a query string or a fragment ends the command with config_invalid. A path is kept: with https://dashboard.example.test/base, requests go to https://dashboard.example.test/base/api/....

susan honours the HTTPS_PROXY, HTTP_PROXY and NO_PROXY variables. It waits 30 seconds at most for the headers of a response and sets no overall timeout, so watch can follow a long run.

Client token on the cluster

On a homelab cluster, the client token is the token key of the nexus-dashboard-client-token Secret, in the namespace of the release. nexusctl, the kubectl wrapper for the cluster, reads it:

nexusctl get secret nexus-dashboard-client-token -n <namespace of the release> -o jsonpath='{.data.token}' | base64 -d

Put the value in SUSAN_TOKEN, or in the token key of a susan/config.json with mode 0600, with the address of the dashboard Ingress in SUSAN_ENDPOINT or the endpoint key.

solo login

susan solo login [--endpoint URL] [--project NAME]

Writes the configuration of susan for the Solo edition, the dashboard and operator that Docker Compose runs on your workstation (the workstation setup). The command reads the client token in the dashboard container of the Compose project, without sending a request to the dashboard and without reading a Compose file: it works from any directory.

OptionDefaultDescription
--endpoint URLhttp://127.0.0.1:8090Address of the dashboard written to the configuration. A port changed at install time (SUSAN_PORT) goes here.
--project NAMEsusanCompose project of the Solo edition. The development stack of the repository (compose.yaml) is named nexus-local.
--output text|jsontextOutput format.
  1. docker ps looks for a running container of the dashboard service in the Compose project.
  2. docker exec <id> cat /keys/client-token reads the client token in that container.
  3. The command creates susan/config.json in the user configuration directory: directory with mode 0700, temporary file with mode 0600 in that directory, then a rename. An existing config.json is replaced as a whole.

The text output says where the configuration is written. With --output json, it reads {"login": {"endpoint": "...", "config": "<path>"}}. The token never appears in the output.

susan solo login --project nexus-local

submit

susan submit --project P --workflow W [--item I] [--input name=value]...
OptionRequiredDescription
--project PYesProject of the run (a set of repositories and runs; see the glossary).
--workflow WYesName of the workflow to run.
--item INoItem to attach the run to.
--input name=valueNoInput of the workflow. Repeat the option for each input. A name given twice ends the command with usage.
--output text|jsonNoOutput format.

Sends a single POST /api/runs to the dashboard, with the project, the workflow, the inputs, the item of --item and the name of the system user (requester, which the dashboard records as the creator of the item without authenticating it). Without --item, the dashboard finds the item of the project that carries the change of the change input, or creates one; without a change input, each run creates its own item.

The output shows the run as the operator knows it after the request, then a line Item : <item>, followed by (créé) when the dashboard has just created the item. A run of a project at its limit is in state queued, with its position in the queue. With --output json, the output reads {"run": {...}, "item": "<item>", "item_created": true|false}. The output lists input names, never their values.

susan submit --project my-app --workflow factory/ask --input change=release

list

susan list [--project P] [--state S]
OptionDescription
--project PLists the runs of one project only.
--state SLists the runs in one state: queued, starting, running, completed, failed, cancelled or lost.
--output text|jsonOutput format.

The text output has one line per run: identifier, state, project, workflow. A queued run shows (position N), a finished run its exit code. Without any run, the output is Aucun run. The JSON output is an object {"runs": [...]}, with an empty list when no run matches.

susan list --project my-app --state running

get

susan get RUN

Prints the state of one run: the same line as list, then its token usage (total, then input, output and cache when the source gives the breakdown). With --output json, prints the run object: id, project, workflow, state, queue_position, exit_code, inputs (names only), created_at, started_at, finished_at and usage (total and breakdown). Dates are in RFC 3339, in UTC.

susan get 7f3c2a --output json

watch

susan watch RUN

Follows the events of a run and prints one line per event until the run reaches a terminal state: completed, failed, cancelled or lost. A text line holds the date in UTC, the run identifier, the state, the current step when there is one, and the exit code when there is one. With --output json, each event is a JSON object on its own line (NDJSON) with the keys at, run_id, state, step and exit_code.

Run ends asExit code
completed0
failed, cancelled or lost1, with no further message: the last event already gives the state

If the event stream breaks before a terminal state (proxy, Traefik read timeout on the cluster, restart of the dashboard), or if you interrupt the command with Ctrl+C, susan exits with code 2 and the unreachable error, or operator_unreachable when the dashboard answered with that code. The run keeps going on the operator: run susan watch RUN again to resume following it.

susan watch 7f3c2a && echo "run completed"

cancel

susan cancel RUN

Cancels a queued or running run and prints the run as the operator knows it after the request. Cancelling a run that has already ended exits with code 2 and the code run_terminal.

susan cancel 7f3c2a

usage

susan usage --project P [--since 24h|DATE] [--until DATE]
OptionRequiredDescription
--project PYesProject to total.
--sinceNoStart of the period: an RFC 3339 date (2026-10-14T09:00:00Z) or a Go duration (24h, 90m) counted back from --until, or from now when --until is absent.
--untilNoEnd of the period, an RFC 3339 date.
--output text|jsonNoOutput format.

Without --since and --until, susan sends no bounds and the operator applies its own period. The text output starts with the project and the period, then gives one line per model: model, number of runs, tokens. When the source gives a total only, the breakdown reads répartition inconnue in text and "unknown" in JSON; susan does not compute a breakdown of its own.

susan usage --project my-app --since 24h --output json

stack check

susan stack check --project P [--dir D]
OptionRequiredDescription
--project PYesProject whose rules the operator applies.
--dir DNoFolder of the project, by default the current folder.
--output text|jsonNoOutput format.

Runs a dry run of the stack (the Compose services started next to the agent): through the relay of the dashboard, the operator converts it with the converter of its engine and checks the work image, without creating a run or storing anything. susan reads the runtime section of D/.awf/factory.json, then the files of runtime.files and runtime.include. A name that leaves the folder (.., absolute path) or a symbolic link to the outside exits with the code stack_config_invalid, without reading the file. An invalid local stack fails before susan reads its configuration or contacts the dashboard.

The text output starts with Stack acceptée or Stack refusée, then the line Vérifié sur le dossier local ; le run lira le commit de la forge., then one line per finding: severity, service (- for a finding that targets no service), feature and reason, separated by two spaces, then the detail in parentheses when there is one.

Stack refusée
Vérifié sur le dossier local ; le run lira le commit de la forge.
error  worker  privileged  privileged mode is not granted to the pod; remove it from the stack
warning  api  ports.published  the port is not published outside the pod; reach it by the name of the service, inside the pod  (8080:80)

With --output json, the output is a stack_check object, {"verdict": "accepted"|"refused", "warnings": [...]}, equal to the answer of the operator, without the reminder line; warnings is [] without findings. Each finding has severity (warning or error), feature, reason, and service and detail when they apply.

VerdictExit code
accepted0
refused (at least one error finding)1

A rejected request (project_unknown, input_invalid, stack_invalid, stack_unsupported) exits with code 2. The message comes from susan, never from the operator: for stack_invalid without detail, it says that Compose cannot load the files of the stack and gives the docker compose -f <file> config command, with one -f per Compose file of the stack, to run in the folder to see the error.

The dry run reads the working copy, while a run reads the commit on the forge. It checks neither the agent credentials of the project nor the images of the services: an accepted stack can still fail when you request a run.

susan stack check --project my-app --dir ../my-app

Client token rotation

The client token is shared by every workstation. Anyone who reads it (file of susan, keys volume of the Solo edition, nexus-dashboard-client-token Secret) can start, read and cancel runs through the relay. To replace it on the Solo edition, in its directory (by default ~/.susan):

  1. docker compose run --rm --no-deps keys 'rm -f /keys/client-token' deletes the file from the keys volume.
  2. docker compose up -d runs the keys service again, which creates the file anew.
  3. docker compose restart dashboard makes the dashboard read the token again.
  4. Run susan solo login on every workstation.

On a homelab cluster:

  1. Delete the nexus-dashboard-client-token Secret.
  2. Upgrade the release with nexushelm upgrade: the chart draws a new token.
  3. Restart the dashboard.
  4. Hand out the new token, read as in Client token on the cluster.

Dashboard routes without a token

The client token protects only POST /api/runs and the relay. The routes that the web interface of the dashboard calls stay unauthenticated, POST /api/items and POST /api/items/{id}/runs included: a host that reaches the dashboard can create an item and start a run through these routes without a token. The Solo edition listens on 127.0.0.1 only; on the cluster, the dashboard Ingress is reachable from the homelab network only.

Errors

A failed command writes to standard error. In text, it writes two lines: what happened, then what to do. With --output json, it writes one JSON line, {"error": {"code": "...", "title": "...", "hint": "..."}}. --output json applies to errors as well, including a wrong command line. No error contains a stack trace, an input value or the token.

All these errors end the command with exit code 2.

codeCase
usageUnknown command or option, missing argument, missing required option, wrong --output, --since or --until value.
config_missingNo address, or an address without a token.
config_invalidsusan/config.json that cannot be read or is not JSON; an address that is not a valid URL; user configuration directory not found (neither XDG_CONFIG_HOME nor HOME).
config_insecureThe token in use comes from susan/config.json, which the group or others can access.
insecure_endpointhttp:// address outside the loopback.
unreachableThe dashboard does not answer, sends an answer susan cannot read, or the watch stream breaks.
operator_unreachableThe dashboard answers, but the operator behind it does not.
unauthorizedClient token missing or rejected by the dashboard.
operator_unauthorizedThe operator rejects the API token of the dashboard.
project_unknownThe operator does not serve this project.
input_invalidThe workflow rejected an input.
run_unknownNo run has this identifier.
run_terminalCancellation of a run that has already ended.
item_unknownThe item of --item does not exist.
item_ambiguousSeveral items of the project carry the change of the command; the message lists them.
item_mismatchThe item of --item belongs to another project or carries another change than the command.
run_not_startedThe operator did not start the run, or the started run could not be attached to its item.
solo_docker_missingThe docker command is not found.
solo_not_runningNo dashboard container of the named Compose project is running.
solo_token_missingThe keys volume of the Solo edition has no client token.
stack_invalidstack check: the operator rejects the files of the stack, or Compose cannot load them.
stack_unsupportedstack check: the operator behind the dashboard does not run stacks.
stack_config_invalidstack check: .awf/factory.json missing or not JSON, runtime section missing, work image without Compose files, folder or file that cannot be read, listed file missing, name or symbolic link that leaves the folder. The dashboard is not contacted.

Exit codes

CodeMeaning
0The command succeeded. For watch, the run ended as completed. For stack check, the stack is accepted. For get, list and cancel, whatever the state shown. help also exits with 0.
1watch: the run ended as failed, cancelled or lost. stack check: the stack is refused.
2Invalid input, dashboard missing or unreachable, or rejected request: every error of the previous section.
3Reserved for a run waiting for an answer; no command returns it.
4Reserved for a run still in progress; no command returns it.

These values stay stable from one version to the next.

Files and environment variables

NameRole
SUSAN_ENDPOINTAddress of the dashboard. Takes precedence over the configuration file.
SUSAN_TOKENClient token of the dashboard. Takes precedence over the configuration file.
$XDG_CONFIG_HOME/susan/config.jsonConfiguration file, keys endpoint and token, mode 0600. By default ~/.config/susan/config.json; susan solo login writes it.
HTTPS_PROXY, HTTP_PROXY, NO_PROXYHTTP proxy used to reach the dashboard.