agentleFS
Alex72-pyAlex72-py/termux-elite/skills/termux-api/SKILL.md

termux-api

Skill2 starsChanged 57 days agoMITView on GitHub

Attribute a hanging, empty, or failing termux-* command to the right layer (Termux:API app, termux-api package, or an Android runtime permission) before relying on it. Use when termux-battery-status, termux-notification, termux-clipboard-get, termux-location, or similar commands hang, print nothing, or report a permission error. Do NOT use for storage links (see storage-permissions), for commands inside proot, or for ordinary shell failures.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always call with timeout, for example timeout 10 termux-battery-status, so a missing app cannot block the agent.

    line 33
  2. Very specific:

    Run one harmless read, timeout 10 termux-battery-status, and confirm structured JSON output.

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Termux:API

Purpose

Separate three independent requirements (the Termux:API Android app, the termux-api package, and Android runtime permissions) so a failing termux-* command is attributed to the right layer.

When to use

A termux-* command that talks to Android (termux-battery-status, termux-clipboard-get, termux-notification, termux-location, termux-sms-send, termux-camera-photo) hangs, prints nothing, or reports a permission error.

When NOT to use

  • Storage links and shared storage: storage-permissions.
  • Commands inside proot: they are usually unusable there; proot-boundaries.
  • Core Termux commands such as termux-wake-lock and termux-setup-storage; they do not need the Termux:API app.

Preconditions

Native Termux only. Run sh scripts/check-termux-api.sh; it is bounded and read-only.

Decision tree

  1. No termux-* API binaries on PATH: the termux-api package is missing in this environment.
  2. Binaries exist but calls time out: the Termux:API Android app is missing, stopped, or restricted by battery optimization.
  3. App and package both present but calls fail: Termux and plugin apps came from different sources or signing keys. Reinstall them from one source.
  4. One command reports a permission error: grant the matching Android runtime permission to Termux:API (location, SMS, camera, contacts, call log) in Android settings. Unix modes are irrelevant.
  5. termux-notification shows nothing on recent Android: the notification permission for Termux:API may be off (Android 13 and later).
  6. termux-clipboard-get returns empty while the screen or another app has focus: Android restricts background clipboard reads (Android 10 and later). Retry with Termux in the foreground before blaming the package.
  7. Always call with timeout, for example timeout 10 termux-battery-status, so a missing app cannot block the agent.

Example

  • Situation: termux-battery-status hangs with no output.
  • Without the skill: Reinstalls the termux-api package repeatedly.
  • With the skill: Wraps the call in timeout 10, sees binaries present but the call timing out, and points at the Termux:API app being missing, stopped, or battery-restricted.

Safety

Many commands expose sensitive data (location, SMS, contacts, call log, clipboard). Request only the one capability the task needs, do not echo results beyond the task, and ask before any command that sends, calls, writes, or notifies.

Verification

Run one harmless read, timeout 10 termux-battery-status, and confirm structured JSON output.

Handoffs

  • termux-environment for Android version and Termux source facts.
  • background-processes when Termux:API is killed or restricted by battery settings.
  • storage-permissions when the real failure is a path, not an API call.
  • proot-boundaries when the call was made inside proot.

Report

Which layer failed (package, app, permission, or foreground restriction), the single user-side action required, and the result of the verification read.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.