--- sidebar_position: 5 --- # Output and scripting Scripts should read JSON: the text output is meant for people and may change. ```bash gt pr view 123 --json number,title,state gt issue list --json number,title --jq '.[] | "\(.number)\t\(.title)"' ``` `--json` prints all fields or the ones you list; the **JSON FIELDS** section of a command's `--help` names them. `--jq` filters the result without needing jq installed. Piped lists print as tab-separated values. gt exits with 0 on success, 1 when a command fails, 2 on a usage error and 4 when authentication is missing or rejected; `gt help exit-codes` lists all codes. `gt api` calls any API endpoint with gt's login, and `gt alias set` defines shortcuts for commands you use often.