Skip to main content

Commands, JSON, and Exit Codes

This page is a lookup table. For task-oriented deployment, return to the five-minute quick start, Profiles and Manifests, or Backup, History, Verify, and Restore.

Global options

Place global options before the command and subcommand:

OptionPurpose
--data-dir <path>Select the complete Profile root, not config/
--jsonEmit one schema v1 JSON envelope on stdout; progress and logs go to Profile logs or stderr
--no-networkDisable KnotLink and cloud post-processing; it does not delete local History or archives
--non-interactiveDisable interactive behavior for automation
--log-level <off|info|debug>Set the log level
--helpShow CLI usage
--versionShow the CLI version

Profile commands

profile init --output <manifest.json> [--force]
profile validate --file <manifest.json>
profile diff --file <manifest.json> [--prune]
profile apply --file <manifest.json> [--dry-run] [--prune --confirm-prune]
profile export --output <manifest.json> [--force]

The first-setup sequence is always:

profile validate
→ profile diff
→ profile apply --dry-run
→ profile apply
→ doctor

Profile runtime and diagnostics

serve
serve status
serve stop
doctor

serve is an optional long-running Profile runtime. doctor checks configuration, paths, world occupancy, cold-restore state, tools, and the operating environment.

Query commands

config list
config show --config <ConfigId>
world list --config <ConfigId>
history list --config <ConfigId> --world <relative-path>
job list
job show --job <JobId>

Configs, Jobs, Stages, and Steps use canonical UUIDs from the Manifest. The World argument is the relative path from the Config.

Execution commands

job run --job <JobId>
backup --config <ConfigId> --world <relative-path> [--comment <text>]
verify --config <ConfigId> --world <relative-path> (--backup <file> | --latest)
restore --config <ConfigId> --world <relative-path> \
(--backup <file> | --latest) [--mode clean|overwrite] \
(--dry-run | --confirm)

restore requires exactly one of --dry-run or --confirm. Initial setup uses only --dry-run; confirm the cold-restore gate before any real restore.

JSON envelope

With --json, stdout contains one schema v1 envelope. Logs and progress go to the Profile logs/ directory or stderr:

{
"schemaVersion": 1,
"command": "backup",
"ok": true,
"code": "success",
"data": {},
"diagnostics": []
}

For diagnosis, preserve the JSON, stderr, exit code, and Profile logs. Do not keep only a screenshot of the last terminal line.

Exit codes

The table below follows the current CLI implementation and the main repository’s docs/headless-cli.md:

Exit codecodeMeaning
0success / no_changesSucceeded, or there was nothing to change
2invalid_argumentsInvalid arguments or missing explicit confirmation
3profile_busyThe GUI, Serve, or another CLI owns the Profile
4target_not_foundA Config, World, Job, or archive was not found
5migration_required / invalid_profileMigration is required, or schema/reference/path configuration is invalid
6backup_failed / job_failed / verification_failedBackup, Job, or verification failed
7restore_failedRestore failed
8tool_unavailable7-Zip or rclone is unavailable
9cancelledThe operation was cancelled
10partial_successA Job was partially successful, or local backup succeeded while cloud post-processing failed

The exit code is the machine-readable automation contract, but diagnosis still requires the envelope’s diagnostics, stderr, and doctor.

Engineering references

The user tutorial explains why and what to do next. These main-repository documents define the detailed protocol and implementation boundaries:

When this site’s tutorial differs from raw CLI output, follow the current CLI output, exit code, and main-repository implementation.