Skip to main content

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-cmd-comp

Then install the shell integration for your preferred shell.

  • Fish: add llm cmdcomp --init fish | source in a file in ~/.config/fish/conf.d/.
  • Zsh: add eval "$(llm cmdcomp --init zsh)" to your ~/.zshrc.
  • Bash: add eval "$(llm cmdcomp --init bash)" to 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-comp
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install llm
llm install -e .

Metadata

Release files for llm-cmd-comp 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-cmd-comp 1.2.0
File Size Uploaded
llm_cmd_comp-1.2.0.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-cmd-comp 1.2.0
File Interpreter ABI Platform
llm_cmd_comp-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / llm_cmd_comp-1.2.0.tar.gz

Download URL llm_cmd_comp-1.2.0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6ec7332ffa38717520ba60981b040f17e4cc4ca4fd8d715b720adafcd4a78323
BLAKE2b-256 checksum
How to use checksums
97e7d83bebb30550b4eeda91590b136ce85cf7727c3aa33398db33de718ff470
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.10

Release files / llm_cmd_comp-1.2.0-py3-none-any.whl

Download URL llm_cmd_comp-1.2.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5e6703d027b566e998616118830f033546fc0cfc137a03c7029e83e0625d6f9
BLAKE2b-256 checksum
How to use checksums
7e070160c873989f3bf492ec75d70db2946bbedd4585d6e04460c711ae6546a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.10

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page