Implement positional prompt execution with native reporting and outcomes
This commit is contained in:
@@ -22,13 +22,13 @@ func Execute(ctx context.Context, identity commandkit.Identity, args []string, s
|
||||
func newApp(identity commandkit.Identity) (*commandkit.App, error) {
|
||||
definitions := promptSuite()
|
||||
declarations := []commandkit.Declaration{
|
||||
commandkit.NewCommand(commandkit.CommandSpec[struct{}]{Name: "run", Summary: "Run a stored prompt.", Run: commandNotImplemented}),
|
||||
commandkit.NewCommand(commandkit.CommandSpec[serveInput]{Name: "serve", Summary: "Serve the HTTP API.", Flags: serveFlags(), Run: func(commandkit.Invocation, serveInput) commandkit.Outcome {
|
||||
return commandkit.Failure("Server startup is not implemented.")
|
||||
}}),
|
||||
configurationCommand(),
|
||||
commandkit.Completion("scriptorium"),
|
||||
}
|
||||
declarations = append(declarations, runDeclarations()...)
|
||||
declarations = append(declarations, ckprompt.Declarations(definitions)...)
|
||||
return commandkit.New(identity, declarations...)
|
||||
}
|
||||
@@ -42,7 +42,3 @@ func serveFlags() []commandkit.Flag[serveInput] {
|
||||
flags := configurationSelectors(func(input *serveInput) *ckconfig.Selection { return &input.Selection })
|
||||
return append(flags, serverSelectors(func(input *serveInput) *applicationInput { return &input.Application })...)
|
||||
}
|
||||
|
||||
func commandNotImplemented(commandkit.Invocation, struct{}) commandkit.Outcome {
|
||||
return commandkit.Failure("Application command is not implemented.")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user