Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,18 @@ Set `PREFIX` to install to `$PREFIX/bin/` directory. Defaults to `/usr/local`
when run as root or `$HOME/.local` when run as a non-root user.

Set `VERSION` to install a specific version. Defaults to the latest version.
Set `VERSION=prerelease` to install the latest prerelease build.

For example, to install version `v0.0.369` to a custom directory:

```bash
curl -fsSL https://gh.io/copilot-install | VERSION="v0.0.369" PREFIX="$HOME/custom" bash
```

If the install location is not already in your `PATH`, the script prompts you to
add it to your shell profile. The install script does not modify your shell
configuration unless you explicitly confirm it.

Install with [Homebrew](https://formulae.brew.sh/cask/copilot-cli) (macOS and Linux):

```bash
Expand Down Expand Up @@ -95,6 +100,41 @@ npm install -g @github/copilot
npm install -g @github/copilot@prerelease
```

### Uninstallation

If you installed with the install script on macOS or Linux, uninstall with:

```bash
curl -fsSL https://raw.githubusercontent.com/github/copilot-cli/refs/heads/main/uninstall.sh | bash
```

Or:

```bash
wget -qO- https://raw.githubusercontent.com/github/copilot-cli/refs/heads/main/uninstall.sh | bash
```

Use `| sudo bash` to remove `/usr/local/bin/copilot`, or set `PREFIX` to remove
`$PREFIX/bin/copilot`.

The uninstall script only removes the installed `copilot` binary. If you
previously added the install directory to your `PATH`, remove that shell profile
entry manually if you no longer want it.

If you installed with another package manager, uninstall with the same tool:

```bash
brew uninstall copilot-cli
```

```bash
winget uninstall GitHub.Copilot
```

```bash
npm uninstall -g @github/copilot
```


### Launching the CLI

Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 1.0.14 - 2026-03-31

- Add a companion uninstall script for curl/wget installs and document scripted uninstall behavior
- Images are correctly sent to Anthropic models when using BYOM
- Model picker selection correctly overrides the --model flag for the current session
- Terminal output no longer clears or jumps on error exit
Expand Down
65 changes: 65 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/env bash
set -e

# GitHub Copilot CLI Uninstallation Script
# Usage: curl -fsSL https://gh.io/copilot-uninstall | bash
# or: wget -qO- https://gh.io/copilot-uninstall | bash
# Use | sudo bash to run as root and remove from /usr/local/bin
# Export PREFIX to remove from $PREFIX/bin/ directory (default: /usr/local for
# root, $HOME/.local for non-root), e.g., export PREFIX=$HOME/custom to remove
# from $HOME/custom/bin

echo "Uninstalling GitHub Copilot CLI..."

# Detect platform
case "$(uname -s || echo "")" in
Darwin*|Linux*) ;;
*)
if command -v winget >/dev/null 2>&1; then
echo "Windows detected. Uninstalling via winget..."
winget uninstall GitHub.Copilot
exit $?
else
echo "Error: Windows detected but winget not found. Please remove GitHub Copilot CLI using the package manager you installed it with." >&2
exit 1
fi
;;
esac

# Check if running as root, fallback to non-root
if [ "$(id -u 2>/dev/null || echo 1)" -eq 0 ]; then
PREFIX="${PREFIX:-/usr/local}"
else
PREFIX="${PREFIX:-$HOME/.local}"
fi
INSTALL_DIR="$PREFIX/bin"
TARGET="$INSTALL_DIR/copilot"

if [ ! -e "$TARGET" ]; then
echo "Notice: No copilot binary found at $TARGET."

if command -v copilot >/dev/null 2>&1; then
FOUND_PATH="$(command -v copilot)"
echo "Another copilot binary is still available at $FOUND_PATH."
echo "If you installed it with Homebrew, npm, or another package manager, uninstall it with that tool."
fi

exit 0
fi

if [ ! -w "$TARGET" ] && [ "$(id -u 2>/dev/null || echo 1)" -ne 0 ]; then
echo "Error: Could not remove $TARGET. You may not have write permissions." >&2
echo "Try running this script with sudo or set PREFIX to the installation prefix used previously." >&2
exit 1
fi

rm -f "$TARGET"
echo "✓ Removed $TARGET"

if [ -d "$INSTALL_DIR" ] && [ -z "$(ls -A "$INSTALL_DIR" 2>/dev/null)" ]; then
rmdir "$INSTALL_DIR" 2>/dev/null || true
fi

echo ""
echo "Uninstall complete."
echo "If you previously added $INSTALL_DIR to your PATH, you can remove that entry from your shell profile manually."