AI-powered terminal assistant with natural language processing, git integration, system monitoring, and enhanced features
Project description
Smart Terminal 🚀 v2.0.2
AI-powered terminal assistant that converts natural language to shell commands. Works seamlessly on Windows, macOS, and Linux with enhanced features and capabilities.
🆕 v2.0.2 - Windows Compatibility Fix
- Fixed: Windows shell detection now properly identifies Command Prompt vs PowerShell
- Added: Automatic fallback when shell commands fail (PowerShell → CMD)
- Added: Manual shell override with
--shell cmdor--shell powershell - Fixed: No more "'New-Item' is not recognized" errors in Command Prompt
✨ Enhanced Features
Core Features
- Natural Language Processing: Just type what you want to do in plain English
- Cross-Platform: Works on Windows, macOS, and Linux
- Smart Learning: Learns from your command history to provide better suggestions
- Safe Execution: Prevents dangerous commands from running
- Interactive Mode: Chat with your terminal naturally
- AI-Powered Suggestions: Get intelligent command recommendations
🆕 New in v2.0
- Git Integration: Full git workflow support with natural language
- System Monitoring: Check processes, memory, disk usage, and more
- Network Operations: Ping, download, and network diagnostics
- Text Processing: Advanced text manipulation and search
- Command Bookmarks: Save and reuse frequently used commands
- Command History: Track and replay previous commands
- Workflow Suggestions: Get next-step recommendations
- Enhanced Safety: Multiple safety levels and confirmations
- Plugin System: Extensible architecture for custom commands
- Smart Completions: Context-aware command completions
🚀 Quick Start
Installation
# Install from PyPI (recommended)
pip install smart-terminal-ai
# Or install from source
git clone https://github.com/yourusername/smart-terminal.git
cd smart-terminal
pip install -e .
Usage
# Interactive mode
smart-terminal
# Direct command
smart-terminal "make a folder called my_project"
# Short alias
st "create a backup of my documents"
📖 Command Examples
File Operations
| What you type | What it executes |
|---|---|
| "make a folder called random" | mkdir random |
| "delete the old backup folder" | rm -rf backup/ |
| "show all hidden files" | ls -la |
| "copy file.txt to documents" | cp file.txt documents/ |
| "compress my project folder" | tar -czf project.tar.gz project/ |
Git Operations
| What you type | What it executes |
|---|---|
| "git init new repository" | git init |
| "add all files to git" | git add . |
| "commit with message fix bug" | git commit -m 'fix bug' |
| "push to main branch" | git push origin main |
| "clone repository from url" | git clone <url> |
System Operations
| What you type | What it executes |
|---|---|
| "show running processes" | ps aux (Unix) / Get-Process (Windows) |
| "check disk usage" | df -h (Unix) / Get-WmiObject Win32_LogicalDisk (Windows) |
| "show memory usage" | free -h (Unix) / Get-WmiObject Win32_ComputerSystem (Windows) |
| "system uptime" | uptime (Unix) / Get-Uptime (Windows) |
Network Operations
| What you type | What it executes |
|---|---|
| "ping google.com" | ping -c 4 google.com |
| "download file from url" | curl -o file url |
| "show network ports" | netstat -tuln |
| "show ip address" | ifconfig / ipconfig |
Text Processing
| What you type | What it executes |
|---|---|
| "edit file.txt" | nano file.txt / notepad file.txt |
| "search for pattern in files" | grep -r pattern . |
| "count lines in file.txt" | wc -l file.txt |
| "show first 10 lines of file" | head -n 10 file |
🖥️ Platform Support
- Windows: PowerShell commands with native Windows tools
- macOS: Unix commands with native macOS tools
- Linux: Unix commands with native Linux tools
🪟 Windows Compatibility
Smart Terminal automatically detects whether you're using PowerShell or Command Prompt (cmd.exe) and provides the correct commands for each shell.
Automatic Shell Detection
- PowerShell: Uses
New-Item,Remove-Item,Get-ChildItemcommands - Command Prompt: Uses
mkdir,rmdir,dircommands
Manual Shell Override
If you need to force a specific shell type:
# Force Command Prompt mode
st --shell cmd "make a folder vi"
# Force PowerShell mode
st --shell powershell "make a folder vi"
Common Windows Issues
- Error: 'New-Item' not recognized: You're in Command Prompt, use
st --shell cmd - Error: 'mkdir' not recognized: You're in PowerShell, use
st --shell powershell
📖 See WINDOWS_COMPATIBILITY.md for detailed Windows usage guide.
🧠 AI Features
Smart Learning
- Remembers your command patterns and preferences
- Suggests commands based on usage history
- Learns from successful executions
- Adapts to your workflow over time
Context-Aware Suggestions
- Git Operations: Complete git workflows and best practices
- Python Development: Virtual environments, package management
- Node.js Workflows: npm commands and project management
- Docker Operations: Container management and deployment
- System Administration: Process management, monitoring
- Network Operations: Connectivity testing, file downloads
Workflow Intelligence
- Suggests logical next steps after commands
- Provides complete workflow guidance
- Learns common command sequences
- Offers alternatives for failed commands
Enhanced Safety Features
- Multiple Safety Levels: Low, Medium, High protection
- Dangerous Command Detection: Prevents system damage
- Confirmation Prompts: For destructive operations
- Sandbox Mode: Test commands without execution
- Backup Suggestions: Automatic backup recommendations
📦 Requirements
- Python 3.8+
- Rich terminal support
- Git (optional, for git features)
- Internet connection (for AI features and downloads)
🔧 Advanced Configuration
Smart Terminal creates a configuration file at ~/.smart_terminal/config.json with extensive customization options:
General Settings
{
"general": {
"confirm_dangerous_commands": true,
"show_suggestions": true,
"max_suggestions": 5,
"suggest_bookmarks": true,
"command_timeout": 30
}
}
AI Settings
{
"ai": {
"enable_learning": true,
"suggestion_threshold": 0.5,
"max_history_size": 1000,
"enable_context_suggestions": true
}
}
Safety Settings
{
"safety": {
"check_dangerous_patterns": true,
"require_confirmation_for_deletion": true,
"sandbox_mode": false,
"backup_before_delete": false
}
}
🚀 Advanced Usage
Interactive Mode Commands
st
# Then type naturally:
# "help" - Show comprehensive help
# "stats" - View detailed usage statistics
# "config" - Show current configuration
# "history" - View command history
# "bookmark <name> <command>" - Save command
# "clear" - Clear screen
# "version" - Show version information
# "install" - Install shell integration
Bookmarks and Aliases
# Save frequently used commands
bookmark deploy "git add . && git commit -m 'Deploy' && git push"
bookmark backup "tar -czf backup-$(date +%Y%m%d).tar.gz ."
# Use bookmarks
st deploy
st backup
Command History
# View recent commands
history
# Repeat commands from history
!5 # Repeat 5th command from history
Shell Integration
Install shell integration to use st command directly:
# In interactive mode, type:
install
# Or manually add to your shell profile
# For zsh/bash: ~/.zshrc or ~/.bashrc
# For PowerShell: PowerShell profile
🛠️ Development
Setup Development Environment
git clone https://github.com/yourusername/smart-terminal.git
cd smart-terminal
pip install -e ".[dev]"
Run Tests
pytest
pytest src/smart_terminal/tests/test_enhanced_features.py
Code Formatting
black src/
flake8 src/
Plugin Development
Create custom plugins by extending the command mapper and builder:
# Example plugin structure
class CustomPlugin:
def __init__(self):
self.commands = {
"custom_action": self.handle_custom_command
}
def handle_custom_command(self, intent):
return "custom command result"
📊 Enhanced Statistics
Track your usage with comprehensive analytics:
- Total Commands Executed: All-time command count
- Success Rate: Percentage of successful executions
- Most Used Patterns: Your favorite command types
- Platform Usage: Cross-platform usage statistics
- Session History: Current session command tracking
- Learning Progress: AI improvement metrics
- Bookmark Usage: Most used saved commands
🎯 Use Cases
Developers
- Git workflow automation
- Project setup and management
- Code deployment processes
- Development environment setup
System Administrators
- System monitoring and diagnostics
- Process management
- Network troubleshooting
- Automated maintenance tasks
Data Scientists
- File processing and manipulation
- Environment management
- Data pipeline operations
- Analysis workflow automation
DevOps Engineers
- Container management
- Deployment automation
- Infrastructure monitoring
- CI/CD pipeline management
🤝 Contributing
Contributions are welcome! Please read our Contributing Guide.
Development Roadmap
- Enhanced NLP with context awareness
- Git integration and workflows
- System monitoring capabilities
- Network operations support
- Command bookmarking system
- Plugin marketplace
- Web interface for configuration
- Team collaboration features
- Integration with popular IDEs
- Voice command support
- Machine learning model improvements
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built with Rich for beautiful terminal output
- Powered by Click for CLI framework
- Enhanced with GitPython for git integration
- System monitoring via psutil
- Inspired by modern AI-powered developer tools
📞 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Project Wiki
⭐ Star History
Smart Terminal v2.0 - Making terminal interactions intelligent, intuitive, and powerful. 🚀
Made with ❤️ for developers who want to work smarter, not harder.
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 smart_terminal_ai-2.0.2.tar.gz.
File metadata
- Download URL: smart_terminal_ai-2.0.2.tar.gz
- Upload date:
- Size: 36.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d90ccbad3842b652343ff0c19d3a0332aeccf36ef70891e3f1c9802986340b3
|
|
| MD5 |
bf931260e9b13e8ab60a01406cbfa434
|
|
| BLAKE2b-256 |
ff9df92bf8fdb3dad9eb47ac3170be6c71d11cdbd9beb6f61faef1bc1b2411e7
|
File details
Details for the file smart_terminal_ai-2.0.2-py3-none-any.whl.
File metadata
- Download URL: smart_terminal_ai-2.0.2-py3-none-any.whl
- Upload date:
- Size: 36.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e46cf1eef013fa6a70eeda985a0487dd39903daa1fba90aa5a03fda1ab8bc7e
|
|
| MD5 |
61eb2ecc817f80e1cc4f8fd22db3f302
|
|
| BLAKE2b-256 |
5863236e7393fc21896d1187837515f865f3153ceb8cc7c248e8b0b17fb6df85
|