system

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package system provides system utility commands (ls, grep, find, tree, wc, watch, read, search, log, deps, clean, ccusage, discover, tee, profile).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CcusagePeriod

type CcusagePeriod struct {
	Key                 string  `json:"key"`
	InputTokens         uint64  `json:"inputTokens"`
	OutputTokens        uint64  `json:"outputTokens"`
	CacheCreationTokens uint64  `json:"cacheCreationTokens"`
	CacheReadTokens     uint64  `json:"cacheReadTokens"`
	TotalTokens         uint64  `json:"totalTokens"`
	TotalCost           float64 `json:"totalCost"`
}

CcusagePeriod represents usage data for a time period.

type ClaudeContent added in v0.28.0

type ClaudeContent struct {
	Type      string                 `json:"type"`
	ID        string                 `json:"id,omitempty"`
	Name      string                 `json:"name,omitempty"`
	Input     map[string]interface{} `json:"input,omitempty"`
	ToolUseID string                 `json:"tool_use_id,omitempty"`
}

type ClaudeJSONLMessage added in v0.28.0

type ClaudeJSONLMessage struct {
	Type    string        `json:"type"`
	Message ClaudeMessage `json:"message"`
}

ClaudeJSONLMessage represents the structure of Claude Code JSONL files

type ClaudeMessage added in v0.28.0

type ClaudeMessage struct {
	Role    string          `json:"role"`
	Content []ClaudeContent `json:"content"`
}

type DirNode

type DirNode struct {
	Name    string
	Path    string
	Files   []FileInfo
	SubDirs []*DirNode
	Depth   int
}

DirNode represents a directory in the project map.

type DiscoverResult

type DiscoverResult struct {
	SessionsScanned   int                 `json:"sessions_scanned"`
	TotalCommands     int                 `json:"total_commands"`
	AlreadyTokMan     int                 `json:"already_tokman"`
	SupportedMissed   []DiscoveredCommand `json:"supported_missed"`
	Unsupported       []DiscoveredCommand `json:"unsupported,omitempty"`
	ParseErrors       int                 `json:"parse_errors"`
	TokManBypassCount int                 `json:"tokman_bypass_count,omitempty"`
	TokManBypassCmds  []string            `json:"tokman_bypass_commands,omitempty"`
}

DiscoverResult represents the discovery results

type DiscoveredCommand

type DiscoveredCommand struct {
	Command     string  `json:"command"`
	Count       int     `json:"count"`
	Category    string  `json:"category"`
	TokManEquiv string  `json:"tokman_equivalent,omitempty"`
	EstSavings  float64 `json:"estimated_savings_pct"`
	TokensSaved int     `json:"tokens_saved,omitempty"`
}

DiscoveredCommand represents a discovered command pattern

type FileInfo

type FileInfo struct {
	Name        string `json:"name"`
	Ext         string `json:"ext"`
	Size        int64  `json:"size"`
	Lines       int    `json:"lines"`
	Tokens      int    `json:"tokens,omitempty"`
	Signatures  int    `json:"signatures,omitempty"`
	IsGenerated bool   `json:"-"`
}

FileInfo represents a single file's metadata.

type LegacyDiscoverResult added in v0.28.0

type LegacyDiscoverResult struct {
	Project         string              `json:"project,omitempty"`
	TotalCommands   int                 `json:"total_commands"`
	MissedSavings   int                 `json:"missed_savings"`
	Opportunities   []DiscoveredCommand `json:"opportunities"`
	UnsupportedCmds []DiscoveredCommand `json:"unsupported_commands,omitempty"`
}

LegacyDiscoverResult for backward compatibility with old code

type LegacyDiscoveredCommand added in v0.28.0

type LegacyDiscoveredCommand struct {
	Command     string  `json:"command"`
	Count       int     `json:"count"`
	Category    string  `json:"category"`
	CouldSave   bool    `json:"could_save"`
	SavingsPct  float64 `json:"savings_percent,omitempty"`
	TokensSaved int     `json:"tokens_saved,omitempty"`
	Example     string  `json:"example,omitempty"`
}

LegacyDiscoveredCommand for backward compatibility

type Summary added in v0.28.0

type Summary struct {
	Line1 string
	Line2 string
}

Summary represents a 2-line file summary

type WcMode

type WcMode int

WcMode represents which columns the user requested

const (
	WcModeFull  WcMode = iota // Default: lines, words, bytes (3 columns)
	WcModeLines               // Lines only (-l)
	WcModeWords               // Words only (-w)
	WcModeBytes               // Bytes only (-c)
	WcModeChars               // Chars only (-m)
	WcModeMixed               // Multiple flags combined
)

Jump to

Keyboard shortcuts

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