why do we need antoher CLI when we already have the gh Copilot CLI?
- It's not just CLI questions; it can be used for other purposes as well.
- I want to learn how to build CLI using go.
- It supports saving your chat with the -chat-file flag and provides more context from your clipboard with the -clipboard-context flag.
You can fin dthe binary file on the release page. Alternatively, if you have Go, you can install it using go install cmd/chatsh.go
.
Usage: chatsh [COMMAND]
Examples:
chatsh chat "How to install Git on Windows"
Chat with Copilot. This command will prompt text to the Copilot API.
chatsh chat -chat-file ./test.json "Rewrite everything with Go"
Same as above, but with previous chat context specified by ./test.json.
chatsh chat -h
chatsh setup
Setup Copilot for this CLI.
Available Commands:
setup Setup OAuth
chat Chat with Copilot
Usage: chatsh chat [-chat-file] [-prompt] [-clipboard-context] [query]
-chat-file string (file)
add previous chat context specified by chat-file
-clipboard-context
add clipboardas another context
-prompt string
custom prompt
It also supports stdin, so you can do something like this:
cat apple.py | chatsh chat "$(cat -) what's this code doing"