Complete inbox CLI implementation
This commit is contained in:
@@ -16,6 +16,7 @@ type updateOptions struct {
|
||||
status string
|
||||
summary string
|
||||
body string
|
||||
bodyFile string
|
||||
payloadJSON string
|
||||
}
|
||||
|
||||
@@ -36,6 +37,11 @@ func newUpdateCmd(root *rootOptions) *cobra.Command {
|
||||
return fmt.Errorf("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
|
||||
@@ -48,7 +54,7 @@ func newUpdateCmd(root *rootOptions) *cobra.Command {
|
||||
Agent: agent,
|
||||
Status: opts.status,
|
||||
Summary: opts.summary,
|
||||
Body: opts.body,
|
||||
Body: body,
|
||||
PayloadJSON: opts.payloadJSON,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -78,6 +84,7 @@ func newUpdateCmd(root *rootOptions) *cobra.Command {
|
||||
cmd.Flags().StringVar(&opts.status, "status", "", "New status: in_progress or blocked")
|
||||
cmd.Flags().StringVar(&opts.summary, "summary", "", "Short update summary")
|
||||
cmd.Flags().StringVar(&opts.body, "body", "", "Update body")
|
||||
cmd.Flags().StringVar(&opts.bodyFile, "body-file", "", "Read update body from file")
|
||||
cmd.Flags().StringVar(&opts.payloadJSON, "payload-json", "", "Structured payload JSON string")
|
||||
|
||||
_ = cmd.MarkFlagRequired("thread")
|
||||
|
||||
Reference in New Issue
Block a user