slimtoolkit/slim · error

No global params

Error message

No global params

What it means

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.

Source

Thrown at pkg/app/master/command/common.go:30

	"github.com/c-bata/go-prompt"
	docker "github.com/fsouza/go-dockerclient"
	"github.com/google/shlex"
	log "github.com/sirupsen/logrus"
	"github.com/urfave/cli/v2"

	"github.com/slimtoolkit/slim/pkg/app"
	"github.com/slimtoolkit/slim/pkg/app/master/config"
	"github.com/slimtoolkit/slim/pkg/docker/dockerutil"
	"github.com/slimtoolkit/slim/pkg/util/fsutil"
)

const (
	ImagesStateRootPath = "images"
)

var (
	ErrNoGlobalParams = errors.New("No global params")
)

type ovars = app.OutVars

/////////////////////////////////////////////////////////

type CLIContextKey int

const (
	GlobalParams CLIContextKey = 1
	AppParams    CLIContextKey = 2
)

func CLIContextSave(ctx context.Context, key CLIContextKey, data interface{}) context.Context {
	return context.WithValue(ctx, key, data)
}

func CLIContextGet(ctx context.Context, key CLIContextKey) interface{} {

View on GitHub (pinned to 81940d17fa)

Solutions

  1. Pass all required global flags on the command line (e.g. the top-level docker-slim flags)
  2. Inspect the command help output to see which global params are mandatory
  3. If embedding the command library, populate the global params object before invoking the handler
Defensive patterns

Strategy: validation

Validate before calling

if globalParams == nil {
	return ErrNoGlobalParams
}

Prevention

When it happens

Trigger: Invoking a slim command subcommand without the global parameter set being populated (missing required global flags in the CLI invocation).

Common situations: Scripted/CI calls that omit required global flags; constructing a command handler programmatically and forgetting to pass the global params struct.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of slimtoolkit/slim@81940d17fa (2026-08-31). Data as JSON: /api/errors/c28d8150f0a57847. Report an issue: GitHub.