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.
First, clone the repository:
git clone https://github.com/jthometz/llm-tools-execute-shell.git
Then, install the local plugin using llm install -e:
llm install -e path/to/llm-tools-execute-shell
Usage
To run a single prompt:
▶ llm -T execute_shell "What's the current date and time?" --td
**************************************************************************
* WARNING: The LLM is requesting to execute the following shell command. *
* REVIEW IT CAREFULLY. Executing unintended commands can be dangerous *
* and may end in disaster, like wiping your entire disk. Do not run any *
* command if you do not know exactly what it does. *
**************************************************************************
'date'
Are you sure you want to run the above command? (y/n): y
Tool call: execute_shell({'command': 'date'})
Mon Jun 9 07:23:59 AM JST 2025
The current date and time is Mon Jun 9 07:23:59 AM JST 2025.
To run in chat mode:
$ llm chat -T execute_shell --td
...
> How many words are in foo.txt?
...
'cat foo.txt | wc -w'
Are you sure you want to run the above command? (y/n): y
Tool call: execute_shell({'command': 'cat foo.txt | wc -w'})
35
There are 35 words in `foo.txt`.
> How many lines?
...
'cat foo.txt | wc -l'
Are you sure you want to run the above command? (y/n): y
Tool call: execute_shell({'command': 'cat foo.txt | wc -l'})
6
There are 6 lines in `foo.txt`.
>
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.0.tar.gz.
File metadata
- Download URL: llm_tools_execute_shell-0.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e644a4a4c349a3500cec1301bc4a64819466197ccf0e9f8853ae47b555800ab
|
|
| MD5 |
b7c51150213df65fa8970613b207f505
|
|
| BLAKE2b-256 |
3db78ff989cf3d6e24b47fc020ea59b8ca128393fc1f91b24d2a2dd3fd9dd5cf
|
Provenance
The following attestation bundles were made for llm_tools_execute_shell-0.1.0.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.0.tar.gz -
Subject digest:
1e644a4a4c349a3500cec1301bc4a64819466197ccf0e9f8853ae47b555800ab - Sigstore transparency entry: 232695048
- Sigstore integration time:
-
Permalink:
jthometz/llm-tools-execute-shell@7a7ccbf0fd08fc62141898a606f8e930b9cf57de -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jthometz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7a7ccbf0fd08fc62141898a606f8e930b9cf57de -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_tools_execute_shell-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llm_tools_execute_shell-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.5 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 |
366646f31572081b98c240170a835ab76ff852b6044e997bddeaf0d7e651626a
|
|
| MD5 |
13798dcb0521aa3f4bad4d032d763530
|
|
| BLAKE2b-256 |
4bb8821122a7ee9232de4cd0c8563451f1dfb6585e831796f5f0e29e8cee607b
|
Provenance
The following attestation bundles were made for llm_tools_execute_shell-0.1.0-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.0-py3-none-any.whl -
Subject digest:
366646f31572081b98c240170a835ab76ff852b6044e997bddeaf0d7e651626a - Sigstore transparency entry: 232695050
- Sigstore integration time:
-
Permalink:
jthometz/llm-tools-execute-shell@7a7ccbf0fd08fc62141898a606f8e930b9cf57de -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jthometz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7a7ccbf0fd08fc62141898a606f8e930b9cf57de -
Trigger Event:
release
-
Statement type: