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

Function newMeCommand

internal/cli/agent_kernel.go:45–72  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

43)
44
45func newMeCommand(deps commandDeps) *cobra.Command {
46 cmd := &cobra.Command{
47 Use: "me",
48 Short: "Inspect the current AGH-managed agent session",
49 Example: ` # Show the current managed session identity
50 agh me
51
52 # Print machine-readable caller state
53 agh me -o json`,
54 RunE: func(cmd *cobra.Command, _ []string) error {
55 client, err := clientFromDeps(deps)
56 if err != nil {
57 return err
58 }
59 credentials, err := requireAgentCommandIdentity(cmd.Context(), deps, client, agentActionCLI("me"))
60 if err != nil {
61 return err
62 }
63 record, err := client.AgentMe(cmd.Context(), credentials)
64 if err != nil {
65 return err
66 }
67 return writeCommandOutput(cmd, agentMeBundle(record))
68 },
69 }
70 cmd.AddCommand(newMeContextCommand(deps))
71 return cmd
72}
73
74func newMeContextCommand(deps commandDeps) *cobra.Command {
75 return &cobra.Command{

Callers 1

newRootCommandFunction · 0.85

Calls 7

clientFromDepsFunction · 0.85
agentActionCLIFunction · 0.85
writeCommandOutputFunction · 0.85
agentMeBundleFunction · 0.85
newMeContextCommandFunction · 0.85
AgentMeMethod · 0.65

Tested by

no test coverage detected