fix(coding-agent): remove -- from registerFlag calls

This was causing the agent sometimes to pick up on the incorrect syntax when
asked to write extensions with flags
This commit is contained in:
Kao Félix 2026-01-11 02:21:15 +01:00
parent 65b72cc514
commit 6d60302646
4 changed files with 6 additions and 6 deletions

View file

@ -1041,7 +1041,7 @@ Register custom CLI flags (parsed automatically, shown in `--help`):
```typescript
export default function (pi: ExtensionAPI) {
pi.registerFlag("--dry-run", {
pi.registerFlag("dry-run", {
description: "Run without making changes",
type: "boolean",
});

View file

@ -190,7 +190,7 @@ export default function (pi: ExtensionAPI) {
pi.registerTool({ ... });
pi.registerCommand("name", { ... });
pi.registerShortcut("ctrl+x", { ... });
pi.registerFlag("--my-flag", { ... });
pi.registerFlag("my-flag", { ... });
}
```
@ -809,7 +809,7 @@ pi.registerShortcut("ctrl+shift+p", {
Register a CLI flag.
```typescript
pi.registerFlag("--plan", {
pi.registerFlag("plan", {
description: "Start in plan mode",
type: "boolean",
default: false,

View file

@ -429,7 +429,7 @@ describe("extensions discovery", () => {
it("loads extension with flags", async () => {
const extCode = `
export default function(pi) {
pi.registerFlag("--my-flag", {
pi.registerFlag("my-flag", {
description: "My custom flag",
handler: async (value) => {},
});

View file

@ -213,7 +213,7 @@ describe("ExtensionRunner", () => {
it("collects flags from extensions", async () => {
const extCode = `
export default function(pi) {
pi.registerFlag("--my-flag", {
pi.registerFlag("my-flag", {
description: "My flag",
handler: async () => {},
});
@ -231,7 +231,7 @@ describe("ExtensionRunner", () => {
it("can set flag values", async () => {
const extCode = `
export default function(pi) {
pi.registerFlag("--test-flag", {
pi.registerFlag("test-flag", {
description: "Test flag",
handler: async () => {},
});