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

Function newAgentSoulValidateCommand

internal/cli/authored_context.go:122–156  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

120}
121
122func newAgentSoulValidateCommand(deps commandDeps) *cobra.Command {
123 var input authoredBodyInput
124 cmd := &cobra.Command{
125 Use: "validate <agent>",
126 Short: "Validate a proposed Soul body or the current SOUL.md",
127 Example: " agh agent soul validate coder --file SOUL.md --workspace checkout-api --json",
128 Args: exactOneNonBlankArg(),
129 RunE: func(cmd *cobra.Command, args []string) error {
130 client, err := clientFromDeps(deps)
131 if err != nil {
132 return err
133 }
134 workspace, err := commandWorkspaceFlag(cmd)
135 if err != nil {
136 return err
137 }
138 body, err := readAuthoredBody(cmd, input, false)
139 if err != nil {
140 return err
141 }
142 record, err := client.ValidateAgentSoul(cmd.Context(), args[0], AgentSoulValidateRequest{
143 WorkspaceID: workspace,
144 AgentName: args[0],
145 Body: body,
146 })
147 if err != nil {
148 return err
149 }
150 return writeCommandOutput(cmd, agentSoulBundle(record))
151 },
152 }
153 addWorkspaceFlag(cmd)
154 addAuthoredBodyFlags(cmd, &input)
155 return cmd
156}
157
158func newAgentSoulWriteCommand(deps commandDeps) *cobra.Command {
159 var (

Callers 1

newAgentSoulCommandFunction · 0.85

Calls 9

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
commandWorkspaceFlagFunction · 0.85
readAuthoredBodyFunction · 0.85
writeCommandOutputFunction · 0.85
agentSoulBundleFunction · 0.85
addWorkspaceFlagFunction · 0.85
addAuthoredBodyFlagsFunction · 0.85
ValidateAgentSoulMethod · 0.65

Tested by

no test coverage detected