LEM/cmd/lemcmd/lem.go
Snider 80048b5b00 fix(cli): disable cobra flag parsing on passthrough commands
Adds passthrough() helper with DisableFlagParsing=true so commands
that do their own flag.FlagSet parsing receive flags directly.
Without this, cobra rejects unknown flags like --model.

Also runs go mod tidy — core/go transitively pulls in cobra and
charmbracelet dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 19:00:58 +00:00

27 lines
808 B
Go

// Package lemcmd provides CLI commands for the LEM binary.
// Commands register through the Core framework's cli.WithCommands lifecycle.
package lemcmd
import (
"forge.lthn.ai/core/go/pkg/cli"
)
// AddLEMCommands registers all LEM command groups on the root command.
func AddLEMCommands(root *cli.Command) {
addScoreCommands(root)
addGenCommands(root)
addDataCommands(root)
addExportCommands(root)
addMonCommands(root)
addInfraCommands(root)
}
// passthrough creates a command that passes all args (including flags) to fn.
// Used for commands that do their own flag parsing with flag.FlagSet.
func passthrough(use, short string, fn func([]string)) *cli.Command {
cmd := cli.NewRun(use, short, "", func(_ *cli.Command, args []string) {
fn(args)
})
cmd.DisableFlagParsing = true
return cmd
}