MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / runNew

Function runNew

cmd/chief/main.go:256–280  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

254}
255
256func runNew() {
257 opts := cmd.NewOptions{}
258
259 // Parse arguments: chief new [name] [context...] [--agent X] [--agent-path X]
260 flagAgent, flagPath, positional := parseAgentFlags(os.Args, 2)
261 // Filter out remaining flags, keep only positional args
262 var args []string
263 for _, a := range positional {
264 if !strings.HasPrefix(a, "-") {
265 args = append(args, a)
266 }
267 }
268 if len(args) > 0 {
269 opts.Name = args[0]
270 }
271 if len(args) > 1 {
272 opts.Context = strings.Join(args[1:], " ")
273 }
274
275 opts.Provider = resolveProvider(flagAgent, flagPath)
276 if err := cmd.RunNew(opts); err != nil {
277 fmt.Fprintf(os.Stderr, "Error: %v\n", err)
278 os.Exit(1)
279 }
280}
281
282func runEdit() {
283 opts := cmd.EditOptions{}

Callers 1

mainFunction · 0.85

Calls 3

RunNewFunction · 0.92
parseAgentFlagsFunction · 0.85
resolveProviderFunction · 0.85

Tested by

no test coverage detected