Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Expand ¶
Expand replaces template placeholders in s with runtime values. {profile} → profile name as-is, {Profile} → title-cased, {command} → wrapped command string, {duration} → compact elapsed time, {Duration} → spoken elapsed time.
ORDER MATTERS: uppercase variants ({Duration}, {Time}, {Date}, {Profile}) must be replaced before their lowercase counterparts. Otherwise "{Duration}" partially matches "{duration}" (a prefix), producing corrupted output. Do not reorder these replacements.
func HasDynamic ¶ added in v0.2.25
HasDynamic returns true if text contains any runtime-dependent template variables that cannot be pre-expanded at generation time. Static variables like {profile}, {Profile}, and {hostname} are excluded.
Types ¶
type Vars ¶ added in v0.2.0
type Vars struct {
Profile string
Command string
Duration string // compact: "2m15s"
DurationSay string // spoken: "2 minutes and 15 seconds"
Time string // compact: "15:04"
TimeSay string // spoken: "3:04 PM"
Date string // compact: "2006-01-02"
DateSay string // spoken: "January 2, 2006"
Hostname string
Output string // last N lines of wrapped command output
// Stdin JSON fields (auto-detected from piped JSON input).
ClaudeMessage string // from "last_assistant_message" or "message"
ClaudeHook string // from "hook_event_name"
ClaudeJSON string // raw JSON string from stdin
}
Vars holds runtime values for template expansion.