{"record":{"id":"dda53061531264f2","repo":"multica-ai/multica","slug":"output-is-required","errorCode":null,"errorMessage":"--output is required","messagePattern":"--output is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_plugin.go","lineNumber":192,"sourceCode":"\tcli.PrintTable(cmd.OutOrStdout(), []string{\"PLUGIN\", \"VERSION\", \"MANIFEST\", \"ARCHIVE\", \"ARTIFACT\"}, [][]string{{\n\t\tresult.PluginKey, result.Version, result.ManifestDigest, result.ArchiveDigest, result.ArtifactDigest,\n\t}})\n\treturn nil\n}\n\nfunc runPluginValidate(cmd *cobra.Command, args []string) error {\n\t_, artifact, err := loadPluginSource(args[0])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"validate Plugin: %w\", err)\n\t}\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\treturn printPluginDigest(cmd, pluginDigestResult(artifact), output)\n}\n\nfunc runPluginPack(cmd *cobra.Command, args []string) error {\n\toutputPath, _ := cmd.Flags().GetString(\"output\")\n\tif outputPath == \"\" {\n\t\treturn fmt.Errorf(\"--output is required\")\n\t}\n\tarchive, artifact, err := plugincontract.PackDirectory(args[0])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"pack Plugin: %w\", err)\n\t}\n\tif err := os.WriteFile(filepath.Clean(outputPath), archive, 0o644); err != nil {\n\t\treturn fmt.Errorf(\"write Plugin archive: %w\", err)\n\t}\n\tformat, _ := cmd.Flags().GetString(\"format\")\n\treturn printPluginDigest(cmd, pluginDigestResult(artifact), format)\n}\n\nfunc pluginWorkspaceID(cmd *cobra.Command) (string, error) {\n\tworkspace, _ := cmd.Flags().GetString(\"workspace\")\n\tif workspace == \"\" {\n\t\treturn requireWorkspaceID(cmd)\n\t}\n\tctx, cancel := cli.APIContext(context.Background())","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_plugin.go#L174-L210","documentation":"Simple flag guard in runPluginPack (cmd_plugin.go:192): `multica plugin pack <dir> --output <path>` was invoked without a non-empty --output value. Packing requires an explicit destination file for the produced archive; there is no default.","triggerScenarios":"Running `multica plugin pack ./my-plugin` with the --output flag omitted or set to the empty string.","commonSituations":"Assuming pack writes plugin.zip into the source directory by default; CI script built by concatenating variables where $OUTPUT is unset.","solutions":["Pass the flag: `multica plugin pack ./my-plugin --output ./dist/my-plugin.zip`.","In scripts, default the variable: `OUTPUT=${OUTPUT:-./dist/plugin.zip}` before invoking.","Check for a typo'd flag name (e.g. --out) — cobra silently ignores unknown flags only with LooseParse; normally it errors, but an empty value still triggers this."],"exampleFix":"// before\nmultica plugin pack ./my-plugin\n// --output is required\n\n// after\nmultica plugin pack ./my-plugin --output ./dist/my-plugin-0.1.0.zip","handlingStrategy":"validation","validationCode":"outputPath := os.Getenv(\"PLUGIN_OUTPUT\")\nif outputPath == \"\" { outputPath = \"./dist/plugin.zip\" }\nos.MkdirAll(filepath.Dir(outputPath), 0o755)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default --output in wrapper scripts: OUTPUT=${OUTPUT:-./dist/plugin.zip}.","Treat pack failures in CI as config errors — assert the flag is set before the job starts."],"tags":["cli","plugin","usage","flags","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}