0%

GitHub Copilot CLI Usage

Copilot CLI is now in public beta. I hadn’t played with it before, but now I’ve tried it out. Here’s how to use it and my thoughts.

Current version of CLI version 0.5.4-beta (2024-01-04)

Requirements

Like GitHub Copilot, it requires a paid subscription.

Installation

1
2
3
4
5
6
7
8
9
10
11
# Install GitHub CLI
brew install gh

# Update GitHub CLI
brew upgrade gh

# Log in to GitHub
gh auth login

# Install copilot
gh extension install github/gh-copilot

Once installed as above, it can be used normally.

Usage

The functionality of the CLI is currently quite simple:

  1. Explain command

    1
    gh copilot explain "git push"
  2. Suggest command

    1
    gh copilot suggest "install git"

Currently, it’s not possible to set prompt words, so the return results will be in English, but the command prompt words can be described in Chinese, as the underlying OpenAI supports multiple languages.

https://static.1991421.cn/2024/2024-02-08-231521.jpeg

That’s all for the CLI functionality for now, just these. Looking forward to more updates from the CLI, such as supporting system prompt words, or supporting chatting instead of being restricted to commands?