No description
- Kotlin 100%
| src/main/kotlin/tech/lenooby09/plugin/example | ||
| build.gradle.kts | ||
| README.md | ||
Catboi Plugin Template
A template for creating plugin tools that can be dropped into the plugins/ folder and loaded automatically at runtime.
Quick Start
-
Create your tool — copy
ExampleTool.ktand modify it:- Change the class name,
name, andtoolDefinitionto match your tool. - Implement the
executemethod with your logic. - You have full access to
ToolContext(Bluesky client, memory DB, Ollama client, etc.).
- Change the class name,
-
Build the plugin JAR:
./gradlew :plugin-template:jarThe JAR is output to
plugin-template/build/libs/. -
Deploy to the plugins folder:
./gradlew :plugin-template:deployPluginThis builds the JAR and copies it directly into the root
plugins/directory. -
Restart catboi — your tool is discovered automatically.
Using as a Standalone Project
To use this template outside the catboi monorepo:
- Copy the
plugin-template/directory to a new location. - Replace the
compileOnly(project(":agent"))andcompileOnly(project(":ollama"))dependencies inbuild.gradle.ktswith published artifacts or local JAR references:dependencies { compileOnly(files("/path/to/catboi/agent/build/libs/agent.jar")) compileOnly(files("/path/to/catboi/ollama/build/libs/ollama.jar")) compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0") } - Build with
./gradlew jarand drop the resulting JAR into catboi'splugins/folder.
Key Interfaces
AgentTool
Every plugin tool must implement AgentTool:
interface AgentTool {
val name: String // Unique tool name (used for dispatching)
val toolDefinition: Tool // Ollama tool definition (name, description, parameters)
fun isAvailable(): Boolean // Return false to conditionally disable the tool
suspend fun execute(args: Map<String, JsonElement>, context: ToolContext): String
}
ToolContext
The context parameter gives your tool access to:
| Field | Description |
|---|---|
blueskyClient |
Bluesky client for posting/replying |
memory |
Multi-table vector database for memory operations |
ollamaClient |
Ollama client for AI operations (embeddings, etc.) |
llmBackend |
LLM backend for chat operations |
model |
Name of the main AI model |
embeddingModel |
Name of the embedding model |
agentUserId |
The bot's own Bluesky DID |
interactingUserId |
The current user's ID |
Important Notes
- Dependencies on
agent,ollama, andkotlinx-serialization-jsonare compileOnly — they are provided at runtime by the main catboi application. Do not bundle them in your plugin JAR. - If your plugin needs additional libraries (e.g., an HTTP client), add them as
implementationdependencies — they will be bundled into the fat JAR automatically. - Tool classes must have a no-argument constructor so they can be instantiated via reflection.