Visitar URL original
Add an `--output-file` option to `fga tuple read` · Issue #569 · openfga/cli · GitHub
Skip to content

Add an --output-file option to fga tuple read #569

Open

Description

@aaguiarz

We currently display the output of fga tuple read to stdout.

In some cases, we could want to display other things to stdout, like progress information.

We should add an --output-file parameter and write tuples in that file.

Activity

  1. moved this from Backlog to Intake in SDKs and Toolingon Aug 26, 2025
  2. Siddhant-K-code commented on Aug 24, 2026

    @Siddhant-K-code
    Member

    Proposal

    Add an optional --output-file flag to fga tuple read.

    fga tuple read --store-id <ID> \
      --output-format simple-json \
      --output-file tuples.json

    Behavior

    • Without --output-file, keep writing tuples to stdout.
    • With --output-file, write tuples only to the specified file.
    • Preserve the selected --output-format.
    • Return an error if the file cannot be created or written.
    • Create files with 0600 permissions.

    Implementation

    1. Add the flag in cmd/tuple/read.go.
    2. Write output through an io.Writer.
    3. Use os.Stdout by default or the opened file when specified.
    4. Add tests for JSON, YAML, CSV, write failures, and unchanged stdout behavior.

    This keeps #569 focused. Streaming and progress reporting can follow separately in #570.

  3. added a commit that references this issue on Nov 6, 2026
    e02b91d
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

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions