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

Function newSessionRemoveCommand

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

Source from the content-addressed store, hash-verified

227}
228
229func newSessionRemoveCommand(deps commandDeps) *cobra.Command {
230 return &cobra.Command{
231 Use: "remove <id>",
232 Short: "Remove a session and its persisted history",
233 Example: ` # Remove a stopped session
234 agh session remove sess_1234`,
235 Args: exactOneNonBlankArg(),
236 RunE: func(cmd *cobra.Command, args []string) error {
237 client, err := clientFromDeps(deps)
238 if err != nil {
239 return err
240 }
241 info, err := client.GetSession(cmd.Context(), args[0])
242 if err != nil {
243 return err
244 }
245 if err := client.DeleteSession(cmd.Context(), args[0]); err != nil {
246 return err
247 }
248 return writeCommandOutput(cmd, sessionBundle(info, deps.now))
249 },
250 }
251}
252
253func newSessionStatusCommand(deps commandDeps) *cobra.Command {
254 return &cobra.Command{

Callers 1

newSessionCommandFunction · 0.85

Calls 6

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

Tested by

no test coverage detected