code: func setUserEnv(ctx *cli.Context) error {
  	argName := "environment"
  	// Check for env flag, just in case this middleware is misused
  	hasEnvFlag := false
  	for _, name := range ctx.FlagNames() {
  		if name == argName {
  			hasEnvFlag = true
  			break
  		}
  	}
  	if !hasEnvFlag {
  		return nil
  	}
  
  	if isSet(ctx, argName) {
  		return nil
  	}
  
  	cfg, err := config.LoadConfig()
  	if err != nil {
  		return err
  	}
  
  	client := api.NewClient(cfg)
  	session, err := client.Session.Who(context.Background())
  	if err != nil {
  		return err
  	}
  
  	if session.Type() == apitypes.UserSession {
  		ctx.Set(argName, "dev-"+session.Username())
  	}
  
  	return nil
  }
docs: // setUserEnv populates the env argument, if present and unset,
  // with dev-USERNAME