Run commands in a Docker container via an LLM tool
Install this plugin in the same environment as LLM.
llm install llm-tools-dockerTo use this with the LLM command-line tool:
llm chat -T DockerAlpine --tools-debug --chain-limit 0Then in the chat try:
Install Python 3 and use it to draw a cowsay cow
This plugin currently only works with llm chat since the container is not persisted across multiple calls.
This is a very early alpha. Every time you start a new chat it will create a new Docker container without closing down the previous one.
It will mount the current directory as a volume in the container, so commands that run in Docker will be able to modify or delete files in that directory.
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd llm-tools-docker
python -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:
llm install -e '.[test]'To run the tests:
python -m pytest