cli

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands = []struct {
	Name string
	Desc string
}{
	{"urls", "List URLs from the Claude session (interactive on TTY)"},
	{"files", "List file paths touched by the session (interactive on TTY)"},
	{"changes", "List file changes made by the session (interactive on TTY)"},
	{"images", "List image paths from the session (interactive on TTY)"},
	{"conversation", "List conversation turns from the Claude session (interactive on TTY)"},
	{"sessions", "List session IDs with metadata (use --pick for TUI JSON picker)"},
	{"help", "Show available commands and usage"},
}

Commands documents all available subcommands.

Functions

func RunSessions

func RunSessions(claudeDir string, all bool) error

runSessions lists sessions sorted by modification time (most recent first). By default, filters to sessions matching the current tmux window's project paths. With --all, lists every session. Output: ID SHORT_ID MODIFIED MSGS PROJECT PROMPT

Types

type ItemRef

type ItemRef struct {
	EntryUUID string
	Timestamp time.Time
	Role      string // user|assistant
	Preview   string // 3-5 lines of conversation context
	ToolName  string // for changes: Edit, Write, etc.
	ToolInput string // for changes: raw JSON tool input for diff rendering
}

ItemRef is a single reference (context) where an item was found.

type PickSessionExitCode

type PickSessionExitCode int
const (
	PickSessionConfirmed PickSessionExitCode = 0
	PickSessionError     PickSessionExitCode = 1
	PickSessionNoMatches PickSessionExitCode = 2
	PickSessionCancelled PickSessionExitCode = 130
)

func RunPickSessionTUI

func RunPickSessionTUI(claudeDir, search string, multi bool) PickSessionExitCode

RunPickSessionTUI launches the full ccx TUI in pick mode on stderr, leaving stdout clean for the JSON envelope. The user confirms the pick via the actions menu (x → P). Returns the exit code the caller should use.

type PickerItem

type PickerItem struct {
	Item                  extract.Item
	SessionID             string
	Refs                  []ItemRef // all places this item was referenced
	ConversationArtifacts []extract.Item
	ConversationText      string
}

PickerItem is a deduplicated item with all its references.

func (PickerItem) FilterValue

func (p PickerItem) FilterValue() string

FilterValue returns searchable text for the picker filter. Includes is:<category> tags for structured filtering.

func (PickerItem) FirstRef

func (p PickerItem) FirstRef() ItemRef

FirstRef returns the most recent reference for display.

type PickerResult

type PickerResult struct {
	SessionID string
	EntryUUID string
}

PickerResult is returned when the picker exits with a jump target.

func RunPicker

func RunPicker(kind string, items []PickerItem) (*PickerResult, error)

RunPicker launches the interactive picker and returns the result.

type RunResult

type RunResult struct {
	// JumpSession/JumpUUID are set when the user chose "jump to conversation" in the picker.
	JumpSession string
	JumpUUID    string
}

RunResult holds the outcome of a subcommand.

func Run

func Run(command, claudeDir string, plain bool) (*RunResult, error)

Run executes a CLI subcommand. Returns a RunResult (non-nil JumpSession means the caller should launch the full TUI and navigate to that message).

Jump to

Keyboard shortcuts

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