2026-01-30 00:22:47 +00:00
|
|
|
package docs
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
"strings"
|
|
|
|
|
|
2026-01-30 01:09:03 +00:00
|
|
|
"github.com/host-uk/core/cmd/shared"
|
feat(i18n): add translation keys to all CLI commands
Replace hardcoded strings with i18n.T() calls across all cmd/* packages:
- ai, build, ci, dev, docs, doctor, go, php, pkg, sdk, setup, test, vm
Adds 500+ translation keys to en.json for command descriptions,
flag descriptions, labels, messages, and error strings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 02:37:57 +00:00
|
|
|
"github.com/host-uk/core/pkg/i18n"
|
2026-01-30 00:47:54 +00:00
|
|
|
"github.com/spf13/cobra"
|
2026-01-30 00:22:47 +00:00
|
|
|
)
|
|
|
|
|
|
2026-01-30 00:47:54 +00:00
|
|
|
// Flag variable for list command
|
|
|
|
|
var docsListRegistryPath string
|
2026-01-30 00:22:47 +00:00
|
|
|
|
2026-01-30 00:47:54 +00:00
|
|
|
var docsListCmd = &cobra.Command{
|
|
|
|
|
Use: "list",
|
feat(i18n): add translation keys to all CLI commands
Replace hardcoded strings with i18n.T() calls across all cmd/* packages:
- ai, build, ci, dev, docs, doctor, go, php, pkg, sdk, setup, test, vm
Adds 500+ translation keys to en.json for command descriptions,
flag descriptions, labels, messages, and error strings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 02:37:57 +00:00
|
|
|
Short: i18n.T("cmd.docs.list.short"),
|
|
|
|
|
Long: i18n.T("cmd.docs.list.long"),
|
2026-01-30 00:47:54 +00:00
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
|
return runDocsList(docsListRegistryPath)
|
|
|
|
|
},
|
|
|
|
|
}
|
2026-01-30 00:22:47 +00:00
|
|
|
|
2026-01-30 00:47:54 +00:00
|
|
|
func init() {
|
feat(i18n): add translation keys to all CLI commands
Replace hardcoded strings with i18n.T() calls across all cmd/* packages:
- ai, build, ci, dev, docs, doctor, go, php, pkg, sdk, setup, test, vm
Adds 500+ translation keys to en.json for command descriptions,
flag descriptions, labels, messages, and error strings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 02:37:57 +00:00
|
|
|
docsListCmd.Flags().StringVar(&docsListRegistryPath, "registry", "", i18n.T("cmd.docs.list.flag.registry"))
|
2026-01-30 00:22:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func runDocsList(registryPath string) error {
|
|
|
|
|
reg, _, err := loadRegistry(registryPath)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt.Printf("\n%-20s %-8s %-8s %-10s %s\n",
|
feat(i18n): add translation keys to all CLI commands
Replace hardcoded strings with i18n.T() calls across all cmd/* packages:
- ai, build, ci, dev, docs, doctor, go, php, pkg, sdk, setup, test, vm
Adds 500+ translation keys to en.json for command descriptions,
flag descriptions, labels, messages, and error strings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 02:37:57 +00:00
|
|
|
headerStyle.Render(i18n.T("cmd.docs.list.header.repo")),
|
|
|
|
|
headerStyle.Render(i18n.T("cmd.docs.list.header.readme")),
|
|
|
|
|
headerStyle.Render(i18n.T("cmd.docs.list.header.claude")),
|
|
|
|
|
headerStyle.Render(i18n.T("cmd.docs.list.header.changelog")),
|
|
|
|
|
headerStyle.Render(i18n.T("cmd.docs.list.header.docs")),
|
2026-01-30 00:22:47 +00:00
|
|
|
)
|
|
|
|
|
fmt.Println(strings.Repeat("─", 70))
|
|
|
|
|
|
|
|
|
|
var withDocs, withoutDocs int
|
|
|
|
|
for _, repo := range reg.List() {
|
|
|
|
|
info := scanRepoDocs(repo)
|
|
|
|
|
|
2026-01-30 01:09:03 +00:00
|
|
|
readme := shared.CheckMark(info.Readme != "")
|
|
|
|
|
claude := shared.CheckMark(info.ClaudeMd != "")
|
|
|
|
|
changelog := shared.CheckMark(info.Changelog != "")
|
2026-01-30 00:22:47 +00:00
|
|
|
|
2026-01-30 01:09:03 +00:00
|
|
|
docsDir := shared.CheckMark(false)
|
2026-01-30 00:22:47 +00:00
|
|
|
if len(info.DocsFiles) > 0 {
|
feat(i18n): add translation keys to all CLI commands
Replace hardcoded strings with i18n.T() calls across all cmd/* packages:
- ai, build, ci, dev, docs, doctor, go, php, pkg, sdk, setup, test, vm
Adds 500+ translation keys to en.json for command descriptions,
flag descriptions, labels, messages, and error strings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 02:37:57 +00:00
|
|
|
docsDir = docsFoundStyle.Render(i18n.T("cmd.docs.list.files_count", map[string]interface{}{"Count": len(info.DocsFiles)}))
|
2026-01-30 00:22:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt.Printf("%-20s %-8s %-8s %-10s %s\n",
|
|
|
|
|
repoNameStyle.Render(info.Name),
|
|
|
|
|
readme,
|
|
|
|
|
claude,
|
|
|
|
|
changelog,
|
|
|
|
|
docsDir,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if info.HasDocs {
|
|
|
|
|
withDocs++
|
|
|
|
|
} else {
|
|
|
|
|
withoutDocs++
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt.Println()
|
feat(i18n): add translation keys to all CLI commands
Replace hardcoded strings with i18n.T() calls across all cmd/* packages:
- ai, build, ci, dev, docs, doctor, go, php, pkg, sdk, setup, test, vm
Adds 500+ translation keys to en.json for command descriptions,
flag descriptions, labels, messages, and error strings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 02:37:57 +00:00
|
|
|
fmt.Printf("%s %s\n",
|
|
|
|
|
shared.Label(i18n.T("cmd.docs.list.coverage_label")),
|
|
|
|
|
i18n.T("cmd.docs.list.coverage_summary", map[string]interface{}{"WithDocs": withDocs, "WithoutDocs": withoutDocs}),
|
2026-01-30 00:22:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|