Skip to content

Structured Output

Automatic JSON

When stdout is not a TTY (piped or called by an agent), td outputs structured JSON automatically:

# Human in terminal sees a pretty table
td ls

# Agent piping output gets JSON
td ls | jq '.data[].content'

Three Output Modes

Force a specific format with flags:

td ls --json     # JSON even in TTY
td ls --plain    # Tab-separated, no color — for cut/awk

Or set a default:

export TD_FORMAT="json"

Response Format

All JSON responses follow the same envelope:

{
  "ok": true,
  "type": "task_list",
  "data": [...]
}

The type field identifies the response kind: task_list, task, success, project_list, etc.