{"record":{"id":"ab4023f78edf66ce","repo":"windmill-labs/windmill","slug":"kind-is-required-valid-kinds-trigger-types-j","errorCode":null,"errorMessage":"--kind is required. Valid kinds: ${TRIGGER_TYPES.join(\", \")}","messagePattern":"--kind is required\\. Valid kinds: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/trigger/trigger.ts","lineNumber":436,"sourceCode":"    azure_mode: \"namespace_pull\",\n    scope_resource_id: \"\",\n    subscription_name: \"\",\n    enabled: false,\n  },\n  email: {\n    script_path: \"\",\n    is_flow: false,\n    local_part: \"\",\n    enabled: false,\n  },\n};\n\nasync function newTrigger(opts: GlobalOptions & { kind: string }, path: string) {\n  if (!validatePath(path)) {\n    return;\n  }\n  if (!opts.kind) {\n    throw new Error(\"--kind is required. Valid kinds: \" + TRIGGER_TYPES.join(\", \"));\n  }\n  if (!checkIfValidTrigger(opts.kind)) {\n    throw new Error(\"Invalid trigger kind: \" + opts.kind + \". Valid kinds: \" + TRIGGER_TYPES.join(\", \"));\n  }\n  const kind: TriggerType = opts.kind;\n  const filePath = `${path}.${kind}_trigger.yaml`;\n  try {\n    await stat(filePath);\n    throw new Error(\"File already exists: \" + filePath);\n  } catch (e: any) {\n    if (e.message?.startsWith(\"File already exists\")) throw e;\n  }\n  const template = triggerTemplates[kind];\n  await mkdir(dirname(filePath), { recursive: true });\n  await writeFile(filePath, yamlStringify(template), {\n    flag: \"wx\",\n    encoding: \"utf-8\",\n  });","sourceCodeStart":418,"sourceCodeEnd":454,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/trigger/trigger.ts#L418-L454","documentation":"`wmill trigger new <path>` requires the --kind option to know which trigger template to write. If --kind is absent, the command throws immediately listing the valid kinds (TRIGGER_TYPES). It is a pure argument-validation error thrown before any file or API work.","triggerScenarios":"Calling `wmill trigger new u/admin/myscript` without --kind, or invoking newTrigger programmatically with an opts object missing the kind field.","commonSituations":"Skipped in interactive scripts, outdated shell aliases built before --kind existed, or copy-pasted commands with the flag dropped.","solutions":["Re-run with --kind set to one of the listed types, e.g. `wmill trigger new u/admin/myscript --kind schedule`","Check `wmill trigger new --help` for the valid kind list","Fix the calling script to pass opts.kind"],"exampleFix":"// before\nwmill trigger new u/admin/myscript\n// after\nwmill trigger new u/admin/myscript --kind schedule","handlingStrategy":"validation","validationCode":"const TRIGGER_TYPES = [\"http\",\"websocket\",\"schedule\",\"kafka\",\"nats\",\"rabbitmq\",\"sqs\",\"email\",\"nextcloud\",\"gsheet\",\"postgresql\",\"mongodb\",\"gtt\",\"ghostscript\"];\nif (!opts.kind) throw new Error(\"pass --kind, one of \" + TRIGGER_TYPES.join(\", \"));","typeGuard":null,"tryCatchPattern":"try {\n  await wmill.trigger.new(opts, path);\n} catch (e) {\n  if (String(e.message).startsWith(\"--kind is required\")) {\n    console.error(\"Usage: wmill trigger new <path> --kind <type>\");\n  }\n}","preventionTips":["Always pass --kind explicitly in scripts and CI","Pin commands in runbooks with the full flag set","Check --help output after CLI upgrades"],"tags":["cli","trigger","missing-argument","validation"],"backgroundTag":"missing-required-cli-option","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}