cli

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package cli implements command-line interface tools for the file manager. It provides commands for search, info, analyze, and configuration management that can be used in scripts and non-interactive environments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintHelp

func PrintHelp(styles theme.Stylesheet, themeName string)

PrintHelp displays the help information to the console

func RunAnalyze added in v1.1.1

func RunAnalyze(args *Args) error

RunAnalyze executes the disk usage analysis from CLI

func RunConfig added in v1.1.3

func RunConfig(args *Args) error

RunConfig handles the config subcommand

func RunInfo added in v1.0.7

func RunInfo(opts InfoOptions) error

RunInfo executes the info command

func RunSearch added in v1.0.1

func RunSearch(args *Args) error

RunSearch performs the fuzzy search from the CLI

Types

type Args

type Args struct {
	// ... (omitting fields for brevity in instruction, but keeping them in new_string)
	Remote      string
	ShowVersion bool
	IsSearch    bool
	SearchQuery string
	IsRegex     bool
	IsInfo      bool
	InfoJSON    bool
	InfoTree    bool
	InfoDepth   int
	IsAnalyze   bool
	IsConfig    bool
	ConfigReset bool
	ConfigInit  bool
	Args        []string
}

Args contains the parsed command line arguments

func Parse

func Parse() (*Args, error)

Parse handles command line flag parsing

type ConfigInitModel added in v1.1.3

type ConfigInitModel struct {
	// contains filtered or unexported fields
}

ConfigInitModel handles the interactive config initialization

func (ConfigInitModel) Init added in v1.1.3

func (m ConfigInitModel) Init() tea.Cmd

func (ConfigInitModel) Update added in v1.1.3

func (m ConfigInitModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ConfigInitModel) View added in v1.1.3

func (m ConfigInitModel) View() string

type GitStats added in v1.0.7

type GitStats struct {
	Modified  int `json:"modified"`
	Added     int `json:"added"`
	Deleted   int `json:"deleted"`
	Untracked int `json:"untracked"`
	Staged    int `json:"staged"`
}

GitStats contains git statistics for a directory

type HighlightStyles added in v1.0.1

type HighlightStyles struct {
	Match lipgloss.Style
	Base  lipgloss.Style
}

HighlightStyles defines styles for search result highlighting

type InfoOptions added in v1.0.7

type InfoOptions struct {
	Path      string
	JSON      bool
	Tree      bool
	TreeDepth int
	Remote    string
}

InfoOptions contains options for the info command

type InfoResult added in v1.0.7

type InfoResult struct {
	Path          string    `json:"path"`
	Type          string    `json:"type"` // "file" or "directory"
	Size          int64     `json:"size"`
	SizeFormatted string    `json:"size_formatted"`
	Permissions   string    `json:"permissions"`
	Mode          string    `json:"mode"`
	Modified      time.Time `json:"modified"`
	CanRead       bool      `json:"can_read"`
	CanWrite      bool      `json:"can_write"`

	// Directory-specific
	FileCount          int    `json:"file_count,omitempty"`
	DirectoryCount     int    `json:"directory_count,omitempty"`
	TotalSize          int64  `json:"total_size,omitempty"`
	TotalSizeFormatted string `json:"total_size_formatted,omitempty"`

	// Git-specific
	InGitRepo bool      `json:"in_git_repo"`
	GitRoot   string    `json:"git_root,omitempty"`
	GitBranch string    `json:"git_branch,omitempty"`
	GitStatus string    `json:"git_status,omitempty"`
	GitStats  *GitStats `json:"git_stats,omitempty"`

	// Tree view (only when --tree is used)
	Tree *TreeNode `json:"tree,omitempty"`
}

InfoResult contains the information about a path

type TreeNode added in v1.0.7

type TreeNode struct {
	Name     string     `json:"name"`
	Path     string     `json:"path"`
	IsDir    bool       `json:"is_dir"`
	Size     int64      `json:"size"`
	Children []TreeNode `json:"children,omitempty"`
}

TreeNode represents a node in the tree view

Jump to

Keyboard shortcuts

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