Skip to content

AI Shell Assistant Guide

DP-Hridayan edited this page Nov 17, 2026 · 1 revision

AI Shell Assistant Guide

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.


Interface Overview

AI Chat Interface
Diagnostic Chat Interface
Command Execution Approval Gate
Execution Approval Gate

Core Capabilities

  • 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, and cmd to 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 dumpsys queries).
  • Multi-Provider LLM Backend: Flexible integration supporting Gemini, OpenAI-compatible APIs, OpenRouter, and custom endpoints.

Safety Architecture and Approval Gate

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.

Configuration and Model Setup


1. Setting Up an LLM Provider

  1. Open the AI Assistant tab.
  2. Tap the settings/tuning icon in the top app bar.
  3. 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.
  4. Save the configuration and verify connection status.

2. Initiating a Diagnostic Session

  1. Tap New Chat or open an existing session from the navigation drawer.
  2. Type your diagnostic query or choose from prompt suggestion chips.
  3. Review the proposed analysis and generated commands.
  4. If a command is proposed, verify the syntax displayed in the permission card and tap Allow to execute.

Example Prompt Scenarios


Battery Drain Investigation

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.

Bloatware Removal Assistance

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.

Troubleshooting

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.

Clone this wiki locally