## GitHub Copilot CLI

A CLI experience for letting GitHub Copilot help you on the command line.

GitHub Copilot CLI translates natural language into shell commands, with modes for
different domains.

- `??`: Translate natural language to arbitrary shell commands
- `git?`: Translate natural language to Git commands
- `gh?`: Translate natural language to GitHub CLI commands

GitHub Copilot CLI will also try to break down and explain piece by piece what
the suggested command will do.

## Compilation

Install dependencies.

```bash
yarn
```

Develop locally. An `esbuild` process will start and re-compile anytime you change + save the
contents of a file.

```bash
yarn dev
```

GitHub Copilot CLI is invoked using one of the shell injected functions:
first, run the following from the root folder of the repo:

```bash
$ eval "$(./bin/copilot-cli alias -- "$0")"
```

This provides that shell with the three commands `??`, `git?`, `gh?`.

To install GitHub Copilot CLI into any shell, you should execute the above command from your `.zshrc`
or `.bashrc` or equivalent. For instance, you could use the following lines, making sure to fix the
path to GitHub Copilot CLI:

```bash
COPILOT_CLI=~/path/to/copilot-cli
if [ -e $COPILOT_CLI/bin/copilot-cli ]; then
  eval "$($COPILOT_CLI/bin/copilot-cli alias -- "$0")"
fi
```

## Examples

### `??`

<img width="600" src="./videos/what-the-shell.svg">

### `git?`

<img width="600" src="./videos/git.svg">

### `gh?`

<img width="600" src="./videos/gh.svg">

## Inspiration

[Codex CLI](https://github.com/microsoft/Codex-CLI) has a mode similar to the basic functionality of `??`.
It has other features as well that we don't yet support in GitHub Copilot CLI.
