Output format
All commands return a consistent JSON envelope when you use -o json:
{
"command": "jira workitem query",
"request": { "site": "example", "jql": "..." },
"data": {
"edges": [
{
"node": {
"key": "PROJ-123",
"summary": "Fix login bug",
"status": { "name": "In Progress" },
"webUrl": "https://example.atlassian.net/browse/PROJ-123"
}
}
]
}
}
Read the response
- Lists — access items via
data.edges[].node - Single items — access the result directly via
data - Fields are flat — use
.summary,.status.name,.webUrl, not.fields.summary
Process JSON output
# Pipe to jq
twg jira workitem query --jql "project = PROJ" -o json | \
jq '.data.edges[].node | {key, summary, status: .status.name}'
# Write large results to a file
twg work query --scope me --since 30d --output-file /tmp/work.json
Use agent mode
When called by an agent, append --mode agent. This produces quieter output and strips the hints and warnings keys from the JSON envelope so the agent receives a smaller, cleaner payload:
twg work query --scope me --since 7d --mode agent
The standard envelope includes:
{
"command": "...",
"request": { ... },
"data": { ... },
"hints": ["..."],
"warnings": ["..."]
}
With --mode agent, hints and warnings are omitted:
{
"command": "...",
"request": { ... },
"data": { ... }
}
For large result sets, pair --mode agent with --output-file to write JSON to a file and avoid stdout size limits. The CLI prints stdout=<path> to stdout so the agent knows where to read the result:
twg work query --scope me --since 30d --mode agent --output-file /tmp/work.json
# stdout: stdout=/tmp/work.json