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.
redmine issues list --project myprojectID TRACKER STATUS PRIORITY SUBJECT123 Bug Open High Fix login timeout124 Feature Open Normal Add dark modeMachine-readable output. Ideal for scripting and piping.
redmine issues list --project myproject -o json[ { "id": 123, "tracker": {"id": 1, "name": "Bug"}, "status": {"id": 1, "name": "Open"}, "priority":{"id": 2, "name": "High"}, "subject": "Fix login timeout" }]Comma-separated values for spreadsheets and data analysis.
redmine issues list --project myproject -o csvID,Tracker,Status,Priority,Subject123,Bug,Open,High,Fix login timeout124,Feature,Open,Normal,Add dark modeWorking with JSON
Section titled “Working with JSON”JSON output pairs well with jq for ad-hoc analysis:
# IDs of all open bugsredmine issues list --tracker Bug -o json | jq '.[].id'
# Count issues by statusredmine issues list --project myproject -o json \ | jq 'group_by(.status.name) | map({status: .[0].status.name, count: length})'JSON output shapes
Section titled “JSON output shapes”-o json produces two top-level shapes on stdout:
-
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. -
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"}oktells you whether the command changed state. Commands that complete successfully but have nothing to change may return the same envelope withok: falseand a descriptivemessage.The
actionvocabulary is small and intentional:created,updated,deleted,closed,reopened,assigned,commented,logged,user_added,user_removed,logged_in,logged_out,switched,installed,opened.
JSON error envelope
Section titled “JSON error envelope”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.
stdout vs stderr
Section titled “stdout vs stderr”- 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.
Default format
Section titled “Default format”Set a default in your config file:
output_format: tableThe -o flag always overrides the default for a single command.