Skip to main content

A tiny Linux command whisperer that suggests shell commands based on natural language.

Project description

A tiny Linux command whisperer (Alpha version)

WHIS is a tiny Linux command whisperer/generator based on LLM, written in Python.

The main goals are:

  • minimal interruption of the workflow
  • fast
  • free and unlimited suggestions (with local LLM)
  • privacy (with local LLM)
  • minimalistic interface

Alpha version

Please note that this is an Alpha version and is not ready for production use.
So far it's only tested on Ubuntu 24.04 and Python 3.12.

Usage

Showcase

Install

  1. Install pipx
  2. Install WHIS with pipx
    • pipx install whis
  3. Configure your provider and model by either
    • a) Config file: ~/.config/whis/config.toml (or XDG_CONFIG_HOME/whis/config.toml if you use a different location)
      • create/edit the file with:
        llm_provider = "ollama"   # e.g. ollama, openai
        llm_model = "qwen2:7b"    # e.g. qwen2:7b, gpt-4o-mini
        
    • b) Environment variables (have priority over config file)
      • WHIS_LLM_PROVIDER
      • WHIS_LLM_MODEL
  4. Run whis interactive session by running whis in terminal

Todo (business logic)

  • one-shot mode: whis "list mp3 files" without the interactive session
  • explain command that sends request for a brief explanation of the command
    • should use a new conversation without a previous context
  • continue - loads old session and continues refining
  • API support
    • Gemini
    • Anthropic
    • OpenAI-compatible API (LM Studio, LocalAI...)
  • dangerous commands red warning (e.g. rm stuff)
  • whis inner history - arrow up should get the latest input even after session restart
  • interactive configuration

    • whis config
      • provider, model
      • action - copy+paste, copy, maybe execute?
  • other modes (current "quit then paste" feels unreliable)
    • copy to clipboard
    • execute directly (dangerous)
  • more dynamic context in system prompt (OS, pwd, git branch, etc.) - some might need user permission
  • command syntax check before suggestion
  • use one specific color for all responses and another for user inputs

Todo (technical)

  • Python versions support (3.10+)
  • tests
  • consider click for CLI
  • checks
    • flake8
    • black
    • isort
    • mypy
  • better command pasting (now it uses xdotool and xclip with process forking) using bash functions
  • there seems to be a conflict between black and ruff

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

whis-0.1.0a4.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

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

whis-0.1.0a4-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file whis-0.1.0a4.tar.gz.

File metadata

  • Download URL: whis-0.1.0a4.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for whis-0.1.0a4.tar.gz
Algorithm Hash digest
SHA256 eb045809d1c4723ae95b2554aa156e1b8811e0de2f7827584c6589c77e8d1fac
MD5 c3809e02130e29fe5e4100b2690a76b7
BLAKE2b-256 69c9c783e7afa8d42b295567b4630df68f72625eb6cc8c955079f2108daddd45

See more details on using hashes here.

File details

Details for the file whis-0.1.0a4-py3-none-any.whl.

File metadata

  • Download URL: whis-0.1.0a4-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for whis-0.1.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 99827a4fb3af15ffe5d18e710c418d3ae45cbef5b219defeb4e67bc0e8dd73df
MD5 4a7b464dbe35679bace12a4f051eb35a
BLAKE2b-256 6b95e4f42f57adce775c9da439992276418cc36c733ab8190a7d717a977f812f

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