A cookiecutter template for creating new llm plugins. `
You'll need to have cookiecutter installed. I recommend pipx for this:
pipx install cookiecutter
Regular pip will work OK too.
Run cookiecutter gh:simonw/llm-plugin and then answer the prompts. Here's an example run:
cookiecutter gh:simonw/llm-pluginplugin_name []: plugin template demo
description []: Demonstrating https://github.com/simonw/llm-plugin
hyphenated [plugin-template-demo]:
underscored [plugin_template_demo]:
github_username []: simonw
author_name []: Simon Willison
I strongly recommend accepting the suggested value for "hyphenated" and "underscored" by hitting enter on those prompts.
This will create a directory called llm-plugin-template-demo - the plugin name you enter is converted to lowercase and uses hyphens instead of spaces.
Having created the new plugin structure from the template, here's how to start working on the plugin.
You can install the plugin in "editable" mode like so:
llm install -e .Run this in the llm-plugin-template-demo directory.
You can also pass the path to that directory like this:
llm install -e path/to/llm-plugin-template-demoTo confirm it is installed, run:
llm pluginsYou should see the following:
[
{
"name": "llm-plugin-template-demo",
"hooks": [
"prepare_connection",
"register_commands"
],
"version": "0.1"
}
]You can run the tests for your plugin with python -m pytest - follow the development environment instructions in the plugin's generated README for details.