cli/cmd/ml/cmd_consolidate.go
Claude 7bb3488f0e
refactor: flatten commands, extract php/ci variants to own repos
- Remove internal/cmd/php/ (now core/php repo)
- Remove internal/cmd/ci/ and internal/cmd/sdk/ (now core/ci repo)
- Remove internal/variants/ build tag system entirely
- Move all 30 remaining command packages from internal/cmd/ to cmd/
- Rewrite main.go with direct imports (no more variant selection)
- Update all cross-references from internal/cmd/ to cmd/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 14:41:05 +00:00

41 lines
1.4 KiB
Go

package ml
import (
"forge.lthn.ai/core/go/pkg/cli"
"forge.lthn.ai/core/go/pkg/ml"
)
var (
consolidateM3Host string
consolidateRemoteDir string
consolidatePattern string
consolidateOutputDir string
consolidateMergedOut string
)
var consolidateCmd = &cli.Command{
Use: "consolidate",
Short: "Pull and merge response JSONL files from M3",
Long: "Pulls JSONL response files from M3 via SSH/SCP, merges them by idx, deduplicates, and writes a single merged JSONL output.",
RunE: runConsolidate,
}
func init() {
consolidateCmd.Flags().StringVar(&consolidateM3Host, "m3-host", "m3", "M3 SSH host")
consolidateCmd.Flags().StringVar(&consolidateRemoteDir, "remote", "/Volumes/Data/lem/responses", "Remote response directory")
consolidateCmd.Flags().StringVar(&consolidatePattern, "pattern", "gold*.jsonl", "File glob pattern")
consolidateCmd.Flags().StringVar(&consolidateOutputDir, "output", "", "Local output directory (default: responses)")
consolidateCmd.Flags().StringVar(&consolidateMergedOut, "merged", "", "Merged output path (default: gold-merged.jsonl in parent of output dir)")
}
func runConsolidate(cmd *cli.Command, args []string) error {
cfg := ml.ConsolidateConfig{
M3Host: consolidateM3Host,
RemoteDir: consolidateRemoteDir,
Pattern: consolidatePattern,
OutputDir: consolidateOutputDir,
MergedOut: consolidateMergedOut,
}
return ml.Consolidate(cfg, cmd.OutOrStdout())
}