QCMD is a powerful command-line tool that generates shell commands from natural language descriptions using Qwen2.5-Coder via Ollama. The tool now features a modular architecture for improved maintainability and extensibility.
- Generate shell commands from natural language descriptions
- Interactive shell with command history and autocompletion
- Auto-correction mode that fixes commands automatically
- Log analysis and monitoring with AI assistance
- System status monitoring and configuration management
- Safe command execution with dangerous command detection
- Highly customizable UI with color themes and display options
pip install ibrahimiq-qcmdgit clone https://github.com/aledanee/qcmd.git
cd qcmd
pip install -e .Make sure you have Ollama installed and running with the Qwen2.5-Coder model:
ollama pull qwen2.5-coder:0.5b
ollama serveThere are several ways to run QCMD:
- Using the installed command:
qcmd "list all files in the current directory"- Using the Python module:
python -m qcmd_cli "list all files in the current directory"- Using the wrapper script (if in project directory):
./qcmd "list all files in the current directory"- Using the run_qcmd.py script (if in project directory):
./run_qcmd.py "list all files in the current directory"qcmd "list all files in the current directory"qcmd --execute "check disk space"qcmd --shellqcmd --logsqcmd --statusQCMD has been refactored into a modular architecture for better maintainability and extensibility. The main components are:
qcmd_cli.core.command_generator: Generates and executes shell commandsqcmd_cli.core.interactive_shell: Interactive shell functionality
qcmd_cli.utils.history: Command history managementqcmd_cli.utils.session: Session managementqcmd_cli.utils.system: System status and monitoring
qcmd_cli.log_analysis.analyzer: Log content analysisqcmd_cli.log_analysis.log_files: Log file discovery and selectionqcmd_cli.log_analysis.monitor: Log file monitoring
qcmd_cli.ui.display: UI elements and formatting
qcmd_cli.config.settings: Configuration management
qcmd_cli.commands.handler: Command-line argument parsing and execution
See MODULAR_ARCHITECTURE.md for a detailed explanation of the modular design.
- Clone the repository:
git clone https://github.com/aledanee/qcmd.git
cd qcmd- Install in development mode:
pip install -e .- Install development dependencies:
pip install pytestRun the tests to verify the modular architecture:
python -m pytest tests/qcmd/
├── qcmd_cli/ # Main package
│ ├── commands/ # Command handlers
│ ├── config/ # Configuration management
│ ├── core/ # Core functionality
│ ├── log_analysis/ # Log analysis modules
│ ├── ui/ # User interface
│ └── utils/ # Utility modules
├── tests/ # Test suite
└── run_qcmd.py # Entry point script
Contributions are welcome! Here's how you can contribute:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and commit them:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature-name - Submit a pull request
Please make sure to update tests as appropriate and ensure all tests pass before submitting a pull request.
QCMD stores configuration in ~/.qcmd/config.json. You can customize:
- Default model
- Temperature for generation
- UI settings (banner, colors, compact mode)
- Update checking behavior
- Maximum attempts for auto-correction
MIT
Powered by Ollama and Qwen2.5-Coder.