-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
71 lines (67 loc) · 1.59 KB
/
main.go
File metadata and controls
71 lines (67 loc) · 1.59 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
66
67
68
69
70
71
package main
import (
"fmt"
"os"
"github.com/pubgo/logseq-cli/cmds"
"github.com/pubgo/redant"
"github.com/pubgo/redant/cmds/completioncmd"
"github.com/pubgo/redant/cmds/doccmd"
"github.com/pubgo/redant/cmds/llmstxtcmd"
"github.com/pubgo/redant/cmds/mcpcmd"
"github.com/pubgo/redant/cmds/webcmd"
)
func main() {
root := redant.Command{
Use: "logseq",
Short: "Logseq CLI - command line tool for Logseq",
Options: redant.OptionSet{
{
Flag: "token",
Shorthand: "t",
Description: "Logseq API token",
Envs: []string{"LOGSEQ_API_TOKEN"},
Required: true,
Value: redant.StringOf(&cmds.Token),
Inherit: true,
},
{
Flag: "host",
Description: "Logseq API host",
Envs: []string{"LOGSEQ_HOST"},
Default: "127.0.0.1",
Value: redant.StringOf(&cmds.Host),
Inherit: true,
},
{
Flag: "port",
Shorthand: "p",
Description: "Logseq API port",
Envs: []string{"LOGSEQ_PORT"},
Default: "12315",
Value: redant.StringOf(&cmds.Port),
Inherit: true,
},
},
Children: []*redant.Command{
cmds.CapabilitiesCmd(),
cmds.PageCmd(),
cmds.BlockCmd(),
cmds.GraphCmd(),
cmds.QueryCmd(),
cmds.SearchCmd(),
cmds.SearchNotesCmd(),
cmds.PropertyCmd(),
cmds.TagCmd(),
cmds.WebUICmd(),
llmstxtcmd.New(),
doccmd.New(),
},
}
webcmd.AddWebCommand(&root)
mcpcmd.AddMCPCommand(&root)
completioncmd.AddCompletionCommand(&root)
if err := root.Invoke().WithOS().Run(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}