Skip to content
4 changes: 3 additions & 1 deletion cmd/deploy/cmd_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package deploy

import (
"forge.lthn.ai/core/cli/pkg/cli"
"forge.lthn.ai/core/go-devops/locales"
)

func init() {
cli.RegisterCommands(AddDeployCommands)
cli.RegisterCommands(AddDeployCommands, locales.FS)
}

// AddDeployCommands registers the 'deploy' command and all subcommands.
func AddDeployCommands(root *cli.Command) {
setDeployI18n()
root.AddCommand(Cmd)
}
12 changes: 8 additions & 4 deletions cmd/deploy/cmd_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"forge.lthn.ai/core/cli/pkg/cli"
"forge.lthn.ai/core/go-devops/deploy/coolify"
"forge.lthn.ai/core/go-i18n"
log "forge.lthn.ai/core/go-log"
)

var (
Expand All @@ -19,9 +20,12 @@ var (

// Cmd is the root deploy command.
var Cmd = &cli.Command{
Use: "deploy",
Short: i18n.T("cmd.deploy.short"),
Long: i18n.T("cmd.deploy.long"),
Use: "deploy",
}

func setDeployI18n() {
Cmd.Short = i18n.T("cmd.deploy.short")
Cmd.Long = i18n.T("cmd.deploy.long")
}

var serversCmd = &cli.Command{
Expand Down Expand Up @@ -266,7 +270,7 @@ func runCall(cmd *cli.Command, args []string) error {
var params map[string]any
if len(args) > 1 {
if err := json.Unmarshal([]byte(args[1]), &params); err != nil {
return fmt.Errorf("invalid JSON params: %w", err)
return log.E("deploy", "invalid JSON params", err)
}
}

Expand Down
4 changes: 3 additions & 1 deletion cmd/dev/cmd_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ package dev

import (
"forge.lthn.ai/core/cli/pkg/cli"
"forge.lthn.ai/core/go-devops/locales"
"forge.lthn.ai/core/go-i18n"
)

func init() {
cli.RegisterCommands(AddDevCommands)
cli.RegisterCommands(AddDevCommands, locales.FS)
}

// Style aliases from shared package
Expand Down Expand Up @@ -74,6 +75,7 @@ func AddDevCommands(root *cli.Command) {
AddCommitCommand(devCmd)
AddPushCommand(devCmd)
AddPullCommand(devCmd)
AddTagCommand(devCmd)

// Safe git operations for AI agents (also available under 'core git')
AddFileSyncCommand(devCmd)
Expand Down
6 changes: 3 additions & 3 deletions cmd/dev/cmd_impact.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package dev

import (
"errors"
"slices"

"forge.lthn.ai/core/cli/pkg/cli"
"forge.lthn.ai/core/go-i18n"
"forge.lthn.ai/core/go-io"
log "forge.lthn.ai/core/go-log"
"forge.lthn.ai/core/go-scm/repos"
)

Expand Down Expand Up @@ -55,14 +55,14 @@ func runImpact(registryPath string, repoName string) error {
return cli.Wrap(err, "failed to load registry")
}
} else {
return errors.New(i18n.T("cmd.dev.impact.requires_registry"))
return log.E("dev.impact", i18n.T("cmd.dev.impact.requires_registry"), nil)
}
}

// Check repo exists
repo, exists := reg.Get(repoName)
if !exists {
return errors.New(i18n.T("error.repo_not_found", map[string]any{"Name": repoName}))
return log.E("dev.impact", i18n.T("error.repo_not_found", map[string]any{"Name": repoName}), nil)
}

// Build reverse dependency graph
Expand Down
Loading