Skip to content

Scriptability

Make choices that ensure that creating automations or scripts with GitHub commands is obvious and frictionless. Practically, this means:

  • Create flags for anything interactive
  • Ensure flags have clear language and defaults
  • Consider what should be different for terminal vs machine output

In terminal

An example of gh pr list

Through pipe

An example of gh pr list piped through the cat command

Differences to note in machine output

  • No color or styling
  • State is explicitly written, not implied from color
  • Tabs between columns instead of table layout, since cut uses tabs as a delimiter
  • No truncation
  • Exact date format
  • No header