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

Function newSessionStopCommand

internal/cli/session.go:204–227  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

202}
203
204func newSessionStopCommand(deps commandDeps) *cobra.Command {
205 return &cobra.Command{
206 Use: "stop <id>",
207 Short: "Stop a session",
208 Example: ` # Stop a running session
209 agh session stop sess_1234`,
210 Args: exactOneNonBlankArg(),
211 RunE: func(cmd *cobra.Command, args []string) error {
212 client, err := clientFromDeps(deps)
213 if err != nil {
214 return err
215 }
216 if err := client.StopSession(cmd.Context(), args[0]); err != nil {
217 return err
218 }
219
220 info, err := client.GetSession(cmd.Context(), args[0])
221 if err != nil {
222 return err
223 }
224 return writeCommandOutput(cmd, sessionBundle(info, deps.now))
225 },
226 }
227}
228
229func newSessionRemoveCommand(deps commandDeps) *cobra.Command {
230 return &cobra.Command{

Callers 1

newSessionCommandFunction · 0.85

Calls 6

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
sessionBundleFunction · 0.85
StopSessionMethod · 0.65
GetSessionMethod · 0.65

Tested by

no test coverage detected