cli

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is set at build time via -ldflags
	Version = "dev"
	// Commit is set at build time via -ldflags
	Commit = "unknown"
)

Functions

func BlameCmd

func BlameCmd() *cobra.Command

BlameCmd creates the blame command

func CatCmd

func CatCmd() *cobra.Command

CatCmd creates the cat command for dumping objects

func FormatMessagesHumanReadable added in v0.2.0

func FormatMessagesHumanReadable(messages []json.RawMessage, indent string) string

FormatMessagesHumanReadable converts raw message JSON into readable conversation format

func FormatMessagesHumanReadable_OLD added in v0.2.0

func FormatMessagesHumanReadable_OLD(messages []json.RawMessage, indent string) string

PLACEHOLDER - will implement proper parsing once we understand the format

func HookCmd

func HookCmd() *cobra.Command

HookCmd creates the legacy Claude Code PostToolUse hook command.

func InitCmd

func InitCmd() *cobra.Command

func LogCmd

func LogCmd() *cobra.Command

LogCmd creates the log command

func RenderGraph added in v0.2.0

func RenderGraph(steps []index.StepInfo, s *store.Store) ([]string, error)

RenderGraph generates ASCII graph prefixes for each step Returns a slice of prefixes, one per step, in the same order as input

func RenderGraphLine added in v0.2.0

func RenderGraphLine(node *GraphNode, layout *GraphLayout, nextNode *GraphNode) string

RenderGraphLine generates the ASCII art prefix for a single step

func SessionsCmd

func SessionsCmd() *cobra.Command

SessionsCmd creates the sessions command

func ShowCmd

func ShowCmd() *cobra.Command

func StatusCmd

func StatusCmd() *cobra.Command

StatusCmd creates the status command

func VersionCmd

func VersionCmd() *cobra.Command

VersionCmd creates the version command

Types

type DefaultFormatter

type DefaultFormatter struct {
	NoColor bool
}

DefaultFormatter produces timeline view with arrows

func (*DefaultFormatter) Format

func (f *DefaultFormatter) Format(steps []EnrichedStep, sessionID string, showConversation bool, showFiles bool, w io.Writer) error

type EnrichedCause added in v0.2.0

type EnrichedCause struct {
	Cause  store.Cause
	Args   json.RawMessage
	Result json.RawMessage
}

type EnrichedStep

type EnrichedStep struct {
	StepInfo    index.StepInfo
	Causes      []EnrichedCause
	Files       []string
	FileDiffs   []FileDiff // Actual file changes (parent → current)
	Args        json.RawMessage
	Result      json.RawMessage
	Duration    time.Duration
	Messages    []json.RawMessage // Conversation transcript
	GraphPrefix string            // ASCII graph line prefix (if graph enabled)
	Warnings    []string          // Non-fatal data recovery or display issues
}

EnrichedStep contains a step with all its related data

type FileDiff added in v0.2.0

type FileDiff struct {
	Path      string
	Status    string // "added", "modified", "deleted"
	Additions int
	Deletions int
	IsBinary  bool
}

FileDiff represents a file change between steps

type GraphLayout added in v0.2.0

type GraphLayout struct {
	Nodes      []*GraphNode
	ColumnMap  map[store.Hash]int // stepHash → column
	MaxColumns int
}

GraphLayout holds the column assignments for rendering

func LayoutGraph added in v0.2.0

func LayoutGraph(nodes []*GraphNode) *GraphLayout

LayoutGraph assigns columns to each node using a topological layout

type GraphNode added in v0.2.0

type GraphNode struct {
	StepHash  store.Hash
	Parents   []store.Hash // [primary, secondary if exists]
	Children  []store.Hash // Derived from parent pointers
	Column    int          // Display column (0-based)
	SessionID string
}

GraphNode represents a step in the graph with its relationships

func BuildStepGraph added in v0.2.0

func BuildStepGraph(s *store.Store, steps []index.StepInfo) ([]*GraphNode, error)

BuildStepGraph constructs parent→children relationships from steps

type JSONFormatter

type JSONFormatter struct{}

JSONFormatter produces machine-readable JSON output

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(steps []EnrichedStep, sessionID string, showConversation bool, showFiles bool, w io.Writer) error

type LogFormat

type LogFormat string

LogFormat represents different output formats

const (
	FormatDefault LogFormat = "default" // Timeline view
	FormatOneline LogFormat = "oneline" // Compact
	FormatJSON    LogFormat = "json"    // Machine readable
	FormatStat    LogFormat = "stat"    // With file stats
)

type LogFormatter

type LogFormatter interface {
	Format(steps []EnrichedStep, sessionID string, showConversation bool, showFiles bool, w io.Writer) error
}

LogFormatter formats steps for output

type OnelineFormatter

type OnelineFormatter struct{}

OnelineFormatter produces compact one-line-per-step output

func (*OnelineFormatter) Format

func (f *OnelineFormatter) Format(steps []EnrichedStep, sessionID string, showConversation bool, showFiles bool, w io.Writer) error

type StatFormatter

type StatFormatter struct{}

StatFormatter shows file statistics

func (*StatFormatter) Format

func (f *StatFormatter) Format(steps []EnrichedStep, sessionID string, showConversation bool, showFiles bool, w io.Writer) error

Jump to

Keyboard shortcuts

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