███████╗██████╗ █████╗ ██╗ ██╗███╗ ██╗ Beta
██╔════╝██╔══██╗██╔══██╗██║ ██║████╗ ██║
███████╗██████╔╝███████║██║ █╗ ██║██╔██╗ ██║
╚════██║██╔═══╝ ██╔══██║██║███╗██║██║╚██╗██║
███████║██║ ██║ ██║╚███╔███╔╝██║ ╚████║
╚══════╝╚═╝ ╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═══╝
This guide helps you install Bun natively inside Termux using a GLIBC compatibility layer, and sets up the OpenRouter Spawn CLI for running AI coding agents.
Copy and paste the following blocks directly into your Termux terminal.
We need to enable the GLIBC repository, update the package indexes, and install the required build tools.
# Enable GLIBC repository and update indexes
pkg install glibc-repo -y
pkg update -y
# Install all required compiler tools and dependencies
pkg install git curl clang make glibc-repo python glibc-runner-y
pkg install proot -ySince Bun is compiled for standard Linux (glibc) and not Android's bionic libc, we install Bun and compile a lightweight system-call translation shim.
# Clone and compile the native Termux compatibility wrapper
git clone https://github.com/Happ1ness-dev/bun-termux.git
cd bun-termux
make && make install
# Reload profile configuration
source ~/.bashrc
# Verify Bun installation
bun --versionAdd Bun and local binaries to your shell profile path so they can be executed globally.
# Append variables to bash profile
echo 'export BUN_INSTALL="\$HOME/.bun"' >> ~/.bashrc
echo 'export PATH="\$BUN_INSTALL/bin:HOME/.local/bin:PATH"' >> ~/.bashrc
echo 'export TMPDIR="$PREFIX/tmp"' >> ~/.bashrc
echo 'export TEMP="$PREFIX/tmp"' >> ~/.bashrc
echo 'export TMP="$PREFIX/tmp"' >> ~/.bashrc
echo -e '\n# termux-chroot\nif [ -z "$TERMUX_CHROOT_ACTIVE" ]; then\n export TERMUX_CHROOT_ACTIVE=1\n exec termux-chroot\nfi' >> ~/.bashrc
source ~/.bashrc
# Reload profile configurations
source ~/.bashrc
# Verify Bun installation
bun --versionNow that Bun is globally accessible, the OpenRouter installer will execute successfully.
# Run the official installer
curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash
# Verify Spawn installation
spawn --helpTo start with agentic workflows using models like openrouter/owl-alpha:
- Export your OpenRouter API Key:
export OPENROUTER_API_KEY="your_openrouter_api_key_here"
- Spawn your agent workspace:
spawn
If some third-party build scripts or global packages inside Termux fail because they specifically look for a node binary, you can safely symlink your native Bun installation to act as Node:
ln -s HOME/.bun/bin/bun HOME/.bun/bin/node- Wrapper logic powered by bun-termux.
- CLI workspace management powered by OpenRouter Spawn.