github / github/copilot-cli

Allow to pass data to stdin while providing a prompt

オープン
#683 コメント 0 件 リアクション 18 件 担当者 0 名 GitHub で見る
area:non-interactive
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

### Describe the feature or problem you'd like to solve

Allow to pass data to stdin while providing a prompt

### Proposed solution

This is actually mentioned in #96, but the use-case of passing data to stdin doesn't seem to be implemented.

I would like to pass data as stdin to copilot and provide a prompt about what to do with this data. This opens a lot of possibilities of having copilot do things non-interactive with data you pass to it.

When I try to pass data to stdin, it seems to ignore this. It is mentioned in the copliot cli docs that you can pass "options", but i'm not sure if this means data.

Image

### Example prompts or workflows

* checking a diff
```sh
$ git diff | copilot -p "can you take a look at this diff to see if it seems correct?"
```

* generate a one-liner for a diff for a commit message
```sh
$ git diff | copilot -p "can you tell me in one sentence what this diff changes?"
```

* checking for kernel issues
```sh
$ dmesg | tail -n 100 | copilot -p "my pc seems to hang, can you spot why by looking at this dmesg"
```

* lots of other things, checking logfiles, generating a table from a json file, ...

### Additional context

_No response_

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。