Skip to content

Pagination #161

Description

How do you use pagination with the CLI? There's no way to access a response's Link/Pagination HTTP headers.

For example, I need to get a list of 500 keys in my project.

phrase keys list --project_id 123xyz --batch returns the first 25. How do I know there are 475 left?

Activity

  1. jablan commented on Feb 11, 2025

    @jablan

    Yeah, as the pagination data is not exposed in the response body, you won't have the information available.

    We could perhaps add an option to output the pagination data as JSON before or after the response body on stdout, however that would pose a problem of parsing, as it's not a single JSON document any more.

  2. jimmymcpeter commented on Feb 11, 2025

    @jimmymcpeter
    Author

    Thanks jablan. For some inspiration you could take a look at the GitHub CLI's --paginate and --slurp options -- https://cli.github.com/manual/gh_api

  3. jablan commented on Feb 11, 2025

    @jablan

    I see. As a workaround measure, you can iterate by increasing page parameter until there's no more results left in the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions