termux-environment
Skill2 starsChanged 57 days agoMITView on GitHub
Take a small read-only snapshot of a Termux or Android shell (native Termux, proot, another Android shell, or a non-Android system; Android and Termux version, CPU architecture, installed toolchains, free storage and memory) before choosing a package manager, path, or fix. Use when a task depends on what the device is, when asked what is installed or which architecture applies, or at the start of any Termux debugging session. Do NOT use as a ritual before every command, for plain text questions, or to change anything.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- background-processesSkill
- git-credentialsSkill
- github-actionsSkill
- node-native-buildSkill
- package-troubleshootingSkill
- proot-boundariesSkill
- python-native-buildSkill
- storage-permissionsSkill
- termux-adbSkill
- termux-apiSkill
- termux-backupSkill
- termux-networkSkill
- termux-servicesSkill
- termux-sshdSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Before every command. Cache the snapshot.
- Distinctive: line 25
Read-only shell only. No root, network, or Termux:API required.
- Very specific: line 28
Run sh scripts/detect-environment.sh.
- Very specific: line 29
Read environment_class first.
- Very specific: line 35
Run a command from a Termux skill only when the class is termux-native, or the skill says proot is fine.
- Very specific: line 51
Every reported fact came from command output in this session.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Termux Environment
Purpose
Build a small factual snapshot so later decisions rest on measured facts, not on assumptions about the phone, the shell, or the distro.
When to use
- A fix depends on Android version, CPU architecture, free space, or installed toolchains.
- It is unclear whether the shell is native Termux, a proot distro, another Android shell, or not Android at all.
- Any other skill in this pack says to capture the environment first.
When NOT to use
- Plain text questions, or a command whose result does not depend on the device.
- Before every command. Cache the snapshot; refresh only after a package upgrade, entering or leaving proot, or reinstalling Termux.
Preconditions
Read-only shell only. No root, network, or Termux:API required.
Decision tree
- Run
sh scripts/detect-environment.sh. It printskey: valuelines and never dumps the environment. - Read
environment_classfirst; the line beside it,environment_evidence, says why. Hints are not proof.termux-native: Bionic libc,pkg, Termux package names,$PREFIXpaths. The Termux skills apply as written.proot: a distro running under Termux. It has its own package manager and usually glibc;termux-*commands and Termux package names belong to the native side. Confirm withproot-boundaries.android-other: Android properties are readable but there is no Termux prefix (for example anadb shellor another terminal app). Do not assumepkgor Termux paths; ask.linux,wsl,container,macos: not Android. The Termux-specific steps do not apply; usesystem_package_managerand ordinary rules.unknown: ask the user. Do not guess. Run a command from a Termux skill only when the class istermux-native, or the skill says proot is fine.
- Architecture comes from
architecture, never from the phone model.aarch64is the common case.armv7lorarmv8lmeans a 32-bit userland, where many prebuilt wheels and binaries do not exist.x86_64is an emulator or Chromebook. android_sdkselects which Android behavior applies. Report these as version-specific: background clipboard reads are restricted from Android 10; recent releases restrict network interface listing (ip,ifconfig,netstat); Android 12 and later kill excess child processes (seebackground-processes).- Hard-coded
/tmp,/bin/sh, or#!/usr/bin/envfail on a bare Android layout. Termux uses$TMPDIR($PREFIX/tmp) and$PREFIX/bin/sh, andtermux-execrewrites shebangs. Fix the path or variable, not the system. - Under about 1 GiB free storage or available memory: warn before any compile,
pkg upgrade, or large download. - Termux and its plugin apps (Termux:API, Boot, Widget) must come from the same distribution source and signing key, or plugins fail to talk to Termux.
Example
- Situation: A prebuilt binary will not run and the user says the phone is a recent flagship.
- Without the skill: Guesses arm64 from the phone model and suggests an aarch64 download.
- With the skill: Runs the helper, reads
architecture: armv8l(a 32-bit userland), explains why aarch64 binaries cannot run, and reports the fact with the line that proves it.
Safety
Everything here is read-only. termux-info prints the device model and the full package list, so share only the lines the task needs. Never print env wholesale; it can contain tokens.
Verification
Every reported fact came from command output in this session. Say unknown for anything the script could not read.
Handoffs
proot-boundarieswhen native versus proot is unclear or mixed.package-troubleshootingwhen no package manager is found or indexes look stale.storage-permissionswhenstorage_sharedis absent.python-native-buildwhen a build needs the toolchain list.
Report
At most six lines: environment_class, architecture, Android API level, Termux version, free storage and memory, and any missing tool that matters for the task.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

