Skip to content

Support output to stdout in dy export command #282

@StoneDot

Description

@StoneDot

Current Behavior

The dy export command requires specifying an output file path with --output-file. When attempting to use /dev/stdout (or similar special files), the command fails because it tries to truncate the file.

Expected Behavior

Users should be able to output directly to stdout, allowing them to pipe the data to other commands without creating intermediate files.

Example use case:

dy export --table MyTable --output-file /dev/stdout | jq '.[] | select(.status == "active")'

Proposed Solution

Add special handling for stdout (e.g., detect /dev/stdout, -, or add a dedicated flag like --stdout) that skips the truncate operation and writes directly to stdout.

Benefits

  • Enables seamless integration with other CLI tools via pipes
  • Avoids creating temporary files for data processing pipelines
  • Provides a more Unix-like experience for scripting and automation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions