Oko/Docs

Command reference

oko autonomy mode

Chooses what Oko may do on its own on this host, under the limits the operator states. It is the one verb for the choice: enable, disable and their --mode spelling are gone.

Invocation#

Command
oko autonomy mode MODE [--max-runs-per-day N] [--max-runtime-seconds S] [--retry-backoff-seconds S] [--state-dir PATH]

Inputs and options#

  • MODE is required, one of three: disabled (no new objective execution; every stored limit and the history are kept), experimental (local user, repository writes and commands) or full (organization goals and reversible deployments). Neither enabled mode allows purchases or irreversible external actions.
  • --max-runs-per-day (accepted runs a day, above zero), --max-runtime-seconds (how long one run may take, above zero) and --retry-backoff-seconds (the wait after a failed run, zero or more) have no presets. One left out keeps the value the stored policy holds; enabling with no stored policy needs every one.
  • --state-dir selects an isolated policy/state directory; the default is ~/.oko/autonomy.
  • Oko Desktop's Automation screen (Autonomy on this Mac) and Oko iOS's Automation screen (Autonomy on selected host, through Stado's autonomy-set route, which runs this verb) take the same three limits beside the mode; an empty field keeps the stored value.

Output and state effect#

  • Writes the autonomy policy and prints it as JSON.

Refusals and safe exits#

  • Without a mode: “oko autonomy mode requires <id>”; any other word: “oko autonomy mode takes disabled, experimental or full; got <word>”.
  • Disabling with no stored policy: “no autonomy policy is stored at <path>; autonomy is off until `oko autonomy mode experimental|full …` stores one”.
  • A limit neither given nor stored: “enabling autonomy needs --max-runs-per-day: no stored policy holds one, and Oko chooses none” (the same for the other two flags).
  • A limit that is not a whole number: “--max-runtime-seconds "<value>" is not a whole number: …”; out of range: “invalid autonomy policy: maxRuntimeSeconds must be positive”, “maxRunsPerDay must be positive”, “retryBackoffSeconds cannot be negative”.
  • Policy/store read or write failures name the file and the error.

CLI reference#