Skip to content

Add stdin option to command chains #190

Description

@LucasPickering

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Right now, it's tedious to write command chains that require stdin input. For example:

chains:
  email-body:
    source: !request
      recipe: get-email
    selector: $.headers
  email-body-escaped:
    source: !command
      command: [sh, -c, "echo '{{chains.email-body}}' | jq -R -s '.'"]

The goal here is to reduce the number of use cases where users have to invoke the shell, without too much effort (see #153 for another example). This has two benefits:

  • More user friendly
  • Reduce cross-platform issues

Describe the solution you'd like
A clear and concise description of what you want to happen

A new field stdin on the !command variant:

chains:
  email-body:
    source: !request
      recipe: get-email
    selector: $.headers
  email-body-escaped:
    source: !command
      command: [jq, -R, -s, '.']
      stdin: "{{chains.email-body}}"

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered

The primary alternative is doing nothing, since this is already possible by invoking the shell directly.

Additional context
Add any other context or screenshots about the feature request here

If anyone wants to implement this, the work involved is:

Activity

  1. added
    qolImprovements that make usage smoother, without introducing new functionality
    on Apr 30, 2024
  2. added a commit that references this issue on May 6, 2024
  3. added a commit that references this issue on May 11, 2026
  4. added a commit that references this issue on May 14, 2026
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

    good first issueGood for newcomersqolImprovements that make usage smoother, without introducing new functionality

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions