Termux/Android Support
Describe the feature or problem you'd like to solve
Would love to be able to Copilot on the go from my phone
Additional context
Right now I try to run it and I get:
copilot --yolo
Failed to load GitHub Copilot CLI: Error: Failed to load native module: pty.node, checked: build/Release, build/Debug, prebuilds/android-arm64: Error: Cannot find module './prebuilds/android-arm64/pty.node'
I've actually been using it on termux myself too- it's a bit tough to install but this setup script worked perfectly for me - https://github.com/NilsSei/copilot-termux-setup
Řešení: GitHub Copilot CLI v Termuxu - Android pty.node error
Vytvořil jsem kompletní řešení pro chybu Error: Cannot find module './prebuilds/android-arm64/pty.node' v Termuxu.
🎯 Co se řeší
GitHub distribuuje Copilot CLI s předkompilovanými moduly (node-pty, sharp) pouze pro Linux (glibc), Windows a macOS. V Termuxu (Android) tyto binárky nefungují, protože Termux používá Bionic libc.
✅ Řešení: Manuální postup
# 1. Instalace build tools
pkg update && pkg install python make clang
# 2. Kompilace node-pty
cd ~
npm install node-pty
# 3. Vytvoření prebuilds adresáře
mkdir -p /data/data/com.termux/files/usr/lib/node_modules/@github/copilot/prebuilds/android-arm64/
# 4. Injektování binárky
cp ~/node_modules/node-pty/build/Release/pty.node \
/data/data/com.termux/files/usr/lib/node_modules/@github/copilot/prebuilds/android-arm64/
# 5. Volitelně - sharp
npm install sharp
cp ~/node_modules/sharp/build/Release/sharp.node \
/data/data/com.termux/files/usr/lib/node_modules/@github/copilot/prebuilds/android-arm64/
🤖 Automatizovaný skript
Vytvořil jsem bash skript, který automaticky provede všechny kroky. Skript:
- Ověří Termux environment
- Kontroluje Node.js a npm
- Instaluje všechny potřebné balíčky
- Zkompiluje moduly pro ARM64
- Injektuje binárky na správné místo
- Testuje instalaci
Skript je dostupný v repozitáři.
⚠️ Poznámka
Při aktualizaci Copilotu je nutné zopakovat injektování:
npm update -g @github/copilot && ./setup-copilot-termux.sh
Testováno na: Termux (Android 10+) s Node.js 18+, npm 8+
Running into this on Termux (Android 16, Pixel 10 Pro, arm64). The gh CLI v2.88.1 has gh copilot built-in now, but it can't launch the binary either — fails with "no such file or directory" because the ELF interpreter (ld-linux-aarch64.so.1) doesn't exist on Android Bionic. The npm package's pty.node has no android-arm64 prebuild, and the linux-arm64 one links against glibc so it can't run either. Would love to see an Android/Bionic-compatible build or a pure-JS fallback for the pty module.
Running into this on Termux (Android 16, Pixel 10 Pro, arm64). The
ghCLI v2.88.1 hasgh copilotbuilt-in now, but it can't launch the binary either — fails with "no such file or directory" because the ELF interpreter (ld-linux-aarch64.so.1) doesn't exist on Android Bionic. The npm package'spty.nodehas noandroid-arm64prebuild, and the linux-arm64 one links against glibc so it can't run either. Would love to see an Android/Bionic-compatible build or a pure-JS fallback for the pty module.
Try the script I've mentioned, I was running into the same issue and it solved it for me Would of course be nicer if we wouldn't have to do workarounds like this but it's about the pty.node package and not Copilot, so I suppose they can't do much about this aside from making a similar install script that gets around this issue
Running into this on Termux (Android 16, Pixel 10 Pro, arm64). The
ghCLI v2.88.1 hasgh copilotbuilt-in now, but it can't launch the binary either — fails with "no such file or directory" because the ELF interpreter (ld-linux-aarch64.so.1) doesn't exist on Android Bionic. The npm package'spty.nodehas noandroid-arm64prebuild, and the linux-arm64 one links against glibc so it can't run either. Would love to see an Android/Bionic-compatible build or a pure-JS fallback for the pty module.
have you tried using it with Termux glibc? This
Confirming a working native-Termux setup for current Copilot CLI (tested on 1.0.105, arm64, no proot).
I tried https://github.com/NilsSei/copilot-termux-setup first, but it didn't work for me. That approach compiles pty.node/sharp for Android, which fixed the older Node-based CLI. Newer versions ship a prebuilt Linux binary per platform (@github/copilot-linux-arm64), so the problem is different:
- Termux's Node reports
android, so npm installs no platform package, and you getno platform package found. - The
linux-arm64binary is linked against glibc and needs/lib/ld-linux-aarch64.so.1, which Android doesn't have. That's the "no such file or directory" @legends2710 hit.
Following up on @wiilwaalka's suggestion: Termux's glibc does work. Run the official binary through its loader:
pkg install glibc-repo && pkg install glibc-runner
npm install -g @github/copilot --ignore-scripts
# install the matching @github/copilot-linux-arm64, then launch it via:
$PREFIX/glibc/lib/ld-linux-aarch64.so.1 --library-path $PREFIX/glibc/lib <path>/copilot-linux-arm64/copilot "$@"
A script that does this automatically (matching version, certificates, launcher swap with backup) is here: https://github.com/abhishek-raj/termux-copilot-neovim. Run bash install.sh copilot, and rerun it after copilot update.
gh copilot works too once this is set up: gh uses the copilot found on PATH (the glibc launcher) instead of downloading its own copy, which is the one that fails with "no such file or directory". Tested with gh 2.103.3.
It also fixes swipe-scrolling, which breaks because Termux ignores mouse mode 1003, by running Copilot inside tmux.
An official android-arm64 build or documented Termux support would still be nicer than a workaround.