Skip to main content

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.

Features

  • Converts plain-English requests into bash commands using a local Ollama model
  • Executes commands directly from the CLI with a simple icmd "..." interface
  • Includes basic safety blocking for dangerous commands and shell operators
  • Works fully with a local model setup instead of a hosted LLM API

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, or pipx for installation
  • Ollama installed and running
  • The qwen2.5-coder model available locally, or network access the first time so Ollama can pull it
  • A Linux environment, since the tool generates bash commands

To prepare Ollama manually:

ollama serve
ollama pull qwen2.5-coder

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

  1. You pass a natural-language prompt to icmd.
  2. The app sends the prompt to Ollama using the qwen2.5-coder model.
  3. The model returns a bash command.
  4. The command is cleaned and checked against a small denylist of dangerous commands and shell symbols.
  5. If the command is allowed, iCMD executes 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 rm and mkfs
  • privilege escalation commands like sudo and su
  • remote/network-oriented commands like curl, wget, scp, and ssh
  • 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/
├── 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.

Ollama is not installed or running.

Install Ollama and make sure the service is available at:

http://localhost:11434

The package installs but icmd fails at runtime

Check that:

  • Ollama is running
  • the qwen2.5-coder model exists locally
  • the installed package version is the latest one you published

Author

Built with ❤️ By Deepak Karthick

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

icmd_cli-0.1.7.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

icmd_cli-0.1.7-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file icmd_cli-0.1.7.tar.gz.

File metadata

  • Download URL: icmd_cli-0.1.7.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for icmd_cli-0.1.7.tar.gz
Algorithm Hash digest
SHA256 99ff59c1097fc2332d0cfc7528a04eecbca132bbc7027fd7c8ca563abd4a7c2d
MD5 22c5d60061471cdfa3ccecf0f469b9de
BLAKE2b-256 4daf4f42a2675169d41bfde6950824f9fba1ddaeb28ef4eeae89237549c49a6b

See more details on using hashes here.

File details

Details for the file icmd_cli-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: icmd_cli-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for icmd_cli-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 166a126772daac8dea8a2a8965b40b999214381cdcb34306e8a7efa4b8514add
MD5 1d1362f9f756cb75de3eb9e40befbcff
BLAKE2b-256 0e594e08f642c33bf9d754442f13b5197887d66d15cb48339c3420361807d8c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page