Skip to content

Global options and output

These options work on every yofix command. The same page documents the machine-readable output contract that scripts and agents depend on.

Global flags

FlagDescription
--jsonEmit a machine-readable JSON envelope on stdout (see below)
--cwd <dir>Run as if from a different working directory
--team <slug>Override the active team for this command
--project <slug>Override the linked project slug
--token <token>Use this bearer token instead of stored credentials
-y, --yesSkip confirmation prompts (assume yes)
--no-inputFail instead of prompting when input is required
--no-colorDisable ANSI color codes
--debugShow stack traces and verbose error context
--host <url>Override the API host (default https://app.yofix.ai)
--versionPrint the CLI version
--helpShow help for the CLI or a command

Environment variables

VariableEffect
YOFIX_TOKENBearer token used when no --token is passed. Primary auth method in CI.
YOFIX_HOSTAPI host to use when --host is not passed (default https://app.yofix.ai).
NO_COLORStandard convention; disables colored output, same as --no-color.

Files

PathContents
~/.yofix/config.jsonGlobal config and credential fallback (mode 0600)
~/.yofix/cache/Cached metadata
.yofix/project.jsonPer-project link, discovered by walking up from the working directory

JSON envelope

Pass --json and every command prints one of two stable shapes. The schema is a public contract: existing fields never change shape, only new optional fields are added.

A success looks like:

{
"ok": true,
"command": "deploy",
"version": "0.1.6",
"data": { "deploymentId": "dpl_123", "status": "ready", "previewUrl": "https://..." },
"warnings": [],
"elapsedMs": 41280
}

A failure looks like:

{
"ok": false,
"command": "deploy",
"version": "0.1.6",
"error": {
"code": "YF_DEPLOY_BUILD_FAILED",
"message": "Deploy dpl_123 finished with status: failed.",
"hint": "Run `yofix logs dpl_123` to see why.",
"docsUrl": "https://yofix.ai/docs/cli/errors#yf_deploy_build_failed"
},
"exitCode": 10,
"elapsedMs": 38110
}

All human-readable progress goes to stderr, so stdout stays clean for piping into jq or an agent even without --json.

Exit codes

CI scripts can switch on the numeric exit code without parsing output.

CodeMeaningError code
0SuccessYF_OK
2Bad usage or missing inputYF_USAGE, YF_MISSING_INPUT
3Network failure reaching the APIYF_NETWORK
4Authentication required or expiredYF_AUTH_REQUIRED, YF_AUTH_EXPIRED
5Resource already existsYF_CONFLICT
6Resource not foundYF_NOT_FOUND
7Plan limit reachedYF_QUOTA_EXCEEDED
8Server error or timeoutYF_SERVER, YF_TIMEOUT
9Feature not yet availableYF_NOT_IMPLEMENTED
10Build finished with a non-zero statusYF_DEPLOY_BUILD_FAILED
11Directory is not linked to a projectYF_PROJECT_NOT_LINKED
130Interrupted (Ctrl-C)YF_INTERRUPTED

Error codes

Every failure carries a stable YF_* code so you can branch on the cause without string-matching the message. Each code, what causes it, and how to fix it has its own section in the Error reference. Failures also include a docsUrl that deep-links straight to the matching section.

Next