JSON Envelope Format
In JSON mode, stdout carries exactly one JSON object. Every progress line goes to stderr.Success envelope
boolean
true on success, false on error.object
Verb-specific result data. Always present on success; present on an error only
when the verb has something to report (for example, findings).
object
Error details (
code, message, hint). Present only on error — a success
envelope has no error key.Error envelope
string
Stable error code (e.g.,
"validation", "forbidden", "auth_required").
Machine-readable; branch on this.string
Human-readable error message.
string
Imperative next action. Always present and never empty.
Error: <message> and Hint: <hint> to stderr.
Toolchain update notice
validate, dev, publish, and status check (24h cache, 1.5s timeout) whether a newer @ekanos/cli exists. When this CLI is not current, data carries an optional toolchain field:
"behind"— A newer version is available"unsupported"— Your version is below the host’s declared minimum (makespublishfail with exit 9)
EKANOS_NO_UPDATE_CHECK=1.
Exit Code Taxonomy
This is a frozen public contract. Exit codes never change meaning once shipped; new conditions get new numbers.Codes outside the taxonomy
Three verbs pass a child process’s exit code straight through, with their ownerror.code:
Branching on exit codes
- 0 — Proceed
- 1 — A CLI bug; report it with the
--jsonenvelope - 2 — Fix the command (spelling, required arguments,
--host) - 3 — Fix the definition or resolve the ambiguity the hint names
- 4 — Run
ekanos loginand retry - 5 — Check
ekanos sourcesfor the seats you hold - 6 — Check the path or slug the message names
- 7 — Resolve the state the hint names (for a duplicate version, bump
versioninpackage.json) - 8 — Retry with backoff; do not log in again
- 9 — Install or fix what the hint names
- 10 — Fix the findings in
data.findings, then publish again
Command-specific exit codes
Not every verb emits every code:init: 0, 1, 2, 7validate: 0, 1, 2, 3, 6, 9dev: 0, 1, 2, 6, 7, 9, or Next’s exit codetest: 6 or 9 if the project can’t be loaded; otherwise the runner’s exit codelogin: 0, 1, 2, 4, 8, 9logout: 0, 1, 2, 9whoami: 0, 1, 2, 4, 8, 9sources: 0, 1, 2, 4, 8, 9use: 0, 1, 2, 4, 5, 6, 8, 9status: 0 whenever the report is assembled; host errors still map through the taxonomy. With--watch: 0 ongated/dev, 10 onrejected, 4 without a session, 9 without a project or sourcepublish: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10upgrade: 0, 1, 2, 3, 6, 8, 9, or the test script’s exit code
Detailed error codes
auth_required (exit 4)
Returned by whoami, sources, use, publish, and status --watch when no session exists or it cannot be renewed, and by login when the code expires or the request is denied in the browser. Plain status reports authenticated: false instead of failing.
What to do: Run ekanos login (with --host if you have multiple deployments).
forbidden (exit 5)
Returned by:
publishwhen you lack a seat on the target sourceusewhen the slug doesn’t name a source you hold a seat on
ekanos sources to see what you have access to. The hint always lists your actual seats.
precondition_failed (exit 9)
Returned by:
validate,publishwhen the project resolves a newer@ekanos/integration-schemathan the CLI bundlesvalidate,dev,test,use,publish, andupgradewhenpackage.jsondoes not declare"type": "module", or whenekanos.jsonis not valid JSON or fails its schemadevwhen a required package is missing,@ekanos/harnessdeclares no version, or the CLI and harness shell contracts don’t matchpublishwhen the host has declared this CLI version unsupportedstatus --watchwhen there is no project or nosource
validation (exit 3)
Returned by:
validatewhen error-severity findings are presentpublishwhen no source is given, the target is ambiguous without--yes, the confirm is declined, the archive exceeds 4 MiB, or the host rejects the submission as invalidupgradewhen run non-interactively without--yes, or when the confirm is declined
validate, see data.findings[]. Each finding has:
check— The rule that produced it (e.g.,"definition.schema","project.slug-agreement","collision.widget-id")severity—"error","warn", or"info"message— The problemhint— How to fix itfile,line— Where, when known
ekanos validate again.
gate_failed (exit 10)
Returned by:
publishwhen the local findings pass has error-severity findings (the same findingsvalidatereports, plus escalatedproject.host-compiler-rules). Nothing is uploadedstatus --watchwhen the host’s gate rejects the submitted version
data.findings.
What to do: Fix the findings, bump the version if it was already submitted, and publish again. Use ekanos status --findings to see a rejected version’s findings.