gh-copilot icon indicating copy to clipboard operation
gh-copilot copied to clipboard

[FEAT]: Support non-interactive mode with standard shell output redirect

Open bpkroth opened this issue 5 months ago • 0 comments

Thanks for taking the time to fill out this out! :bow: By submitting this issue, you agree to follow our Code of Conduct.

Describe the need

I want to be able to use gh copilot suggest in a promptless manner using standard shell output capture and redirects.

Version

gh copilot --version
version 1.1.0 (2025-02-10)

Relevant terminal output

bpkroth@localhost: ~/src/env 130 (master) $ command=$(ghcs print "Suggest a git commit command and message for these changes: $(git diff --cached)")

✗ Error: failed to copy to clipboard: failed to copy to clipboard: No clipboard utilities available. Please install xsel, xclip, wl-clipboard or Termux:API add-on for termux-clipboard-get/set.

bpkroth@localhost: ~/src/env 1 (master) $ echo "$command"

Welcome to GitHub Copilot in the CLI!
version 1.1.0 (2025-02-10)

I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve. For more information, see https://gh.io/gh-copilot-transparency


  # Suggestion:

    git commit -m "Add 'gh' to installation scripts for Linux, macOS, and Windows"


? Select an option
> Copy command to clipboard

this should only capture and print

git commit -m "Add 'gh' to installation scripts for Linux, macOS, and Windows"

bpkroth avatar May 01 '25 20:05 bpkroth