Skip to content

Installation

Terminal window
go install github.com/malonaz/sgpt/cmd/sgpt-cli@latest
mv "$(go env GOPATH)/bin/sgpt-cli" ~/.local/bin/sgpt

Make sure ~/.local/bin is on your PATH.

The repo builds with please:

Terminal window
git clone https://github.com/malonaz/sgpt && cd sgpt
plz build //cmd/sgpt-cli
./scripts/install.sh # moves the binary to ~/.local/bin/sgpt, installs completions
Terminal window
sgpt completion bash > ~/.local/share/bash-completion/completions/sgpt
sgpt completion zsh > ~/.zfunc/_sgpt
sgpt completion fish > ~/.config/fish/completions/sgpt.fish

Completions cover roles, models (including aliases), tool names and chats.

  • A reachable AiService gRPC backend and an API key for it.
  • A terminal with alt/meta key support (most do; on macOS Terminal enable Use Option as Meta key).
  • Optional: $EDITOR for composing long messages and viewing chats.