- Change module from forge.lthn.ai/core/go to forge.lthn.ai/core/cli - Remove pkg/ directory (now served from core/go) - Add require + replace for forge.lthn.ai/core/go => ../go - Update go.work to include ../go workspace module - Fix all internal/cmd/* imports: pkg/ refs → forge.lthn.ai/core/go/pkg/ - Rename internal/cmd/sdk package to sdkcmd (avoids conflict with pkg/sdk) - Remove SDK library files from internal/cmd/sdk/ (now in core/go/pkg/sdk/) - Remove duplicate RAG helper functions from internal/cmd/rag/ - Remove stale cmd/core-ide/ (now in core/ide repo) - Update IDE variant to remove core-ide import - Fix test assertion for new module name - Run go mod tidy to sync dependencies core/cli is now a pure CLI application importing core/go for packages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
43 lines
1 KiB
Go
43 lines
1 KiB
Go
package ci
|
|
|
|
import (
|
|
"os"
|
|
|
|
"forge.lthn.ai/core/go/pkg/cli"
|
|
"forge.lthn.ai/core/go/pkg/i18n"
|
|
"forge.lthn.ai/core/go/pkg/release"
|
|
)
|
|
|
|
func runCIReleaseInit() error {
|
|
cwd, err := os.Getwd()
|
|
if err != nil {
|
|
return cli.Err("%s: %w", i18n.T("i18n.fail.get", "working directory"), err)
|
|
}
|
|
|
|
cli.Print("%s %s\n\n", releaseDimStyle.Render(i18n.Label("init")), i18n.T("cmd.ci.init.initializing"))
|
|
|
|
// Check if already initialized
|
|
if release.ConfigExists(cwd) {
|
|
cli.Text(i18n.T("cmd.ci.init.already_initialized"))
|
|
return nil
|
|
}
|
|
|
|
// Create release config
|
|
cfg := release.DefaultConfig()
|
|
if err := release.WriteConfig(cfg, cwd); err != nil {
|
|
return cli.Err("%s: %w", i18n.T("i18n.fail.create", "config"), err)
|
|
}
|
|
|
|
cli.Blank()
|
|
cli.Print("%s %s\n", releaseSuccessStyle.Render("v"), i18n.T("cmd.ci.init.created_config"))
|
|
|
|
// Templates init removed as functionality not exposed
|
|
|
|
cli.Blank()
|
|
|
|
cli.Text(i18n.T("cmd.ci.init.next_steps"))
|
|
cli.Print(" %s\n", i18n.T("cmd.ci.init.edit_config"))
|
|
cli.Print(" %s\n", i18n.T("cmd.ci.init.run_ci"))
|
|
|
|
return nil
|
|
}
|