From 99715e4de85358b31021d742ff2d7cf71c1de8a6 Mon Sep 17 00:00:00 2001 From: Eric Jacksch Date: Fri, 20 Mar 2026 01:31:38 -0400 Subject: [PATCH] fix(cron): show all payload fields in cron list output The list command previously showed only name, ID, schedule, status, and next run time. Channel, recipient, deliver mode, and message/command were hidden, making it impossible to tell from the CLI what a job would do or which agent would handle it. All payload fields are now displayed. Messages longer than 80 characters are truncated with an ellipsis. Jobs with a command show the command instead of a message. Co-Authored-By: Claude Sonnet 4.6 --- cmd/picoclaw/internal/cron/helpers.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/cmd/picoclaw/internal/cron/helpers.go b/cmd/picoclaw/internal/cron/helpers.go index 88bdf1bf7..75d2216ae 100644 --- a/cmd/picoclaw/internal/cron/helpers.go +++ b/cmd/picoclaw/internal/cron/helpers.go @@ -7,6 +7,8 @@ import ( "github.com/sipeed/picoclaw/pkg/cron" ) +const maxMessageDisplay = 80 + func cronListCmd(storePath string) { cs := cron.NewCronService(storePath, nil) jobs := cs.ListJobs(true) // Show all jobs, including disabled @@ -41,8 +43,20 @@ func cronListCmd(storePath string) { fmt.Printf(" %s (%s)\n", job.Name, job.ID) fmt.Printf(" Schedule: %s\n", schedule) - fmt.Printf(" Status: %s\n", status) + fmt.Printf(" Status: %s\n", status) fmt.Printf(" Next run: %s\n", nextRun) + fmt.Printf(" Channel: %s\n", job.Payload.Channel) + fmt.Printf(" To: %s\n", job.Payload.To) + fmt.Printf(" Deliver: %v\n", job.Payload.Deliver) + if job.Payload.Command != "" { + fmt.Printf(" Command: %s\n", job.Payload.Command) + } else { + msg := job.Payload.Message + if len(msg) > maxMessageDisplay { + msg = msg[:maxMessageDisplay] + "..." + } + fmt.Printf(" Message: %s\n", msg) + } } }