MCPcopy Create free account
hub / github.com/compozy/agh / newDaemonStartCommand

Function newDaemonStartCommand

internal/cli/daemon.go:54–83  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

52}
53
54func newDaemonStartCommand(deps commandDeps) *cobra.Command {
55 var (
56 foreground bool
57 internalChild bool
58 )
59
60 cmd := &cobra.Command{
61 Use: daemonStartKey,
62 Short: "Start the AGH daemon",
63 Example: ` # Start AGH in the background and wait for readiness
64 agh daemon start
65
66 # Keep logs attached to the current terminal
67 agh daemon start --foreground`,
68 RunE: func(cmd *cobra.Command, _ []string) error {
69 if foreground || internalChild {
70 return runDaemonForeground(cmd.Context(), deps)
71 }
72 status, err := runDaemonDetached(cmd.Context(), deps)
73 if err != nil {
74 return err
75 }
76 return writeCommandOutput(cmd, daemonStatusBundle(status, deps.now))
77 },
78 }
79 cmd.Flags().BoolVar(&foreground, "foreground", false, "Run the daemon in the foreground")
80 cmd.Flags().BoolVar(&internalChild, internalChildFlagName, false, "Internal detached child mode")
81 mustMarkFlagHidden(cmd, internalChildFlagName)
82 return cmd
83}
84
85func newDaemonRelaunchCommand(deps commandDeps) *cobra.Command {
86 return &cobra.Command{

Callers 1

newDaemonCommandFunction · 0.85

Calls 5

runDaemonForegroundFunction · 0.85
runDaemonDetachedFunction · 0.85
writeCommandOutputFunction · 0.85
daemonStatusBundleFunction · 0.85
mustMarkFlagHiddenFunction · 0.85

Tested by

no test coverage detected