Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

llm-cmd

PyPI Changelog Tests License

Use LLM to generate and execute commands in your shell

Installation

Install this plugin in the same environment as LLM.

llm install llm-cmd

Usage

This command could be very dangerous. Do not use this unless you are confident you understand what it does and are sure you could spot if it is likely to do something dangerous.

Run llm cmd like this:

llm cmd undo last git commit

It will use your default model to generate the corresponding shell command.

This will then be displayed in your terminal ready for you to edit it, or hit <enter> to execute the prompt.

If the command doesnt't look right, hit Ctrl+C to cancel.

The system prompt

This is the prompt used by this tool:

Return only the command to be executed as a raw string, no string delimiters wrapping it, no yapping, no markdown, no fenced code blocks, what you return will be passed to subprocess.check_output() directly.

For example, if the user asks: undo last git commit

You return only: git reset --soft HEAD~1

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:

llm install -e '.[test]'

To run the tests:

pytest

Release files for llm-cmd 0.2a0

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 0.2a0
File Size Uploaded
llm_cmd-0.2a0.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-cmd 0.2a0
File Interpreter ABI Platform
llm_cmd-0.2a0-py3-none-any.whl Python 3 none any Details

Total release size: 14.6 kB

Release files / llm_cmd-0.2a0.tar.gz

Download URL llm_cmd-0.2a0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ef43690d3b4a9a37efb7aa1c998d4ca1807de075a707c0ad696ce55c614ba8a2
BLAKE2b-256 checksum
How to use checksums
ddc8d6e5ce855ecf16c0eb6066bf4624e348850b6aebbf70a36227ffb2b7265f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / llm_cmd-0.2a0-py3-none-any.whl

Download URL llm_cmd-0.2a0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e0e21e43d49e73b931b09663db96fef935adbe46f8c233b1ce52872668117cf
BLAKE2b-256 checksum
How to use checksums
c66f47f53d22873d0915fdd12a34a94f142554981d128820ea1b9aaa6b2db46e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.2a0 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