Skip to content

Add support for one-shot stdin via .input() - #1178

Open
felipecrs wants to merge 1 commit into
steveukx:mainfrom
felipecrs:feat/input-stdin
Open

Add support for one-shot stdin via .input()#1178
felipecrs wants to merge 1 commit into
steveukx:mainfrom
felipecrs:feat/input-stdin

Conversation

@felipecrs

@felipecrs felipecrs commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

This allows passing stdin for git commands like:

const trailers = await simpleGit()
   .input(commitMessage)
   .raw(['interpret-trailers', '--parse']);

Useful for commands like interpret-trailers --parse and hash-object --stdin.

Related:

I realized this limitation when working on renovatebot/renovate#44651, where I needed to call echo "commit message" | git interpret-trailers --parse.

So I thought this would be a nice and simple way to fix it, while still having room for future improvements like support for Streams.

Allow passing a string or Buffer to the next spawned git command's
stdin, e.g. for interpret-trailers --parse and hash-object --stdin.
@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 65039ca

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
simple-git Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@felipecrs felipecrs changed the title Add .input() for one-shot stdin Support stdin via .input() Jul 17, 2026
@felipecrs felipecrs changed the title Support stdin via .input() Add support for stdin via .input() Jul 17, 2026
@felipecrs
felipecrs marked this pull request as ready for review July 17, 2026 02:06
@felipecrs felipecrs changed the title Add support for stdin via .input() Add support for one-shot stdin via .input() Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant