feat: wire 'lem setup --data' CLI command
Register setup group with data subcommand that hydrates cold compressed JSONL.zst training data into warm DuckDB tables. Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
1269e70853
commit
061dd4cedd
2 changed files with 27 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ func AddLEMCommands(root *cli.Command) {
|
|||
addExportCommands(root)
|
||||
addMonCommands(root)
|
||||
addInfraCommands(root)
|
||||
addSetupCommands(root)
|
||||
}
|
||||
|
||||
// envOr returns the environment variable value, or the fallback if not set.
|
||||
|
|
|
|||
26
cmd/lemcmd/setup.go
Normal file
26
cmd/lemcmd/setup.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// setup.go — CLI registration for `lem setup` commands.
|
||||
package lemcmd
|
||||
|
||||
import (
|
||||
"forge.lthn.ai/core/cli/pkg/cli"
|
||||
"forge.lthn.ai/lthn/lem/pkg/lem"
|
||||
)
|
||||
|
||||
func addSetupCommands(root *cli.Command) {
|
||||
setupGroup := cli.NewGroup("setup", "Setup commands", "Initialise LEM data and environment.")
|
||||
|
||||
var dataCfg lem.SetupOpts
|
||||
dataCmd := cli.NewCommand("data", "Hydrate cold storage into DuckDB + InfluxDB", "",
|
||||
func(cmd *cli.Command, args []string) error {
|
||||
return lem.RunSetup(dataCfg)
|
||||
},
|
||||
)
|
||||
cli.StringFlag(dataCmd, &dataCfg.Root, "root", "", ".", "LEM repo root directory")
|
||||
cli.StringFlag(dataCmd, &dataCfg.DB, "db", "", "", "DuckDB path (defaults to LEM_DB env, then ./lem.duckdb)")
|
||||
cli.StringFlag(dataCmd, &dataCfg.Influx, "influx", "", "", "InfluxDB URL (default http://10.69.69.165:8181)")
|
||||
cli.StringFlag(dataCmd, &dataCfg.InfluxDB, "influx-db", "", "", "InfluxDB database (default training)")
|
||||
cli.BoolFlag(dataCmd, &dataCfg.SkipInflux, "skip-influx", "", false, "Skip InfluxDB backfill")
|
||||
setupGroup.AddCommand(dataCmd)
|
||||
|
||||
root.AddCommand(setupGroup)
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue