Skip to main content
Use this page when the CLI needs to run predictably without interactive prompts.

What this is

The CLI supports non-interactive journey creation, machine-readable JSON output, bounded standard input, and stable exit-code categories. Use these modes for scripts, CI-like tasks, and coding-agent workflows.

Non-interactive init

Non-interactive custory init requires:
  • --workspace <name|slug|id>
  • --journey <recommended|title>
  • one source: --website <url>, --brief <file>, or --stdin
Example:
Without the required flags, the CLI exits with invalid input.

JSON output

Use --json when another process will read the result:
With --json, the command writes one JSON document to stdout. Progress and diagnostics go to stderr. That separation lets scripts parse stdout without losing useful human diagnostics.

Stable top-level fields

Successful init --json output includes stable top-level fields like:
The example uses fictional IDs. Do not build scripts that depend on exact counts or names unless your input controls them. Treat schemaVersion, status, sessionId, workspace, journey, personaIds, warnings, and verifiedAt as the stable top-level contract for successful init output. Custory may add fields over time. Automation should ignore unknown fields. Error output uses this envelope:
Error messages are user-safe and token-redacted. Scripts should branch on error.code first, then use retryable to decide whether retrying is reasonable.

Standard input rules

Use --stdin for text input from another command:
For init, standard input is bounded UTF-8 text. Very large input is rejected with INPUT_TOO_LARGE. For direct tool calls, --stdin must contain a JSON object.

Input limits

All text input must be valid UTF-8.

Exit codes

Safe retries

If a create run is interrupted, prefer:
If the session expired or no unfinished setup exists, start a new run and check Custory for an existing journey before creating another one.

Run a bounded Custory agent task

Use custory agent run when you want Custory’s agent to work inside a workspace or journey scope. Workspace-scoped example:
Journey-scoped example:
custory agent run requires a goal through --goal, --file, or --stdin, and requires either --workspace or --journey.

Next step

Read Command reference for the exact command contracts.