Skip to content

ManojMJ17/Command_IQ

Repository files navigation

Command IQ (CIQ) — Natural Language to Linux Commands

Command IQ (CIQ) is an offline, inference-based AI system that converts natural language instructions into Linux commands using pretrained FAISS and T5 models.


About AI Usage

Command IQ does not use online AI services (such as ChatGPT or OpenAI APIs).

All predictions are generated locally and offline using:

  • Semantic vector search (FAISS)
  • A pretrained transformer model (T5) for inference

No runtime training or external AI calls are performed.

⚡ Features

  • Convert English instructions into working Linux commands
  • Works fully offline using prebuilt FAISS + T5 model assets
  • CPU-first design — GPU is optional, not required
  • Supports Kali Linux, Ubuntu, Debian, WSL, and virtual machines
  • Global CLI available from any directory using the ciq command
  • Automatic setup using a single installer script (install_ciq.sh)
  • Idempotent installer — safe to run multiple times

🚀 Quick Installation

1️⃣ Clone the repository

git clone https://github.com/ManojMJ17/Command_IQ.git
cd Command_IQ

2️⃣ Install Python 3.11 (required)

⚠️ Important Python 3.11 is required. Python 3.12 / 3.13 are not supported due to PyTorch and FAISS compatibility issues.

sudo apt update
sudo apt install -y \
  python3.11 \
  python3-dev \
  python3-pip \
  build-essential \
  curl unzip

3️⃣ Run the installer

chmod +x install_ciq.sh
./install_ciq.sh

The installer will:

  • Create a Python 3.11 virtual environment
  • Install all required dependencies (CPU-only PyTorch)
  • Download & extract FAISS index and T5 model
  • Create the global ciq CLI command

Optional Installer Flags

If assets are already downloaded:

./install_ciq.sh --no-download

Force re-download of assets:

./install_ciq.sh --force-download

🖥️ Verify Installation

ciq "check disk usage"

Example output:

Query         : check disk usage
Final Suggest : df -h

🧠 CPU vs GPU Support

Command IQ works fully on CPU.

  • FAISS is used in CPU mode
  • T5 model is used for inference only
  • GPU / CUDA is optional, not required

CIQ works perfectly on:

  • Kali Linux
  • Virtual machines
  • WSL
  • Systems without NVIDIA GPUs

🐉 Kali Linux Notes (Important)

  • Kali Linux ships with Python 3.13 by default
  • CIQ requires Python 3.11
  • The installer handles this automatically

If ciq is not found after installation (zsh users):

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

📦 Download Size Notice

  • FAISS index: ~200 MB
  • T5 model assets: ~1.1 GB

On slower or mobile networks:

  • Downloads may take several minutes
  • The installer supports resume on interruption

🧪 Usage

ciq "<natural language query>"

Examples

ciq "install VLC media player"
ciq "list all files recursively"
ciq "show current disk usage"

The CLI displays:

  • FAISS suggestion
  • T5 model suggestion
  • Final merged Linux command
  • Optional confirmation before execution

📂 Directory Structure After Installation

~/.ciq/
├─ src/
│  ├─ cli/
│  │  ├─ __init__.py
│  │  ├─ main.py
│  │  └─ predict.py
│  ├─ model/
│  │  ├─ saved_model/t5_base_resumed.pt
│  │  ├─ t5_base_arch/
│  │  └─ t5_base_tokenizer/
│  └─ faiss_index/
│     ├─ faiss_index_combined.index
│     └─ faiss_metadata_combined.pkl
├─ venv/
└─ bin/
   └─ ciq   (global CLI wrapper)

🧰 Troubleshooting

ciq: command not found

export PATH="$HOME/.local/bin:$PATH"

Python not found

sudo apt install python3.11 -y

Dependency installation failed

./install_ciq.sh

📜 License

MIT License — see the LICENSE file.


🧠 Author

Manoj Kumar GitHub: https://github.com/ManojMJ17


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors