{"record":{"id":"c28d8150f0a57847","repo":"slimtoolkit/slim","slug":"no-global-params","errorCode":null,"errorMessage":"No global params","messagePattern":"No global params","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/app/master/command/common.go","lineNumber":30,"sourceCode":"\n\t\"github.com/c-bata/go-prompt\"\n\tdocker \"github.com/fsouza/go-dockerclient\"\n\t\"github.com/google/shlex\"\n\tlog \"github.com/sirupsen/logrus\"\n\t\"github.com/urfave/cli/v2\"\n\n\t\"github.com/slimtoolkit/slim/pkg/app\"\n\t\"github.com/slimtoolkit/slim/pkg/app/master/config\"\n\t\"github.com/slimtoolkit/slim/pkg/docker/dockerutil\"\n\t\"github.com/slimtoolkit/slim/pkg/util/fsutil\"\n)\n\nconst (\n\tImagesStateRootPath = \"images\"\n)\n\nvar (\n\tErrNoGlobalParams = errors.New(\"No global params\")\n)\n\ntype ovars = app.OutVars\n\n/////////////////////////////////////////////////////////\n\ntype CLIContextKey int\n\nconst (\n\tGlobalParams CLIContextKey = 1\n\tAppParams    CLIContextKey = 2\n)\n\nfunc CLIContextSave(ctx context.Context, key CLIContextKey, data interface{}) context.Context {\n\treturn context.WithValue(ctx, key, data)\n}\n\nfunc CLIContextGet(ctx context.Context, key CLIContextKey) interface{} {","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/slimtoolkit/slim/blob/81940d17fa112cc678e32209214bcb2355cb3004/pkg/app/master/command/common.go#L12-L48","documentation":"ErrNoGlobalParams indicates that the command layer could not find global parameters in the parsed inputs. pkg/app/master/command/common.go defines this sentinel to signal that required global flags/params were not provided before command execution proceeds.","triggerScenarios":"Invoking a slim command subcommand without the global parameter set being populated (missing required global flags in the CLI invocation).","commonSituations":"Scripted/CI calls that omit required global flags; constructing a command handler programmatically and forgetting to pass the global params struct.","solutions":["Pass all required global flags on the command line (e.g. the top-level docker-slim flags)","Inspect the command help output to see which global params are mandatory","If embedding the command library, populate the global params object before invoking the handler"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if globalParams == nil {\n\treturn ErrNoGlobalParams\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Include all mandatory global flags in scripted invocations","Validate the parsed global params struct before calling command handlers","Check command help output when upgrading versions"],"tags":["cli","parameters","configuration"],"backgroundTag":"missing-required-argument","analyzedSha":"81940d17fa112cc678e32209214bcb2355cb3004","analyzedAt":"2026-08-31T23:06:12.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}