-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.go
More file actions
65 lines (55 loc) · 1.61 KB
/
main.go
File metadata and controls
65 lines (55 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package main
import (
"fmt"
"os"
)
// Set via ldflags at build time.
var (
version = "0.1.53"
commit = "none"
)
const helpText = `Lore CLI — agentic coding, unified
Usage: lore [command]
Commands:
(no args) Launch interactive TUI
init [name] [--platforms <list>] Initialize Lore (current dir or new dir)
generate [--platforms <list>] Generate platform files from rules, skills, and agents
bundle <subcommand> Manage bundles (install, list, enable, disable, update, remove)
skill <subcommand> Import skills from the Agent Skills ecosystem
hook <name> Hook handler (called by platforms)
version Print version
help Print this help
Options:
--help, -h Print this help
--version, -v Print version
Run 'lore <command> --help' for details on a specific command.
`
func main() {
// Ensure global directory and harness seeds exist on every invocation.
// Idempotent — creates dirs/seeds only if missing.
_ = ensureGlobalDir()
if len(os.Args) < 2 {
runTUI()
return
}
cmd := os.Args[1]
switch cmd {
case "init":
cmdInit(os.Args[2:])
case "generate":
cmdGenerate(os.Args[2:])
case "bundle":
cmdBundle(os.Args[2:])
case "skill":
cmdSkill(os.Args[2:])
case "hook":
cmdHook(os.Args[2:])
case "version", "--version", "-v":
fmt.Printf("lore %s (%s)\n", version, commit)
case "help", "--help", "-h":
fmt.Print(helpText)
default:
fmt.Fprintf(os.Stderr, "Unknown command: %s\nRun 'lore help' for usage.\n", cmd)
os.Exit(1)
}
}