Runtime contract

This page defines the current public output contract for deskctl.

It is intentionally scoped to the current Linux X11 runtime surface. It does not promise stability for future Wayland or window-manager-specific features.

Stable top-level envelope

Every command supports --json and uses the same top-level envelope:

{
  "success": true,
  "data": {},
  "error": null
}

Stable top-level fields:

If success is false, the command exits non-zero in both text mode and JSON mode.

Stable window payload

Whenever a response includes a window payload, these fields are stable:

window_id is the public session-scoped identifier for programmatic targeting. ref_id is a short-lived convenience handle from the current ref map.

Stable grouped reads

deskctl get active-window

deskctl get monitors

Stable per-monitor fields:

deskctl get version

deskctl get systeminfo

Stable waits

deskctl wait window deskctl wait focus

Stable selector-driven action fields

When selector-driven actions return resolved window data, these fields are stable when present:

This applies to:

Stable artifact fields

For snapshot and screenshot:

When a command also returns windows, data.windows uses the stable window payload documented above.

Stable structured error kinds

When a command fails with structured JSON data, these error kinds are stable:

Stable structured failure fields include:

Best-effort fields

These values are useful but environment-dependent and should not be treated as strict parsing guarantees:

Text mode expectations

Text mode is intended to stay compact and follow-up-useful.

The exact whitespace and alignment are not stable. The stable behavioral expectations are:

If you need strict parsing, use --json.