> For the complete documentation index, see [llms.txt](https://www.techwithtyler.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.techwithtyler.dev/coding-and-cli-tooling/cli-tools/github-copilot-cli.md).

# GitHub Copilot (CLI)

## Install and Setup

* Brew doesn't set up auto-completion for tools, but it works if you set [this up in your shell](/operating-systems/macos/terminal-customization.md#completion-features).

{% code overflow="wrap" %}

```bash
# install 
brew install gh
```

{% endcode %}

```bash
# configure authentication
gh auth login
```

{% code overflow="wrap" %}

```bash
# install the copilot extension
gh extension install github/gh-copilot
```

{% endcode %}

{% code overflow="wrap" %}

```bash
# upgrade the copilot extension
gh extension upgrade gh-copilot
```

{% endcode %}

```bash
# disable usage data
gh copilot config
```

## Usage

```bash
gh copilot <command> "prompt"
```

### **Commands**

* `config` - adjust data collection
* `explain` - explain a command
* `suggest` - suggest a command

### **Explain**

* Prompting Copilot to explain a command to me.&#x20;

<figure><img src="/files/I4FSlfSLH6lOZQ6pIUmC" alt=""><figcaption></figcaption></figure>

### Suggest

* Prompting Copilot to build me a command and then providing feedback to improve the command.

<figure><img src="/files/L5vdHDizO6ax3SEt6Tti" alt=""><figcaption></figcaption></figure>

## Useful Resources

{% embed url="<https://docs.github.com/en/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli>" %}

{% embed url="<https://docs.github.com/en/copilot/github-copilot-in-the-cli/setting-up-github-copilot-in-the-cli>" %}
