yay
This commit is contained in:
18
pi/files/agent/extensions/tools-list.ts
Normal file
18
pi/files/agent/extensions/tools-list.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
export default function (pi: ExtensionAPI) {
|
||||
pi.registerCommand("tools", {
|
||||
description: "List available and active tools",
|
||||
handler: async (_args, ctx) => {
|
||||
const allTools = pi.getAllTools();
|
||||
const activeTools = new Set(pi.getActiveTools());
|
||||
const lines = allTools
|
||||
.map((tool) => {
|
||||
const status = activeTools.has(tool.name) ? "active" : "inactive";
|
||||
return `- ${tool.name} (${status})${tool.description ? `: ${tool.description}` : ""}`;
|
||||
})
|
||||
.join("\n");
|
||||
ctx.ui.notify(lines || "No tools registered.", "info");
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user