Skip to main content

A tool plugin for LLM to enable executing shell commands on the user's system.

Project description

llm-tools-execute-shell

PyPI Changelog Tests License

A tool plugin for LLM that allows you to execute arbitrary shell commands suggested by the LLM.

This tool can be dangerous, and for this reason, this tool prompts for confirmation before running each command. Review all commands carefully before authorizing.

Installation

Install this plugin in the same environment as LLM:

llm install llm-tools-execute-shell

Usage

To run a single prompt:

llm --tool execute_shell "What's the current date and time?"

To run in chat mode:

$ llm chat --tool execute_shell
...
> My req.py script is broken. Can you run it and fix the error?
...
LLM wants to run command: 'python req.py'

Are you sure you want to run the above command? (y/n): y

Traceback (most recent call last):
  File "/tmp/foo/req.py", line 1, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

LLM wants to run command: 'pip install requests'

Are you sure you want to run the above command? (y/n): y
...
LLM wants to run command: 'python req.py'

Are you sure you want to run the above command? (y/n): y

{'origin': 'success'}

It looks like the `req.py` script was failing because the `requests` module was not installed. I've installed it for you, and now the script runs successfully.

Development

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

cd llm-tools-execute-shell
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

python -m pip install -e '.[test]'

To run the tests:

python -m pytest

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_tools_execute_shell-0.1.2.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

llm_tools_execute_shell-0.1.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file llm_tools_execute_shell-0.1.2.tar.gz.

File metadata

  • Download URL: llm_tools_execute_shell-0.1.2.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_tools_execute_shell-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1e0ec932a580c2beb5ba8ecd12f9b04bef62e5f5cbc379ae9ae6a5f0e79d0959
MD5 7f8e8b0cd8974b70ba9e9d6c52fbcada
BLAKE2b-256 221f5f443ffe92249c33654d48c9b99a65ad1afbc756022838c52b5f33ae2aa2

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_execute_shell-0.1.2.tar.gz:

Publisher: publish.yml on jthometz/llm-tools-execute-shell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_tools_execute_shell-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_tools_execute_shell-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7ac18601f569c21a6b2afe6d2da4d5320cb884b5b95fa5bb7177938229feba2c
MD5 4ec18a8f226d5bd0a5def3334b93335d
BLAKE2b-256 4fee254b9ade8b92e559037c845c9c0e193dce8090d2c65f9ba5ab6492ddd518

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_tools_execute_shell-0.1.2-py3-none-any.whl:

Publisher: publish.yml on jthometz/llm-tools-execute-shell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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