go-scm/cmd/forge/cmd_forge.go
Snider 10c9e23e04
Some checks failed
Security Scan / security (pull_request) Failing after 9s
Test / test (pull_request) Successful in 1m44s
fix(dx): repair build, update CLAUDE.md, add tests for untested paths
- Fix cmd/forge build failure: remove extra locales.FS arg from
  RegisterCommands (signature takes single CommandRegistration)
- Update CLAUDE.md error handling section to document coreerr.E()
  pattern (was outdated log.E/fmt.Errorf reference)
- Add security_test.go for agentci: SanitizePath, EscapeShellArg,
  SecureSSHCommand, MaskToken (coverage 56% → 68%)
- Add provider_handlers_test.go for pkg/api: category filter, nil
  guards, manifest/verify/sign bad requests (coverage 31% → 52%)
- Audit confirms: no fmt.Errorf or os.ReadFile/WriteFile in production
  code (only in test files)

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 08:49:55 +00:00

53 lines
1.4 KiB
Go

// Package forge provides CLI commands for managing a Forgejo instance.
//
// Commands:
// - config: Configure Forgejo connection (URL, token)
// - status: Show instance status and version
// - repos: List repositories
// - issues: List and create issues
// - prs: List pull requests
// - migrate: Migrate repos from external services
// - sync: Sync GitHub repos to Forgejo upstream branches
// - orgs: List organisations
// - labels: List and create labels
package forge
import (
"forge.lthn.ai/core/cli/pkg/cli"
)
func init() {
cli.RegisterCommands(AddForgeCommands)
}
// Style aliases from shared package.
var (
successStyle = cli.SuccessStyle
errorStyle = cli.ErrorStyle
warningStyle = cli.WarningStyle
dimStyle = cli.DimStyle
valueStyle = cli.ValueStyle
repoStyle = cli.RepoStyle
numberStyle = cli.NumberStyle
infoStyle = cli.InfoStyle
)
// AddForgeCommands registers the 'forge' command and all subcommands.
func AddForgeCommands(root *cli.Command) {
forgeCmd := &cli.Command{
Use: "forge",
Short: "Forgejo instance management",
Long: "Manage repositories, issues, pull requests, and organisations on your Forgejo instance.",
}
root.AddCommand(forgeCmd)
addConfigCommand(forgeCmd)
addStatusCommand(forgeCmd)
addReposCommand(forgeCmd)
addIssuesCommand(forgeCmd)
addPRsCommand(forgeCmd)
addMigrateCommand(forgeCmd)
addSyncCommand(forgeCmd)
addOrgsCommand(forgeCmd)
addLabelsCommand(forgeCmd)
}