Skip to main content

Output and Pagination

Every command prints JSON to stdout, errors included. Add --pretty to indent the output, and --debug to log the underlying HTTP calls to stderr.

Keep output small​

--fields name,state keeps only those fields:

gameflow servers list --game-id GAME_ID --all --fields name,state,address
gameflow usage summary --fields summary,billingUsage
  • Lists: applies to each item. The rest of the envelope, such as nextCursor, is kept, and an empty list stays empty ({"servers":[]}).
  • Results with several blocks: name the blocks you want, as in the usage summary example.
  • Errors: never trimmed.

Pagination​

Every list command that pages takes the same flags and reports the next page the same way:

  • --limit sets the page size, and --cursor continues from a previous page.
  • With --limit or --cursor, the output includes hasMore and, when there is another page, nextCursor. Pass nextCursor back as --cursor.
  • --all follows every page and returns everything. It works on servers list, builds list, games list, events list and models leaderboard.

Without any of these flags a list command makes one request and prints what the API returns by default, with no hasMore.

CommandWithout flagsAlso takes
servers listAll servers.--search, --sort (latest, oldest, name or status). --limit is at most 50.
builds listThe first 15 builds.
games listThe first 10 games.
events listThe API's default page.--from, --to, --user-id.
models leaderboardThe API's default page.--period-id.
servers eventsThe API's default page.

Treat nextCursor as an opaque value and pass it back unchanged:

gameflow servers list --game-id GAME_ID --limit 50
gameflow servers list --game-id GAME_ID --limit 50 --cursor NEXT_CURSOR
gameflow games list --limit 25 --cursor NEXT_CURSOR

Older flags​

  • --page-size, --page-token, --page and --offset still work, but they are hidden from --help.
  • builds list also still prints nextPageToken, which is the same value as nextCursor.
  • Use a standard flag or its older name, not both. Together they are a usage error.

Reading values​

The CLI prints what the API returns and does not convert it:

  • 64-bit integers are JSON strings ("creditRemainingCents":"517"), while smaller numbers are real numbers. Convert before doing arithmetic.
  • Timestamps are epoch seconds as strings in some commands and ISO 8601 in others. Check the field before comparing.