android-saf

Access Android SAF files via URIs from Termux without filesystem exposure.

15|2|Updated May 26, 2025
One-click install
npx skills add https://github.com/Manamama/Puzzles_for_AIs --skill android-saf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-saf
Source: https://github.com/Manamama/Puzzles_for_AIs/tree/main/skills/android-saf
Command: npx skills add https://github.com/Manamama/Puzzles_for_AIs --skill android-saf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a secure, URI-based workflow to interact with Android's Storage Access Framework (SAF) without granting direct, uncontrolled filesystem access. It enables AI agents to operate within a user-selected territory using URIs and JSON messages, reducing risk while preserving functionality.

Core Features & Use Cases

  • URI-based SAF access: Navigate, inspect, and manipulate Android files and directories via content:// URIs without touching the local filesystem.
  • Structured workflow orchestration: Coordinate directory selection, territory listing, metadata retrieval, and read/write operations through dedicated SAF commands.
  • Use Case: An AI agent needs to safely explore a user-granted folder, read file metadata, and perform non-destructive I/O through URIs for processing tasks.

Quick Start

Start by invoking termux-saf-managedir to select a directory, then list items with termux-saf-ls and perform read/write through the returned URIs.

Frequently Asked Questions about android-saf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I access Android files from Termux without exposing the entire filesystem?

You can access Android files from Termux by using URI-based Storage Access Framework (SAF) workflows. This approach requires user-granted directory permissions, enabling safe file navigation and I/O operations via content:// URIs without direct filesystem exposure.

What is the Storage Access Framework and when do I need it for file I/O?

The Storage Access Framework (SAF) is an Android mechanism for secure, URI-based file interactions. You need SAF when an AI agent must navigate, inspect metadata, or perform read/write operations within a specific user-selected directory while avoiding uncontrolled local filesystem access.

How do I start reading and writing files using SAF URIs?

To start reading and writing files using SAF URIs, first invoke directory selection to grant access, then list directory items to map the territory, retrieve metadata, and execute the create/write/read sequence using the returned content:// URIs for structured I/O.

Can I use an AI agent to safely explore a user-selected directory on Android?

Yes, an AI agent can safely explore a user-selected directory on Android using structured SAF workflows. The agent coordinates directory selection, territory listing, and metadata retrieval to navigate and manipulate files securely through URI-based JSON messages.

Does Termux support Storage Access Framework commands for file metadata retrieval?

Yes, Termux supports Storage Access Framework commands for file metadata retrieval. You can use dedicated SAF commands to select directories, list items for territory mapping, and retrieve specific metadata through content:// URIs without touching the local filesystem.

Why should I use URI-based file access instead of direct filesystem paths?

URI-based file access should be used instead of direct filesystem paths to reduce security risks on Android. By using SAF URIs and JSON messages, you restrict AI agents to a user-granted territory, preventing uncontrolled filesystem exposure while preserving read/write functionality.