Skip to main content

Shell completion using LLM (Qwen3)

This is a fork of llm-cmd-comp that adds direct support for Qwen3 and its thinking tokens when hosted by providers like llama.cpp. The main advantage of this fork is that it can handle Qwen3's explicit thinking process tokens and execute commands directly.

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-qwen

Then install the shell integration for your preferred shell.

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

Usage

There are two ways to use this plugin:

1. Direct Command Generation and Execution

Simply use the llm term command followed by your natural language description:

llm term "list all files larger than 100MB"

The command will be generated and executed automatically.

You can also use the --no-think (or -nt) flag to disable thinking tokens in the response:

llm term --no-think "list all files larger than 100MB"

This will give you a more direct response without the model's thinking process.

2. Interactive Shell Integration

  1. Start typing a command.
  2. Activate the key binding (Ctrl+k 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.

Examples

Here are some ways you can use this feature:

  • Type a command in English, convert it to bash.
    llm term "find all files larger than 100MB"
    🪄 find . -type f -size +100M
  • Give extra instructions as comments.
    llm term "replace 'foo' with 'bar' in all Python files recursively"
    🪄 find . -name '*.py' -exec sed -i 's/foo/bar/g' {} +

Features

  • Direct command execution with llm term
  • Support for Qwen3's thinking process tokens
  • Compatible with llama.cpp and other LLM providers
  • Interactive shell completion with customizable keybindings
  • Works with bash, zsh, and fish shells

Development

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

cd llm-cmd-comp-qwen
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-qwen 0.0.1

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-qwen 0.0.1
File Size Uploaded
llm_cmd_comp_qwen-0.0.1.tar.gz 7.8 kB Details

Built distribution (wheel)

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

Total release size: 16.3 kB

Release files / llm_cmd_comp_qwen-0.0.1.tar.gz

Download URL llm_cmd_comp_qwen-0.0.1.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2ad1abd7d38d1199bb1305fe5ea01809fa5187d631c948e90e23fb22aeb5bc2a
BLAKE2b-256 checksum
How to use checksums
c1617294f1189a7a4b2dd04040e2275812bf3cc92e0dcbf1cc0152816076ee47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / llm_cmd_comp_qwen-0.0.1-py3-none-any.whl

Download URL llm_cmd_comp_qwen-0.0.1-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d702ebaee857763c755e63573d9074549b6e41f3729ddc26fdad07d463d362f
BLAKE2b-256 checksum
How to use checksums
e1c63df529e503c71a40e4a3bed557f84014ceb6fdf49a514d9f70a88bf274d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.0.1 This release

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