Skip to main content
Octoparse CLI supports human-readable output for terminal use and machine-readable output for automation. Use this page when calling Octoparse CLI from scripts, agents, CI jobs, or other automation environments.

JSON output

Use --json when you need one stable JSON response.
Successful commands return a JSON envelope with ok: true and a data field:
Failed commands return ok: false with an error field containing a code and message:
The exact data structure depends on the command. Common error codes include AUTH_REQUIRED, AUTH_INVALID, TASK_INVALID, LINUX_ARM64_UNSUPPORTED, ENGINE_RUN_FAILED, and UNSUPPORTED_EXPORT_FORMAT. Run octoparse capabilities --json to see the full list.

JSONL event streams

Use --jsonl for long-running local extractions. Output streams one JSON object per line:
A typical stream:
Stable event types:
Event names and fields may evolve between versions. Treat each line as a self-contained JSON object and handle unknown fields safely.

Detached run artifacts

When you run with --detach, the CLI writes bootstrap files to the output directory: Local run artifact files (in the run directory):

stdout and stderr

This separation lets automation tools pipe requested output without mixing in diagnostic logs.

Exit codes

A non-zero exit code means the command did not complete as expected.

Automation recommendations

  • Use --json for scripts that need a single structured response.
  • Use --jsonl for long-running task execution.
  • Treat non-zero exit codes as failed automation steps.
  • Capture stderr separately when debugging.
  • Do not expose API keys or tokens in logs or CI output.
  • Run octoparse capabilities --json at the start of an agent workflow to discover the current command surface and machine contract.
For AI agents and automation environments, prefer --json or --jsonl over human-readable output. Start with octoparse capabilities --json to get the full machine contract.