Skip to main content

Use LLM to generate commands for your shell

Project description

Shell completion using LLM

Use LLM to generate and execute commands in your shell.

https://github.com/user-attachments/assets/c10d7a0f-48c3-4904-bb1b-4a1ce9f9ff8d

Installation

Install this plugin in the same environment as LLM.

llm install llm-complete-command

Then install the shell integration for your preferred shell.

  • Fish: place share/llm-complete-command.fish in ~/.config/fish/conf.d/.
  • Zsh: source share/llm-complete-command.zsh in your ~/.zshrc.
  • Bash: source share/llm-complete-command.bash in your ~/.bashrc.

Usage

  1. Start typing a command.
  2. Activate the key binding (Alt-Backslash by default).
  3. Wait for the LLM to complete the command.
  4. Press enter if you are happy. Otherwise give feedback on the command and repeat from step 3.
  5. The LLM's command replaces the previous command you were writing.

Neat ways you can use this feature:

  • Type a command in English, convert it to bash.
    find all files larger than 100MB
    🪄 find . -type f -size +100M
  • Give extra instructions as comments.
    sed -i '' 's/search/replace/g' file.go # Now do it for all go files in the project
    🪄 find . -name '*.go' -exec sed -i '' 's/search/replace/g' {} +

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-cmd
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install llm
llm install -e .

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

llm_complete_command-2.2.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

llm_complete_command-2.2.0-py2.py3-none-any.whl (14.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file llm_complete_command-2.2.0.tar.gz.

File metadata

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

File hashes

Hashes for llm_complete_command-2.2.0.tar.gz
Algorithm Hash digest
SHA256 dbd47601abf81bbea2562f7fd37346c9c819170e794b5770665613a382fa534d
MD5 cc1677f917e2931b9f483f39ea362622
BLAKE2b-256 434cf49547cf1a3cc15885655c35798f9d5e843b9851622cc1a6b4d94561c74a

See more details on using hashes here.

File details

Details for the file llm_complete_command-2.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: llm_complete_command-2.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for llm_complete_command-2.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 22e8d59a6f812f72161de9121dc8e5e4d6f9a4f31e7363978475247199bc7efe
MD5 aeff29e0d93899137977718eda1da6c7
BLAKE2b-256 76e78a53f8271acad879ef0299f3808445c7734db03a9302e4a9e1f0c86e8125

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