b245af90633610c294f8ba6a7ec1eec285f2ac9f
新增 android_compat.py (3552行):
全面映射 Android Java API 到 Python 跨平台实现,覆盖 16 个领域、108 个 API 对象:
android.content: Intent(20+actions), Context, ContentResolver, ContentValues,
BroadcastReceiver, IntentFilter, SharedPreferences
android.net: Uri (parse/fromFile/withAppendedPath)
android.os: Build, Environment, PowerManager, BatteryManager, VibrationEffect,
Bundle, Handler, Looper, ParcelFileDescriptor
android.graphics: Bitmap (PIL后端), Canvas, Color, Paint, Rect, Matrix,
Typeface, BitmapFactory
android.graphics.pdf: PdfRenderer (PyMuPDF/pdf2image后端)
android.app: ActivityManager, PackageManager(包查询), NotificationManager,
AlarmManager, DownloadManager
android.view: View, TextView, EditText, Button, ImageView, ScrollView,
ViewGroup, LinearLayout, FrameLayout, RelativeLayout
android.view.accessibility: AccessibilityNodeInfo (UI树+pyautogui点击),
AccessibilityPage, UINode
android.hardware: SensorManager, CameraManager, BiometricPrompt
android.location: LocationManager(模拟GPS), Geocoder, Location(Haversine)
android.media: MediaPlayer, AudioRecord, AudioManager
android.telephony: TelephonyManager
android.provider: Settings, MediaStore, CalendarContract, ContactsContract
android.net.wifi: WifiManager, WifiInfo + ConnectivityManager
android.os.storage: StorageManager, StorageVolume
java.io: File, FileInputStream/OutputStream, BufferedReader, BufferedWriter
Java桥接: Java.type() 支持直调真实Java类(jpype)或返回存根
系统服务: 10+ 模拟服务 (ActivityManager/PowerManager/etc)
路径映射: /sdcard → ~/Android-compat/sdcard
UI自动化: UINode + pyautogui 桌面降级
绘图: Bitmap/Canvas → PIL/Pillow 后端
集成到 operit_runtime.py: 自动检测并注入108个Android API到脚本命名空间
测试结果:
- 语法检查: android_compat.py ✅, operit_runtime.py ✅
- 路径映射: /sdcard → /root/Android-compat/sdcard ✅
- Intent/Uri/Context/Bitmap/File 全API ✅
- 脚本加载: 38脚本 280工具 ✅
XiaoLi Pro-CLI
AI Programming Assistant — Code Editing · Git · Browser Automation · Multi-Agent
Features
- Dual AI Engines — Ollama local + OpenAI compatible (DeepSeek, Grok, SiliconFlow, etc.)
- Code Editing & Search — Precise replace, batch edit, symbol extraction, regex search
- Git Integration — Full Git operations + workflow automation
- Browser Automation — Playwright-driven, navigate/interact/screenshot/JS execution
- Sub-Agent System — Multi-agent parallel collaboration with task delegation
- Unified Safety — AI risk analysis + 3-mode switching (Normal/Manual/Unrestricted)
- 15 Plugins, 141 Operations — Code, Git, browser, engineering, file management, etc.
- 113 Automated Tests — pytest coverage for all plugins and core modules
Quick Start
git clone https://gitee.com/shuiyu1123/xiaoli-cli.git
cd xiaoli-cli
pip install -r requirements.txt
python ai_cli.py
AI Engines
| Engine | Type | Description |
|---|---|---|
ollama |
Local | Ollama local models, no API key needed |
openai |
Cloud/Local | OpenAI compatible: DeepSeek, Grok, SiliconFlow, local vLLM |
Plugins (15)
Core Productivity
| Plugin | Ops | Description |
|---|---|---|
code_editor |
23 | Code editing + search. replace/batch/find/regex/symbols/imports/callers/todo |
git_tools |
20 | Git. status/diff/log/commit/branch + smart-commit/changelog/contributors |
cmd_executor |
1 | Shell commands. Cross-platform, timeout, danger blocking |
file_manager |
11 | File system. list/read/write/copy/move/delete/search/info/mkdir |
auto_engineer |
16 | Engineering. lint/format/test/build/deps + complexity/security/metrics |
task_manager |
7 | Task tracking. add/list/complete/delete/clear with JSON persistence |
Advanced
| Plugin | Ops | Description |
|---|---|---|
sub_agent |
8 | Sub-Agent system. spawn/list/status/result/send/kill, parallel collaboration |
browser_auto |
31 | Browser automation. navigate/click/fill/screenshot/JS/PDF/cookies |
tool_search |
— | Tool discovery. Search available plugins by keyword |
Utilities
| Plugin | Description |
|---|---|
network_tools |
ping/get/status/headers/ip |
ai_search |
AI search via jina.ai + web content extraction |
frontend_tester |
HTML/CSS/JS syntax check, responsive validation |
speech_recognition |
Voice recording + speech-to-text |
audio_player |
Audio playback |
send_image |
Send images to phone (Clawli mode) |
Safety
Three modes (/safe to switch):
| Mode | Icon | Behavior |
|---|---|---|
| Normal (default) | AI analyzes risk, confirms only when risk detected | |
| Manual | All commands require user confirmation | |
| Unrestricted | Execute directly, no checking |
Testing
python -m pytest tests/ -v # 113 tests
License
Releases
3