fix(skills): use pi.commands.register() per DeepWiki API

This commit is contained in:
metaphorics
2026-04-19 12:52:31 +00:00
committed by can1357
parent d80fc82eda
commit 74b91a9fa4
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ export default function myExtension(pi: ExtensionAPI) {
});
// Slash command: /greet
pi.registerCommand("greet", {
pi.commands.register("greet", {
description: "Send a greeting into the conversation",
handler: async (args, ctx) => {
const name = args.trim() || "world";
@@ -120,7 +120,7 @@ Multiple entry points are supported:
## Registering commands
```ts
pi.registerCommand("my-cmd", {
pi.commands.register("my-cmd", {
description: "What the command does",
handler: async (args, ctx) => {
// args: everything the user typed after /my-cmd
@@ -9,7 +9,7 @@ export default function helloExtension(pi: ExtensionAPI) {
});
// Register a /hello slash command that sends a greeting into the conversation.
pi.registerCommand("hello", {
pi.commands.register("hello", {
description: "Send a greeting into the conversation",
handler: async (_args, ctx) => {
ctx.ui.notify("Hello from my extension!", "info");