Replace init() + cli.RegisterCommands() with cli.WithCommands() passed to cli.Main(). Commands now register as framework services and receive the root command during OnStartup — no global state, no blank imports. Co-Authored-By: Virgil <virgil@lethean.io>
24 lines
730 B
Go
24 lines
730 B
Go
package main
|
|
|
|
import (
|
|
"forge.lthn.ai/core/cli/cmd/config"
|
|
"forge.lthn.ai/core/cli/cmd/doctor"
|
|
"forge.lthn.ai/core/cli/cmd/help"
|
|
"forge.lthn.ai/core/cli/cmd/module"
|
|
"forge.lthn.ai/core/cli/cmd/pkgcmd"
|
|
"forge.lthn.ai/core/cli/cmd/plugin"
|
|
"forge.lthn.ai/core/cli/cmd/session"
|
|
"forge.lthn.ai/core/go/pkg/cli"
|
|
)
|
|
|
|
func main() {
|
|
cli.Main(
|
|
cli.WithCommands("config", config.AddConfigCommands),
|
|
cli.WithCommands("doctor", doctor.AddDoctorCommands),
|
|
cli.WithCommands("help", help.AddHelpCommands),
|
|
cli.WithCommands("module", module.AddModuleCommands),
|
|
cli.WithCommands("pkg", pkgcmd.AddPkgCommands),
|
|
cli.WithCommands("plugin", plugin.AddPluginCommands),
|
|
cli.WithCommands("session", session.AddSessionCommands),
|
|
)
|
|
}
|