You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request '[agent/claude] Fix core/cli to unblock core/agent build. Remove core.WithNa...' (#8) from agent/fix-core-cli-to-unblock-core-agent-build into main
Copy file name to clipboardExpand all lines: docs/pkg/cli/daemon.md
+3-69Lines changed: 3 additions & 69 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Daemon process management, PID files, health checks, and execution
5
5
6
6
# Daemon Mode
7
7
8
-
The framework provides both low-level daemon primitives and a high-level command group that adds `start`, `stop`, `status`, and `run` subcommands to your CLI.
8
+
The framework provides execution mode detection and signal handling for daemon processes.
9
9
10
10
## Execution Modes
11
11
@@ -29,63 +29,9 @@ cli.IsStdinTTY() // stdin is a terminal?
29
29
cli.IsStderrTTY() // stderr is a terminal?
30
30
```
31
31
32
-
## Adding Daemon Commands
32
+
## Simple Daemon
33
33
34
-
`AddDaemonCommand` registers a command group with four subcommands:
During startup, the Core framework calls your function with the root cobra command. Your function adds subcommands to it:
63
+
During `Main()`, the CLI calls your function with the Core instance. Internally it retrieves the root cobra command and passes it to your register function:
64
64
65
65
```go
66
66
funcAddScoreCommands(root *cli.Command) {
@@ -98,18 +98,17 @@ func main() {
98
98
}
99
99
```
100
100
101
-
Where `Commands()` returns a slice of framework options:
101
+
Where `Commands()` returns a slice of `CommandSetup` functions:
102
102
103
103
```go
104
104
package lemcmd
105
105
106
106
import (
107
-
"forge.lthn.ai/core/go/pkg/core"
108
107
"forge.lthn.ai/core/cli/pkg/cli"
109
108
)
110
109
111
-
funcCommands() []core.Option {
112
-
return []core.Option{
110
+
funcCommands() []cli.CommandSetup {
111
+
return []cli.CommandSetup{
113
112
cli.WithCommands("score", addScoreCommands),
114
113
cli.WithCommands("gen", addGenCommands),
115
114
cli.WithCommands("data", addDataCommands),
@@ -141,7 +140,7 @@ If you need more control over the lifecycle:
0 commit comments