Skip to content

Output Formats

Every command accepts -o / --output to control the output format. The flag is registered globally, so read, write, delete, and every other subcommand honour it uniformly. Pick the one that matches what you’re doing: reading, scripting, or exporting.

Default format, optimised for human reading.

Terminal window
redmine issues list --project myproject
ID TRACKER STATUS PRIORITY SUBJECT
123 Bug Open High Fix login timeout
124 Feature Open Normal Add dark mode
jq friendly

JSON output pairs well with jq for ad-hoc analysis:

Terminal window
# IDs of all open bugs
redmine issues list --tracker Bug -o json | jq '.[].id'
# Count issues by status
redmine issues list --project myproject -o json \
| jq 'group_by(.status.name) | map({status: .[0].status.name, count: length})'

-o json produces two top-level shapes on stdout:

  1. Raw resources for commands that fetch or return data (issues list, issues get, project create, …). The payload is the resource object (or array of objects) exactly as the API returned it.

  2. Action envelope for mutators that have no natural response body (issues close, issues delete, issues assign, wiki delete, memberships delete, …). The envelope is stable and minimal:

    {
    "ok": true,
    "action": "deleted",
    "resource": "project",
    "id": "demo",
    "message": "Project \"demo\" deleted"
    }

    ok tells you whether the command changed state. Commands that complete successfully but have nothing to change may return the same envelope with ok: false and a descriptive message.

    The action vocabulary is small and intentional: created, updated, deleted, closed, reopened, assigned, commented, logged, user_added, user_removed, logged_in, logged_out, switched, installed, opened.

When -o json is active and a command fails, the CLI writes a structured error envelope to stdout and exits non-zero:

{
"error": {
"message": "Resource not found.",
"code": "not_found"
}
}

code comes from a small stable set: not_found, auth_failed, forbidden, validation_failed, server_error, unknown. Validation errors include a details array with the individual field messages from Redmine.

  • Machine-readable output (JSON, CSV, table rows) always goes to stdout.
  • Human-oriented messages (success confirmations in non-JSON mode, warnings, progress spinners, update-check hints) always go to stderr.

This split is stable — scripts can safely redirect stdout to a file or pipe it into jq without worrying about interleaved status noise.

Set a default in your config file:

~/.redmine-cli.yaml
output_format: table

The -o flag always overrides the default for a single command.