AI-powered command line tool using local LLM
Project description
iCMD
iCMD is a local AI-powered command-line assistant that turns natural language prompts into Linux shell commands, runs the generated command, and prints the result back to your terminal.
It uses a fine-tuned Qwen-based GGUF model hosted on Hugging Face and runs inference locally through a bundled llama-cli binary.
Features
- Converts plain-English requests into bash commands using a fine-tuned local model
- Executes commands directly from the CLI with a simple
icmd "..."interface - Downloads the fine-tuned model automatically on first run
- Runs fully locally using a bundled
llama-clibinary and GGUF weights - Includes basic safety blocking for dangerous commands and shell operators
- Works without a hosted LLM API after the model is downloaded
Usage Examples
icmd "list all files in this directory"
icmd "print the current working directory"
icmd "show hidden files"
icmd --author
Example output:
$ icmd "print the current working directory"
/home/your_root_directory
Requirements
Before using iCMD, make sure the target system has:
- Python 3.8 or newer
pip,uv, orpipxfor installation- a Linux x86_64 environment that can run the bundled
llama-clibinary - network access on first run so
iCMDcan download the fine-tuned model from Hugging Face - A Linux environment, since the tool generates bash commands
Fine-Tuned Model
iCMD uses the fine-tuned model published at:
MSDeepak718/qwen-icmd
The downloaded model file is:
qwen-icmd-q4.gguf
On first run, iCMD downloads the model to:
~/.icmd_model/qwen-icmd-q4.gguf
After that, inference runs locally using the bundled llama-cli executable inside the package.
Installation
Install from PyPI with uv
For CLI tools, uv tool install is the cleanest option:
uv tool install icmd-cli
After installation:
icmd "list all files"
To upgrade later:
uv tool upgrade icmd-cli
Install with pipx
pipx install icmd-cli
How It Works
- You pass a natural-language prompt to
icmd. - If needed, the app downloads the fine-tuned GGUF model from Hugging Face.
- The app runs the prompt locally through the bundled
llama-clibinary. - The command is cleaned and checked against a small denylist of dangerous commands and shell symbols.
- If the command is allowed,
iCMDexecutes it and prints the output.
Safety Notes
iCMD includes basic filtering, but it should still be treated as a developer tool and used carefully.
The current safety layer blocks commands involving items such as:
- destructive filesystem tools like
rmandmkfs - privilege escalation commands like
sudoandsu - remote/network-oriented commands like
curl,wget,scp, andssh - shell operators such as
;,|,&, and output redirection
This is a simple safety layer, not a security sandbox.
CLI Reference
Run a natural-language request:
icmd "your query"
Print the package author:
icmd --author
If no argument is provided, the CLI shows:
Usage: icmd "your query"
Project Structure
icmd/
├── bin/
│ └── llama-cli
├── executor.py
├── llm.py
├── main.py
├── safety.py
└── utils.py
pyproject.toml
README.md
Troubleshooting
externally-managed-environment
Your system Python is managed by the OS. Use a virtual environment, uv, or pipx instead of installing globally with pip.
The first run takes time
This is expected. iCMD downloads the fine-tuned model the first time you use it.
Model download fails
Make sure you have working network access and that Hugging Face is reachable from your machine.
llama-cli is missing
If icmd fails with a missing icmd/bin/llama-cli error, the installed package likely does not include the bundled binary. Reinstall or upgrade to the latest published version of icmd-cli.
The package installs but icmd fails at runtime
Check that:
~/.icmd_model/qwen-icmd-q4.gguf
- the model file exists locally
- the installed package version is the latest one you published
- the installed package includes the bundled
llama-clibinary
Author
Built with ❤️ By Deepak Karthick
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 icmd_cli-0.1.9.tar.gz.
File metadata
- Download URL: icmd_cli-0.1.9.tar.gz
- Upload date:
- Size: 4.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9df950cd2387c915724f4225c57e5489ffa4ee9c519bbd697b5b94cd4d0daef5
|
|
| MD5 |
0dd98bb147bf42de58a6130754894619
|
|
| BLAKE2b-256 |
d65e1a8a53c2f12ed31486b4c9981d5795dcefb08243b2676d9ceee82f9f5b93
|
File details
Details for the file icmd_cli-0.1.9-py3-none-any.whl.
File metadata
- Download URL: icmd_cli-0.1.9-py3-none-any.whl
- Upload date:
- Size: 4.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9221b18ebdb15be6457176da47bb4a3cbf14f95794ba2ceeb55a364b14288a8a
|
|
| MD5 |
ec0bb5c2e36de284140151e68d0c5aad
|
|
| BLAKE2b-256 |
f8e5e2212286491892c283018d63370d6054b50d7f07de5ce47625a1c2ec267e
|