{
    "fabricCommands": {
        "validate": {
            "pikkuFuncId": "FabricValidate",
            "positionals": [],
            "options": {},
            "renderName": "renderValidate",
            "description": "Check the project structure for fabric compatibility — prints all missing or misconfigured items with fix hints"
        },
        "smoke": {
            "pikkuFuncId": "FabricSmoke",
            "positionals": [],
            "options": {
                "keepTemp": {
                    "description": "Keep the temp worktree even on success",
                    "default": false
                },
                "timeoutSeconds": {
                    "description": "Per-step timeout for install/build/codegen commands"
                },
                "startupTimeoutSeconds": {
                    "description": "Timeout for waiting on pikku dev /health-check"
                },
                "port": {
                    "description": "Port to use for the temporary pikku dev startup check"
                }
            },
            "renderName": "renderSmoke",
            "description": "Run a clean-room Fabric smoke test: temp worktree, install, codegen, migrate, and verify pikku dev startup"
        },
        "login": {
            "pikkuFuncId": "FabricLogin",
            "positionals": [],
            "options": {
                "apiKey": {
                    "description": "Use a static API key instead of browser flow"
                },
                "token": {
                    "description": "Use an existing fabric token instead of browser flow"
                },
                "apiUrl": {
                    "description": "Override the fabric-api URL for this login"
                },
                "consoleUrl": {
                    "description": "Override the console URL the browser opens"
                },
                "browser": {
                    "description": "Open the sign-in link automatically (--no-browser to just print it)",
                    "default": true
                }
            },
            "description": "Authenticate against fabric-api"
        },
        "init": {
            "pikkuFuncId": "FabricInit",
            "positionals": [
                {
                    "name": "repo",
                    "required": true
                }
            ],
            "options": {
                "name": {
                    "description": "Override the project display name (defaults to repo name)"
                },
                "branch": {
                    "description": "Default branch (defaults to main)"
                },
                "force": {
                    "description": "Replace existing fabric.config.json",
                    "default": false
                },
                "apiUrl": {
                    "description": "Override the fabric-api URL for this call"
                }
            },
            "parameters": "<repo>",
            "description": "Adopt an existing git repo as a fabric project"
        },
        "link": {
            "pikkuFuncId": "FabricLink",
            "positionals": [],
            "options": {
                "apiUrl": {
                    "description": "Override the fabric-api URL stored in fabric.config.json"
                }
            },
            "description": "Register the current git repo as a fabric project and queue an initial deploy"
        },
        "addon": {
            "pikkuFuncId": "",
            "positionals": [],
            "options": {},
            "description": "Publish and install Fabric community-registry addons",
            "subcommands": {
                "verify": {
                    "pikkuFuncId": "FabricAddonVerify",
                    "positionals": [
                        {
                            "name": "dir",
                            "required": false
                        }
                    ],
                    "options": {},
                    "parameters": "[dir]",
                    "description": "Verify an addon directory is correctly built and ready to publish",
                    "renderName": "renderAddonVerify"
                },
                "publish": {
                    "pikkuFuncId": "FabricPublish",
                    "positionals": [
                        {
                            "name": "dir",
                            "required": false
                        }
                    ],
                    "options": {
                        "apiUrl": {
                            "description": "Override the fabric-api URL for this call"
                        }
                    },
                    "parameters": "[dir]",
                    "renderName": "renderAddonVerify",
                    "description": "Publish the addon in this directory to the community registry (pack + upload)"
                },
                "add": {
                    "pikkuFuncId": "FabricAdd",
                    "positionals": [
                        {
                            "name": "id",
                            "required": true
                        }
                    ],
                    "options": {
                        "dir": {
                            "description": "Addon dir (overrides pikku.config.json addons.addonDir, default addons/)"
                        },
                        "apiUrl": {
                            "description": "Override the fabric-api URL for this call"
                        }
                    },
                    "parameters": "<id>",
                    "description": "Install an addon from the community registry into addons/ (shadcn-style)"
                }
            }
        },
        "deploy": {
            "pikkuFuncId": "",
            "positionals": [],
            "options": {},
            "description": "Plan and apply deploys for a named branch or production",
            "subcommands": {
                "plan": {
                    "pikkuFuncId": "FabricDeployPlan",
                    "positionals": [],
                    "options": {
                        "branch": {
                            "description": "Target branch to deploy",
                            "short": "b"
                        },
                        "production": {
                            "description": "Plan production (always main)",
                            "default": false
                        }
                    },
                    "renderName": "renderDeployPlan",
                    "description": "Resolve the target ref and report what a deploy would do"
                },
                "apply": {
                    "pikkuFuncId": "FabricDeployApply",
                    "positionals": [],
                    "options": {
                        "branch": {
                            "description": "Target branch to deploy",
                            "short": "b"
                        },
                        "production": {
                            "description": "Deploy production (always main)",
                            "default": false
                        },
                        "message": {
                            "description": "Annotation stored on the deployment",
                            "short": "m"
                        },
                        "autoApply": {
                            "description": "Deploy without the confirmation prompt",
                            "default": false
                        }
                    },
                    "renderName": "renderDeployApply",
                    "description": "Build + deploy a named branch or production (main)"
                },
                "list": {
                    "pikkuFuncId": "FabricDeployList",
                    "positionals": [],
                    "options": {
                        "branch": {
                            "description": "Target branch",
                            "short": "b"
                        }
                    },
                    "renderName": "renderDeployList",
                    "description": "List recent deployments for a branch"
                },
                "units": {
                    "pikkuFuncId": "FabricDeployUnits",
                    "positionals": [],
                    "options": {
                        "branch": {
                            "description": "Target branch",
                            "short": "b"
                        }
                    },
                    "renderName": "renderDeployUnits",
                    "description": "List the deployed worker units (topology) for a branch"
                }
            }
        },
        "rollback": {
            "pikkuFuncId": "FabricRollback",
            "positionals": [
                {
                    "name": "branch",
                    "required": true
                },
                {
                    "name": "target",
                    "required": false
                }
            ],
            "options": {
                "list": {
                    "description": "List rollback candidates",
                    "default": false
                },
                "dryRun": {
                    "description": "Show schema-compat result without switching",
                    "default": false
                },
                "yes": {
                    "description": "Skip confirmation prompts",
                    "short": "y",
                    "default": false
                }
            },
            "parameters": "<branch> [target]",
            "description": "Roll live back to a previous deployment artifact"
        },
        "secrets": {
            "pikkuFuncId": "",
            "positionals": [],
            "options": {},
            "description": "Manage stage-scoped secrets",
            "subcommands": {
                "set": {
                    "pikkuFuncId": "FabricSecretsSet",
                    "positionals": [
                        {
                            "name": "name",
                            "required": true
                        }
                    ],
                    "options": {
                        "branch": {
                            "description": "Target branch",
                            "short": "b"
                        },
                        "value": {
                            "description": "Secret value (prompted if omitted)"
                        },
                        "force": {
                            "description": "Overwrite without confirmation",
                            "default": false
                        }
                    },
                    "parameters": "<name>",
                    "description": "Set a stage-scoped secret"
                },
                "list": {
                    "pikkuFuncId": "FabricSecretsList",
                    "positionals": [],
                    "options": {
                        "branch": {
                            "description": "Target branch",
                            "short": "b"
                        },
                        "json": {
                            "description": "Machine-readable output",
                            "default": false
                        }
                    },
                    "description": "List stage secrets"
                }
            }
        },
        "logs": {
            "pikkuFuncId": "FabricLogs",
            "positionals": [],
            "options": {
                "branch": {
                    "description": "Target branch",
                    "short": "b"
                },
                "deployment": {
                    "description": "Specific deployment id"
                },
                "level": {
                    "description": "Minimum level (debug/info/warn/error)"
                },
                "since": {
                    "description": "Time window (e.g. 15m, 2h)"
                },
                "follow": {
                    "description": "Stream new logs (SSE)",
                    "short": "f",
                    "default": false
                },
                "json": {
                    "description": "Machine-readable output",
                    "default": false
                }
            },
            "description": "Stream or fetch logs"
        },
        "metrics": {
            "pikkuFuncId": "FabricMetrics",
            "positionals": [],
            "options": {
                "branch": {
                    "description": "Target branch",
                    "short": "b"
                },
                "hours": {
                    "description": "Lookback window in hours (default 24)"
                },
                "function": {
                    "description": "Filter by wire id (e.g. function name)"
                },
                "json": {
                    "description": "Machine-readable output",
                    "default": false
                }
            },
            "description": "Show request rate / error rate / latency for a stage"
        },
        "trace": {
            "pikkuFuncId": "FabricTrace",
            "positionals": [
                {
                    "name": "traceId",
                    "required": true
                }
            ],
            "options": {
                "branch": {
                    "description": "Target branch",
                    "short": "b"
                },
                "json": {
                    "description": "Machine-readable output",
                    "default": false
                }
            },
            "parameters": "<traceId>",
            "description": "Print every event for a single trace across the stage"
        },
        "status": {
            "pikkuFuncId": "FabricStatus",
            "positionals": [],
            "options": {},
            "renderName": "renderStatus",
            "description": "Show the linked project status (active + in-flight deploy)"
        },
        "errors": {
            "pikkuFuncId": "FabricErrors",
            "positionals": [],
            "options": {
                "branch": {
                    "description": "Target branch",
                    "short": "b"
                },
                "function": {
                    "description": "Filter by function name"
                }
            },
            "renderName": "renderErrors",
            "description": "Show recent error-level events for a branch (with traceIds)"
        },
        "db": {
            "pikkuFuncId": "",
            "positionals": [],
            "options": {},
            "description": "Inspect the stage database",
            "subcommands": {
                "schema": {
                    "pikkuFuncId": "FabricDbSchema",
                    "positionals": [],
                    "options": {
                        "branch": {
                            "description": "Target branch",
                            "short": "b"
                        }
                    },
                    "renderName": "renderDbSchema",
                    "description": "Show the live database schema (tables + columns)"
                }
            }
        },
        "domains": {
            "pikkuFuncId": "",
            "positionals": [],
            "options": {},
            "description": "Manage custom domains for the production stage",
            "subcommands": {
                "list": {
                    "pikkuFuncId": "FabricDomainsList",
                    "positionals": [],
                    "options": {
                        "apiUrl": {
                            "description": "Override the fabric-api URL for this call"
                        }
                    },
                    "description": "List custom domains for the linked project"
                },
                "add": {
                    "pikkuFuncId": "FabricDomainsAdd",
                    "positionals": [
                        {
                            "name": "hostname",
                            "required": true
                        }
                    ],
                    "options": {
                        "target": {
                            "description": "Route target: api (Backend API) or app (Frontend App)",
                            "default": "api"
                        },
                        "apiUrl": {
                            "description": "Override the fabric-api URL for this call"
                        }
                    },
                    "parameters": "<hostname>",
                    "description": "Add a custom domain to the production stage"
                },
                "remove": {
                    "pikkuFuncId": "FabricDomainsRemove",
                    "positionals": [
                        {
                            "name": "hostname",
                            "required": true
                        }
                    ],
                    "options": {
                        "apiUrl": {
                            "description": "Override the fabric-api URL for this call"
                        }
                    },
                    "parameters": "<hostname>",
                    "description": "Remove a custom domain from the production stage"
                }
            }
        },
        "llm": {
            "pikkuFuncId": "",
            "positionals": [],
            "options": {},
            "description": "Fabric AI gateway developer key commands",
            "subcommands": {
                "key": {
                    "pikkuFuncId": "FabricLLMKey",
                    "positionals": [],
                    "options": {
                        "shell": {
                            "description": "Print shell export lines",
                            "default": false
                        },
                        "env": {
                            "description": "Print .env-style key-value lines",
                            "default": false
                        },
                        "json": {
                            "description": "Print machine-readable JSON",
                            "default": false
                        }
                    },
                    "renderName": "renderLLMKey",
                    "description": "Mint or reuse a developer-scoped Fabric AI gateway key"
                }
            }
        }
    }
}
