Termux Installation Guide

Run snsagent on Android through Termux.

Prerequisites

RequirementInstallVerify
TermuxF-Droid or GitHub releasesOpen the app
Node.jspkg install nodejs-ltsnode --version
BunSource-build option belowbun --version
Gitpkg install gitgit --version

Use a current F-Droid or GitHub Termux release. The old Play Store build is not maintained.

Why the npm / prebuilt binary does not run on Android

The @sns-myagent/cli postinstall and install.sh both download a prebuilt snsagent-linux-arm64 asset compiled on GitHub’s ubuntu-latest runner. That artifact is glibc-linked and will not exec under Android’s bionic libc, so snsagent --version fails on Termux.

The installer (curl ... | bash) detects Termux and skips the prebuilt path, falling back to a from-source build. Use the source path below instead.

Installer behavior on Termux

  • Detection: TERMUX_VERSION env var, existence of /data/data/com.termux, or uname -o = Android sets IS_TERMUX=true.
  • Route: prebuilt download is skipped entirely with the message Termux: prebuilt glibc binary is incompatible with Android - building from source.
  • Fallback build: installs git curl unzip via pkg (best effort), installs Bun if missing, then git clone --depth 1 + bun install + bun run build and copies bin/snsagent to $INSTALL_DIR (default ~/.local/bin, override with SNS_INSTALL_DIR=/some/path bash install.sh).
  • Result: a fully working source-built binary is installed even when the GitHub API is unreachable.

The manual clone path below is equivalent - the installer just automates it.

pkg install -y nodejs-lts git
curl -fsSL https://bun.sh/install | bash
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
git clone https://github.com/Reihantt6/sns-myagent.git
cd sns-myagent
bun install
bun run src/cli/entry.ts --version

First-run setup

From the cloned repo:

bun run src/cli/entry.ts

Use /setup to configure a provider, or edit ~/.omp/agent/models.yml. For a local Ollama-compatible endpoint, use the endpoint URL and select openai-completions. Do not place a real key in this document or in a committed file.

Termux-specific tips

Storage access

termux-setup-storage

SSH server

sshd
# Connect from a laptop with: ssh -p 8022 phone-ip-address

Background sessions

Termux can stop background processes. For a boot workflow, install Termux:Boot and create a script under ~/.termux/boot/ that starts the command you need, for example:

mkdir -p ~/.termux/boot
echo 'cd ~/sns-myagent && bun run src/cli/entry.ts telegram start --token YOUR_TOKEN' > ~/.termux/boot/snsagent.sh
chmod +x ~/.termux/boot/snsagent.sh

Replace YOUR_TOKEN with the bot token (keep it out of any committed file).

Troubleshooting

ProblemFix
bun: command not foundexport PATH="$HOME/.bun/bin:$PATH" or restart Termux
npm install failspkg install nodejs-lts git and retry
Permission deniedRun the source entrypoint with Bun (bun run src/cli/entry.ts)
Out of memoryUse a hosted LLM and avoid local model inference
Keyboard lacks EscInstall Hacker’s Keyboard, or use Ctrl+[ as Esc
Termux crashesUpdate Termux from F-Droid or GitHub

Minimum phone specs

ComponentMinimumRecommended
Android7.0+10+
RAM2 GB free4 GB+
Storage500 MB free2 GB+
NetworkRequired for hosted LLMWiFi recommended