A tool plugin for LLM to enable executing shell commands on the user's system.
Project description
llm-tools-execute-shell
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e0ec932a580c2beb5ba8ecd12f9b04bef62e5f5cbc379ae9ae6a5f0e79d0959
|
|
| MD5 |
7f8e8b0cd8974b70ba9e9d6c52fbcada
|
|
| BLAKE2b-256 |
221f5f443ffe92249c33654d48c9b99a65ad1afbc756022838c52b5f33ae2aa2
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_tools_execute_shell-0.1.2.tar.gz -
Subject digest:
1e0ec932a580c2beb5ba8ecd12f9b04bef62e5f5cbc379ae9ae6a5f0e79d0959 - Sigstore transparency entry: 239351225
- Sigstore integration time:
-
Permalink:
jthometz/llm-tools-execute-shell@a60b1831b372a26132a1b22d1757b5eaaf3f779c -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/jthometz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a60b1831b372a26132a1b22d1757b5eaaf3f779c -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_tools_execute_shell-0.1.2-py3-none-any.whl.
File metadata
- Download URL: llm_tools_execute_shell-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ac18601f569c21a6b2afe6d2da4d5320cb884b5b95fa5bb7177938229feba2c
|
|
| MD5 |
4ec18a8f226d5bd0a5def3334b93335d
|
|
| BLAKE2b-256 |
4fee254b9ade8b92e559037c845c9c0e193dce8090d2c65f9ba5ab6492ddd518
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_tools_execute_shell-0.1.2-py3-none-any.whl -
Subject digest:
7ac18601f569c21a6b2afe6d2da4d5320cb884b5b95fa5bb7177938229feba2c - Sigstore transparency entry: 239351229
- Sigstore integration time:
-
Permalink:
jthometz/llm-tools-execute-shell@a60b1831b372a26132a1b22d1757b5eaaf3f779c -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/jthometz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a60b1831b372a26132a1b22d1757b5eaaf3f779c -
Trigger Event:
release
-
Statement type: