Skip to content

Your phone, on your command. Gotcha is world's first fully on-device AI copilot for Android that turns natural language into real device actions — safely.

feat(skills): add termux_filesystem skill

Gotcha Contributord05bfbcea2a7
diff --git a/app/src/main/assets/skills/termux_filesystem.json b/app/src/main/assets/skills/termux_filesystem.json
new file mode 100644
index 0000000..636d7dd
--- /dev/null
+++ b/app/src/main/assets/skills/termux_filesystem.json
@@ -0,0 +1,9 @@
+{
+ "id": "termux_filesystem",
+ "targetPackageNames": ["com.termux"],
+ "name": "Termux Filesystem",
+ "description": "Three filesystem worlds: Gotcha's working dir, Termux's home, and /sdcard. They are not interchangeable.",
+ "requiresTools": ["run_termux_command"],
+ "keywords": ["file", "path", "/sdcard", "storage", "home", "directory", "upload", "download"],
+ "instructions": "Three filesystem worlds — keep them separate:\n1. Gotcha's working dir (default cwd for `run_command`, `read_file`, `write_file`, `edit`, `glob`, `grep`): `/storage/emulated/0/Gotcha/chats/<slug_id>/`. INVISIBLE to Termux (different UID).\n2. Termux's home (default `working_dir` for `run_termux_command`): `/data/data/com.termux/files/home`. INVISIBLE to Gotcha.\n3. Shared storage: `/storage/emulated/0/Download`, `/storage/emulated/0/Pictures`, `/storage/emulated/0/Music`. Readable by both UIDs, but ONLY AFTER the user has run `termux-setup-storage` in Termux once. Before that, Termux sees `/sdcard/` as empty.\n\nThe only safe bridge between the two worlds is `/sdcard/Download/`:\n1. Gotcha: write_file('/storage/emulated/0/Download/foo.txt', ...). Termux reads: cat /sdcard/Download/foo.txt.\n2. Termux writes /sdcard/Download/result.txt. Gotcha reads: read_file('/storage/emulated/0/Download/result.txt').\n\nInside Termux, use `/sdcard` (which symlinks to `/storage/emulated/0`). Do NOT use `/storage/emulated/0` directly inside Termux for write paths — go through `/sdcard`.\n\n`$PREFIX` is `/data/data/com.termux/files/usr`. The model should not guess `/usr/bin` for Termux — that path is empty.\n\nIf a Gotcha `read_file` on a path that exists in `/sdcard/Download/` fails inside Termux's view, the user has likely not run `termux-setup-storage`. Ask the user to open Termux once and run `termux-setup-storage`, then retry.\n\nTermux's `/data/data/com.termux/files/home` is a real directory, but writing to it from Gotcha via `run_command` would fail with Permission denied — that is a different UID. Stick to the /sdcard bridge.\n\nFor temporary files inside Termux, prefer `/data/data/com.termux/files/home/.tmp/` or `$TMPDIR` — both are private to Termux and survive a single call.\n\ncross-uid file sizes above 100MB are slow across the /sdcard bridge (FUSE + sdcardfs). When transferring large files, prefer streaming via `dd` or `tar` straight through a pipe."
+}