Complete inbox CLI implementation
This commit is contained in:
@@ -17,6 +17,7 @@ type replyOptions struct {
|
||||
kind string
|
||||
summary string
|
||||
body string
|
||||
bodyFile string
|
||||
payloadJSON string
|
||||
}
|
||||
|
||||
@@ -37,6 +38,11 @@ func newReplyCmd(root *rootOptions) *cobra.Command {
|
||||
return fmt.Errorf("from agent is required")
|
||||
}
|
||||
|
||||
body, err := resolveBodyValue(opts.body, opts.bodyFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sqlDB, err := db.Open(ctx, root.dbPath)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -50,7 +56,7 @@ func newReplyCmd(root *rootOptions) *cobra.Command {
|
||||
ToAgent: opts.to,
|
||||
Kind: opts.kind,
|
||||
Summary: opts.summary,
|
||||
Body: opts.body,
|
||||
Body: body,
|
||||
PayloadJSON: opts.payloadJSON,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -81,6 +87,7 @@ func newReplyCmd(root *rootOptions) *cobra.Command {
|
||||
cmd.Flags().StringVar(&opts.kind, "kind", "answer", "Reply kind")
|
||||
cmd.Flags().StringVar(&opts.summary, "summary", "", "Short reply summary")
|
||||
cmd.Flags().StringVar(&opts.body, "body", "", "Reply body")
|
||||
cmd.Flags().StringVar(&opts.bodyFile, "body-file", "", "Read reply body from file")
|
||||
cmd.Flags().StringVar(&opts.payloadJSON, "payload-json", "", "Structured payload JSON string")
|
||||
|
||||
_ = cmd.MarkFlagRequired("thread")
|
||||
|
||||
Reference in New Issue
Block a user