Privacy-first AI coding assistant for Termux
Project description
๐ง Sheikh-CLI
A privacy-first AI coding assistant that runs entirely on your Android device through Termux
Overview
The Termux Local Coding Agent is a powerful, privacy-focused development tool that transforms your Android device into a local AI coding assistant. Built specifically for Termux, it provides natural language interaction with your code while maintaining complete privacy through local operation.
โจ Features
๐ Privacy-First
- 100% Local Operation - No cloud dependencies, no data transmission
- Secure Sandbox - Whitelisted commands with timeout protection
- Privacy Configuration - Full control over what data is processed
๐ ๏ธ Development Tools
- File Operations - Read, write, search, and manage files safely
- Code Analysis - Search patterns, find functions, analyze code structure
- Git Integration - Status, diff, commit, and branch management
- Shell Commands - Safe execution of development tools
๐ค AI-Powered
- Natural Language Interface - Describe tasks in plain English
- Intent Detection - Automatically maps requests to appropriate tools
- Local LLM Support - Integration with llama.cpp for offline inference
- No-Code CLI - Predefined actions for common development tasks
๐ฑ Mobile-Optimized
- Termux Integration - Built specifically for Android Termux environment
- Resource Efficient - Optimized for mobile hardware constraints
- Battery Conscious - Intelligent resource management
- Portable Development - Full development environment in your pocket
๐ Quick Start
Prerequisites
- Android device with Termux installed
- 4GB+ RAM (8GB recommended)
- 2GB+ free storage
- Internet connection for setup
Installation
-
Install Termux
# Download from F-Droid or GitHub # Launch Termux and grant storage permissions termux-setup-storage
-
Run Setup Script
# Copy setup_termux.sh to Termux bash setup_termux.sh
-
Start Using
# Activate environment source ~/coding-agent/.venv/bin/activate # Interactive mode python ~/coding-agent/src/run_agent.py interactive # Single command python ~/coding-agent/src/run_agent.py prompt "list files in workspace"
๐ก Usage Examples
File Operations
# Read a file
python src/run_agent.py prompt "read config.json"
# Create a new Python script
python src/run_agent.py prompt "create hello.py with print('Hello World')"
# List project files
python src/run_agent.py prompt "show all Python files in the project"
Code Analysis
# Search for patterns
python src/run_agent.py prompt "find all function definitions in Python files"
# Search imports
python src/run_agent.py prompt "show all import statements"
# Code statistics
python src/run_agent.py prompt "count lines of code in the project"
Git Operations
# Check repository status
python src/run_agent.py prompt "git status"
# View changes
python src/run_agent.py prompt "git diff"
# Show commit history
python src/run_agent.py prompt "git log --oneline -5"
Interactive Mode
# Start interactive session
python src/run_agent.py interactive
Example conversation:
You: help
Agent: [Shows available commands]
You: read the main script
Agent: [Reads and displays file content]
You: find all functions
Agent: [Searches and lists functions]
You: git status
Agent: [Shows git repository status]
You: quit
Agent: Goodbye! ๐
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ CLI Interface โ โ Orchestrator โ โ Tool Plugins โ
โ โ โ โ โ โ
โ โข Interactive โโโโโถโ โข Intent โโโโโถโ โข File Ops โ
โ โข Single Prompt โ โ Detection โ โ โข Shell Cmds โ
โ โข Help System โ โ โข Tool Routing โ โ โข Code Search โ
โ โ โ โข Error Handling โ โ โข Git Ops โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโถโ Security โโโโโโโโโโโโโโโโ
โ Sandbox โ
โ โ
โ โข Whitelisting โ
โ โข Timeouts โ
โ โข Directory โ
โ Restrictions โ
โโโโโโโโโโโโโโโโโโโโ
๐ก๏ธ Security
Command Safety
- Whitelist Only - Only predefined safe commands execute
- Timeout Protection - Prevents infinite or long-running operations
- Directory Restrictions - Access limited to allowed directories
- Output Filtering - Sensitive data filtered from logs
Privacy Protection
- Local Processing - All AI inference happens on-device
- No Telemetry - Zero data transmission to external services
- Secure Storage - Configuration and logs encrypted when possible
- Audit Logging - Full activity tracking without sensitive data
โ๏ธ Configuration
Basic Configuration
{
"model": {
"type": "local_first",
"llama_cpp_path": "/path/to/llama.cpp/main",
"model_path": "/path/to/model.ggml"
},
"security": {
"sandbox_enabled": true,
"max_execution_time": 30,
"allowed_directories": ["/home/coding-agent"]
}
}
Advanced Options
- Model Integration - Support for various local LLMs
- Custom Tools - Add your own plugins
- Performance Tuning - Optimize for your device
- Extended Whitelist - Add trusted commands
๐ Performance
Recommended Hardware
| Component | Minimum | Recommended |
|---|---|---|
| RAM | 4GB | 8GB+ |
| Storage | 2GB | 5GB+ |
| CPU | Quad-core | Octa-core |
Optimization Tips
- Use smaller quantized models (4-bit)
- Enable battery optimization
- Monitor memory usage
- Clear logs regularly
๐ง Development
Project Structure
~/coding-agent/
โโโ src/
โ โโโ run_agent.py # Main application
โโโ tools/
โ โโโ file_operations.py # File management
โ โโโ shell_commands.py # Safe shell execution
โ โโโ code_search.py # Code analysis
โ โโโ git_operations.py # Git integration
โโโ config/
โ โโโ agent_config.json # Configuration
โโโ models/ # Local LLM models
โโโ logs/ # Application logs
โโโ requirements.txt # Python dependencies
Adding New Features
- Create tool plugin in
tools/ - Register in orchestrator
- Add intent detection
- Update configuration
- Document usage
๐ Troubleshooting
Common Issues
Setup Fails
# Check Termux installation
pkg list-installed
# Update packages
pkg update && pkg upgrade
Permission Errors
# Grant storage access
termux-setup-storage
# Fix directory permissions
chmod -R 755 ~/coding-agent
Model Loading Issues
# Verify llama.cpp
cd ~/coding-agent/llama.cpp && ls -la main
# Test model
./main -m model.ggml -p "test"
Getting Help
- Check the complete tutorial
- Review troubleshooting section
- Examine logs in
~/coding-agent/logs/ - Test with simple commands first
๐ค Contributing
We welcome contributions! Please:
- Follow the modular architecture
- Add comprehensive error handling
- Include security considerations
- Document new features
- Test on multiple devices
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Termux Team - For the excellent Android terminal environment
- llama.cpp - For enabling local LLM inference
- Rich Library - For beautiful terminal interfaces
- Open Source Community - For inspiration and tools
๐ Support
- Documentation: See TUTORIAL.md
- Issues: Report bugs and feature requests
- Community: Join the Termux community
Built with โค๏ธ for developers who value privacy and portability
Transform your Android device into a powerful, private development environment with the Termux Local Coding Agent.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sheikh_cli-1.0.0.tar.gz.
File metadata
- Download URL: sheikh_cli-1.0.0.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0d9948109dc75d1ccfb5771319456a901b342e7abcc6e4e80935bef1b587f34
|
|
| MD5 |
bd72d4b4f352223e98ae56a6f558db76
|
|
| BLAKE2b-256 |
7669b10af41f294d8432b6825e46196b29a5e98681f973f1c2f2ac22f445e35c
|
File details
Details for the file sheikh_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: sheikh_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23b900fa93d0189cf11ff13a7a43117147779db49d95b045eb845633281f1e1a
|
|
| MD5 |
a2b3e926c365b604a4e2d290811a51df
|
|
| BLAKE2b-256 |
7663e9afa854457e8cfbe912cff6b6495162c3386f1d51b91a6cd2af3a3ccffa
|