preview

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvMessages = "CCSESSION_PREVIEW_MESSAGES"
)

Variables

This section is empty.

Functions

func Run

func Run(id string, opts Options) error

Run writes the preview pane content for a given session id to stdout.

Types

type JSONMessage added in v1.0.0

type JSONMessage struct {
	Role      string `json:"role"`
	Timestamp string `json:"timestamp"`
	Body      string `json:"body"`
}

type JSONPreview added in v1.0.0

type JSONPreview struct {
	Source        string        `json:"source"`
	ID            string        `json:"id"`
	Locator       string        `json:"locator"`
	CWD           string        `json:"cwd"`
	CWDExists     bool          `json:"cwd_exists"`
	CWDUnknown    bool          `json:"cwd_unknown"`
	Label         string        `json:"label"`
	StartedAt     string        `json:"started_at"`
	LastActivity  string        `json:"last_activity"`
	TotalMessages int           `json:"total_messages"`
	Messages      []JSONMessage `json:"messages"`
	LoadError     string        `json:"load_error,omitempty"`
}

type Options added in v0.1.4

type Options struct {
	Query        string
	Regex        bool
	Locator      string
	JSON         bool
	Color        string
	NoColor      bool
	MessageLimit int
	Out          io.Writer
}

Options controls preview rendering. Query, when non-empty, highlights its matches in the message bodies; Regex treats Query as a regular expression (mirroring grep.Options).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL