multica-ai/multica · error
--kind must be schedule or webhook
Error message
--kind must be schedule or webhook
What it means
Flag validation in `multica autopilot trigger add` rejecting an unsupported --kind value. Only 'schedule' (the default when --kind is empty) and 'webhook' are accepted; anything else fails fast before any network call is made. This mirrors the server-side trigger kinds the /api/autopilots/{id}/triggers endpoint understands.
Source
Thrown at server/cmd/multica/cmd_autopilot.go:549
strVal(r, "completed_at"),
})
}
cli.PrintTable(os.Stdout, headers, rows)
return nil
}
func runAutopilotTriggerAdd(cmd *cobra.Command, args []string) error {
client, err := newAPIClient(cmd)
if err != nil {
return err
}
kind, _ := cmd.Flags().GetString("kind")
if kind == "" {
kind = "schedule"
}
if kind != "schedule" && kind != "webhook" {
return fmt.Errorf("--kind must be schedule or webhook")
}
cron, _ := cmd.Flags().GetString("cron")
if kind == "schedule" && cron == "" {
return fmt.Errorf("--cron is required for --kind schedule")
}
if kind == "webhook" {
if v, _ := cmd.Flags().GetString("timezone"); v != "" {
return fmt.Errorf("--timezone is only valid with --kind schedule")
}
if cron != "" {
return fmt.Errorf("--cron is only valid with --kind schedule")
}
}
body := map[string]any{"kind": kind}
if kind == "schedule" {
body["cron_expression"] = cron
if v, _ := cmd.Flags().GetString("timezone"); v != "" {View on GitHub (pinned to 2c0912b6ec)
Solutions
- Use --kind schedule (with --cron) or --kind webhook
- Omit --kind entirely if you want the schedule default
- Check `multica autopilot trigger add --help` for the accepted values in your CLI build
Example fix
// before multica autopilot trigger add my-pilot --kind cron --cron '0 9 * * *' // --kind must be schedule or webhook // after multica autopilot trigger add my-pilot --kind schedule --cron '0 9 * * *'
Defensive patterns
Strategy: validation
Validate before calling
KIND="${KIND:-schedule}"
case "$KIND" in schedule|webhook) ;; *) echo "--kind must be schedule or webhook" >&2; exit 2;; esac
multica autopilot trigger add "$ID" --kind "$KIND" Prevention
- Validate kind in wrapper scripts before invoking the CLI
- Omit --kind when the schedule default is intended
- Read `--help` after CLI upgrades — accepted kinds may change
When it happens
Trigger: Running `autopilot trigger add <ref> --kind cron`, `--kind manual`, `--kind event`, or any typo like `--kind schdule`. Pure client-side check: no HTTP request is issued.
Common situations: Assuming the trigger kind matches a generic cron/event vocabulary from other tools; copy-pasting a command written for a newer/older CLI version that had more kinds; shell completion inserting the wrong value.
Related errors
- --cron is required for --kind schedule
- --timezone is only valid with --kind schedule
- --cron is only valid with --kind schedule
- no fields to update; use --enabled, --cron, --timezone, or -
- create trigger: %w
AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15).
Data as JSON: /api/errors/1882cc826c0a2914.
Report an issue: GitHub.