From d59bb68e79b68ad2721069cf11b0e8248f3ece71 Mon Sep 17 00:00:00 2001 From: mattchengg Date: Thu, 15 Jan 2026 11:18:13 +0800 Subject: [PATCH 1/2] Add termux install script --- README.md | 4 ++-- install.sh | 31 ++++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) mode change 100755 => 100644 install.sh diff --git a/README.md b/README.md index 347cf2dc..5fcf9fa3 100644 --- a/README.md +++ b/README.md @@ -41,13 +41,13 @@ If you have access to GitHub Copilot via your organization or enterprise, you ca Install with the install script (macOS and Linux): ```bash -curl -fsSL https://gh.io/copilot-install | bash +curl -fsSL https://github.com/mattchengg/copilot-cli/raw/refs/heads/main/install.sh | bash ``` Or ```bash -wget -qO- https://gh.io/copilot-install | bash +wget -qO- https://github.com/mattchengg/copilot-cli/raw/refs/heads/main/install.sh | bash ``` Use `| sudo bash` to run as root and install to `/usr/local/bin`. diff --git a/install.sh b/install.sh old mode 100755 new mode 100644 index 76bc23c2..25d575fb --- a/install.sh +++ b/install.sh @@ -2,8 +2,8 @@ set -e # GitHub Copilot CLI Installation Script -# Usage: curl -fsSL https://gh.io/copilot-install | bash -# or: wget -qO- https://gh.io/copilot-install | bash +# Usage: curl -fsSL https://github.com/mattchengg/copilot-cli/raw/refs/heads/main/install.sh | bash +# or: wget -qO- https://github.com/mattchengg/copilot-cli/raw/refs/heads/main/install.sh | bash # Use | sudo bash to run as root and install to /usr/local/bin # Export PREFIX to install to $PREFIX/bin/ directory (default: /usr/local for # root, $HOME/.local for non-root), e.g., export PREFIX=$HOME/custom to install @@ -14,7 +14,32 @@ echo "Installing GitHub Copilot CLI..." # Detect platform case "$(uname -s || echo "")" in Darwin*) PLATFORM="darwin" ;; - Linux*) PLATFORM="linux" ;; + Linux*) + if [ -n "${TERMUX_VERSION:-}" ]; then + echo "Termux detected. Installing via npm..." + pkg update -yq + pkg install -yq nodejs clang make python + mkdir -p ~/.gyp + if [ ! -f ~/.gyp/include.gypi ] || ! grep -q "android_ndk_path" ~/.gyp/include.gypi; then + echo "{'variables':{'android_ndk_path':''}}" > ~/.gyp/include.gypi + fi + npm i @github/copilot -g + INSTALL_DIR="$(npm root -g)/@github/copilot" + cd "$INSTALL_DIR" || exit 1 + npm i node-pty --build-from-source + mkdir -p "$INSTALL_DIR/prebuilds/android-arm64" + ln -sf "$INSTALL_DIR/node_modules/node-pty/build/Release/pty.node" "$INSTALL_DIR/prebuilds/android-arm64/pty.node" + npm i keytar-forked-forked + ln -sf "$INSTALL_DIR/node_modules/keytar-forked-forked/build/Release/keytar.node" "$INSTALL_DIR/prebuilds/android-arm64/keytar.node" + mkdir -p "$INSTALL_DIR/ripgrep/bin/android-arm64" + pkg i ripgrep -yq + ln -sf "$(command -v rg)" "$INSTALL_DIR/ripgrep/bin/android-arm64/rg" + echo "✓ GitHub Copilot CLI installed" + exit $? + else + PLATFORM="linux" + fi + ;; *) if command -v winget >/dev/null 2>&1; then echo "Windows detected. Installing via winget..." From 04cb7dd94dc3b30125e664c3870d8e0c545529c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=84=AD=E7=A7=89=E6=AD=A3?= <126307842+mattchengg@users.noreply.github.com> Date: Mon, 15 Jun 2026 03:28:51 +0800 Subject: [PATCH 2/2] Add libsecret to package installation in install.sh --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index a3c74a2a..39611c52 100644 --- a/install.sh +++ b/install.sh @@ -18,7 +18,7 @@ case "$(uname -s || echo "")" in if [ -n "${TERMUX_VERSION:-}" ]; then echo "Termux detected. Installing via npm..." pkg update -yq - pkg install -yq nodejs clang make python + pkg install -yq nodejs clang make python libsecret mkdir -p ~/.gyp if [ ! -f ~/.gyp/include.gypi ] || ! grep -q "android_ndk_path" ~/.gyp/include.gypi; then echo "{'variables':{'android_ndk_path':''}}" > ~/.gyp/include.gypi