Skip to content
Merged
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Use `| sudo bash` to run as root and install to `/usr/local/bin`.
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.
Comment thread
devm33 marked this conversation as resolved.

### Launching the CLI

```bash
Expand Down
12 changes: 11 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@ case "$(uname -m)" in
*) echo "Error: Unsupported architecture $(uname -m)" >&2 ; exit 1 ;;
esac

DOWNLOAD_URL="https://github.com/github/copilot-cli/releases/latest/download/copilot-${PLATFORM}-${ARCH}.tar.gz"
# Determine download URL based on VERSION
if [ -n "$VERSION" ]; then
# Prefix version with 'v' if not already present
case "$VERSION" in
v*) ;;
*) VERSION="v$VERSION" ;;
esac
Comment thread
devm33 marked this conversation as resolved.
DOWNLOAD_URL="https://github.com/github/copilot-cli/releases/download/${VERSION}/copilot-${PLATFORM}-${ARCH}.tar.gz"
Comment thread
devm33 marked this conversation as resolved.
Comment thread
devm33 marked this conversation as resolved.
else
DOWNLOAD_URL="https://github.com/github/copilot-cli/releases/latest/download/copilot-${PLATFORM}-${ARCH}.tar.gz"
fi
echo "Downloading from: $DOWNLOAD_URL"

# Download and extract with error handling
Expand Down