Skip to main content

Documentation Index

Fetch the complete documentation index at: https://www.octoparse.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

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

JSON output

Use --json when you need one stable JSON response.
octoparse task list --json
octoparse auth status --json
octoparse local status <taskId> --json
Successful commands return a JSON envelope with ok: true and a data field. For example, octoparse task list --json may return:
{
  "ok": true,
  "data": {
    "items": [
      {
        "taskId": "abc123",
        "taskName": "Example task",
        "status": "Idle"
      }
    ],
    "page": 1,
    "pageSize": 20,
    "total": 1
  }
}
Failed commands return a JSON envelope with ok: false and an error field. A typical error response includes a code and message:
{
  "ok": false,
  "error": {
    "code": "AUTH_REQUIRED",
    "message": "API key is required for this command."
  }
}
The exact data structure depends on the command. Use the command-specific output as the source of truth when writing scripts.

JSONL event streams

Use --jsonl for long-running local run events.
octoparse run <taskId> --jsonl
JSONL output streams one JSON object per line. This is useful for agents, scripts, and log processors that need to consume run progress incrementally. A typical stream may look like:
{"type":"run.started","taskId":"abc123","timestamp":"2026-01-01T10:00:00.000Z"}
{"type":"row.saved","taskId":"abc123","count":1}
{"type":"run.completed","taskId":"abc123","savedRows":1}
Event names and fields may change between versions. Treat each line as one JSON object and handle unknown fields safely.

stdout and stderr

In human mode:
StreamPurpose
stdoutRequested data or command output
stderrDiagnostics, warnings, and failures
In --json and --jsonl mode, structured output is written to stdout. Errors are still written to stderr as plain text or returned as a JSON error envelope, depending on the command and failure type. This separation helps automation tools pipe requested output without mixing it with diagnostic logs.

Exit codes

Exit codeMeaningTypical triggers
0SuccessCommand completed as requested
1Operation failedAuthentication failure, task not found, export error
2Runtime or environment failureNode.js version mismatch, Chrome not available, engine initialization failure
3Unsupported task definitionTask uses kernel browser or legacy workflow not supported by CLI v1
A non-zero exit code means the command did not complete as requested.

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 in logs.
For AI agents and automation environments, prefer --json or --jsonl over human-readable output.