Repository navigation
AI Shell Assistant Guide
DP-Hridayan edited this page Nov 17, 2026
·
1 revision
The AI Shell Assistant (ADB Agent) in aShell You integrates LLM intelligence with real-time Android shell command generation and diagnostics. Users can describe desired system modifications, performance audits, or troubleshooting goals in natural language, and the assistant formulates, explains, and proposes the necessary shell operations under explicit user approval gates.
![]() Diagnostic Chat Interface |
![]() Execution Approval Gate |
- Natural Language Command Synthesis: Translates high-level prompts (e.g. "Identify apps draining battery" or "Set screen resolution to 1080p") into exact, syntactically correct ADB commands.
-
Interactive Multi-Step Diagnostics: Gathers real-time telemetry from
dumpsys,pm, andcmdto analyze issues and propose remediation strategies. - Transparent Reasoning: Features an expandable Thoughts trace disclosing every intermediate tool call, analysis step, and hypothesis generated by the model.
- Strict Execution Safety Gates: The assistant never runs arbitrary or destructive commands without explicit user approval.
-
Configurable Persistent Permission Rules: Granular approval controls allowing users to allow once, always approve exact command strings, or allow entire tool bases (e.g., all
dumpsysqueries). - Multi-Provider LLM Backend: Flexible integration supporting Gemini, OpenAI-compatible APIs, OpenRouter, and custom endpoints.
Security and device integrity are primary design priorities. The AI Shell Assistant operates under an approval gate before executing any command on the target device:
| Action | Impact | Description |
|---|---|---|
| Deny | Safe | Rejects the proposed command. The assistant receives rejection feedback and suggests alternative steps. |
| Allow | Single Execution | Approves the command for this single occurrence only. |
| Always Allow Exact | Scoped Rule | Permanently approves the exact command string (e.g., cmd appops set com.analytics.tracker RUN_IN_BACKGROUND ignore) for future invocations without prompting. |
| Always Allow Base | Category Rule | Approves any command beginning with the specified binary or base command (e.g., cmd or dumpsys) while still prompting for unknown executables. |
- Open the AI Assistant tab.
- Tap the settings/tuning icon in the top app bar.
- Choose your preferred AI provider:
- Google Gemini: Enter your Google AI Studio API key.
- OpenRouter / OpenAI: Configure your custom API key and select from hundreds of hosted language models.
- Custom Self-Hosted Endpoint: Point to a local Ollama or vLLM server over your local network.
- Save the configuration and verify connection status.
- Tap New Chat or open an existing session from the navigation drawer.
- Type your diagnostic query or choose from prompt suggestion chips.
- Review the proposed analysis and generated commands.
- If a command is proposed, verify the syntax displayed in the permission card and tap Allow to execute.
Prompt: "Check why my battery is draining fast when the screen is off."
Generated Action: dumpsys batterystats --charged
Result: Identifies wakelocks and misbehaving background services, suggesting targeted `cmd appops` adjustments.
Prompt: "List all pre-installed carrier apps that can be safely disabled."
Generated Action: pm list packages -s
Result: Compares discovered packages against known system bloatware signatures and presents safe disable scripts.
| Symptom | Probable Cause | Recommended Resolution |
|---|---|---|
Assistant returns API Key invalid or quota exceeded
|
Missing or expired provider API key | Open AI settings from the top bar and re-verify your API key and provider balance. |
| Command fails to execute after tapping Allow | Active ADB connection lost | Ensure your device is still connected via Local ADB, Shizuku, or OTG before confirming execution. |
| Response generation hangs indefinitely | Network timeout or provider endpoint latency | Tap the Stop generation icon and retry, or switch to a faster model endpoint in settings. |
| Inadvertent persistent permission granted | Rule added via "Always allow" | Navigate to AI Settings > Permission Rules to audit and remove any unwanted automatic approval grants. |
If you run into any issues or want to ask questions, feel free to:
- Join our Telegram Community
- Open an Issue on GitHub
- Local ADB Guide
- TCP/IP Setup Guide
- Wireless Debugging Setup
- OTG ADB Setup Guide
- Fastboot over OTG Guide
- USB Debugging Setup

