Add -m flag to gt nudge command (gt-41m3x)

This commit is contained in:
gastown/crew/max
2025-12-30 20:51:30 -08:00
committed by Steve Yegge
parent aa2aa64f59
commit 3d09c679e2
3 changed files with 16 additions and 2408 deletions

View File

@@ -1 +0,0 @@
{"timestamp":"2025-12-26T21:17:48Z","operation":"detach","pinned_bead_id":"gt-w98d","detached_molecule":"gt-wisp-48l","detached_by":"deacon","previous_state":"pinned"}

File diff suppressed because one or more lines are too long

View File

@@ -11,12 +11,15 @@ import (
"github.com/steveyegge/gastown/internal/workspace" "github.com/steveyegge/gastown/internal/workspace"
) )
var nudgeMessageFlag string
func init() { func init() {
rootCmd.AddCommand(nudgeCmd) rootCmd.AddCommand(nudgeCmd)
nudgeCmd.Flags().StringVarP(&nudgeMessageFlag, "message", "m", "", "Message to send")
} }
var nudgeCmd = &cobra.Command{ var nudgeCmd = &cobra.Command{
Use: "nudge <target> <message>", Use: "nudge <target> [message]",
GroupID: GroupComm, GroupID: GroupComm,
Short: "Send a message to a polecat or deacon session reliably", Short: "Send a message to a polecat or deacon session reliably",
Long: `Sends a message to a polecat's or deacon's Claude Code session. Long: `Sends a message to a polecat's or deacon's Claude Code session.
@@ -34,15 +37,24 @@ Special targets:
Examples: Examples:
gt nudge greenplace/furiosa "Check your mail and start working" gt nudge greenplace/furiosa "Check your mail and start working"
gt nudge greenplace/alpha "What's your status?" gt nudge greenplace/alpha -m "What's your status?"
gt nudge deacon session-started`, gt nudge deacon session-started`,
Args: cobra.ExactArgs(2), Args: cobra.RangeArgs(1, 2),
RunE: runNudge, RunE: runNudge,
} }
func runNudge(cmd *cobra.Command, args []string) error { func runNudge(cmd *cobra.Command, args []string) error {
target := args[0] target := args[0]
message := args[1]
// Get message from -m flag or positional arg
var message string
if nudgeMessageFlag != "" {
message = nudgeMessageFlag
} else if len(args) >= 2 {
message = args[1]
} else {
return fmt.Errorf("message required: use -m flag or provide as second argument")
}
// Identify sender for message prefix // Identify sender for message prefix
sender := "unknown" sender := "unknown"