listary 0.0.1

A fast command-line file search utility inspired by Listary, with fuzzy search, application launching, and smart auto-open features
## listary

<!-- /ˈblitsər/ "闪击者" - Blitz search in your terminal. -->

A fast command-line file search utility inspired by [Listary](https://www.listary.com/), built in Rust.

### Features

- **Fast fuzzy search** - Quickly find files and applications by typing partial names
- 📁 **Directory traversal** - Recursively index files and directories  
- 🚀 **Application search** - Find and launch installed applications (Windows/macOS/Linux)
- 💾 **Smart caching** - Index cache for faster subsequent searches
- 🎨 **Colorful output** - Beautiful terminal interface with file type icons
- 🔍 **Interactive mode** - Real-time search with keyboard navigation
- 📊 **File information** - Show file sizes and locations
- 🎯 **Multi-source indexing** - Registry, Start Menu, Program Files, and Applications scanning
- 📜 **Search history** - Remember and browse previous search queries with arrow keys
- 🤖 **Smart auto-open** - Automatically open exact application matches
- ⌨️ **Shell-like experience** - Arrow key navigation, Ctrl+C handling, and command history

### Installation

```bash
# Clone the repository
git clone <your-repo-url>
cd listary

# Build and install
cargo build --release
cargo install --path .
```

### Usage

#### Command Line Search
```bash
# Search for files in current directory
listary "config"

# Search for files in specific paths
listary "readme" --paths "/home/user,/opt"

# Search for applications (cross-platform)
listary "notepad" --apps

# Launch an application directly
listary --launch "notepad"

# Disable auto-opening of exact matches
listary "calculator" --apps --no-auto-open

# Limit results
listary "main" --limit 10

# Rebuild index cache
listary --rebuild
```

#### Interactive Mode
```bash
# Start interactive search (files only)
listary

# Start interactive search with applications
listary --apps

# Then type your search queries and use interactive features
search> config
search> notepad        # Find applications (exact matches auto-open)
search> ↑             # Browse search history with arrow keys
search> history       # View all search history
search> 1             # Open first result by number
search> clear         # Clear search history
search> q             # Quit
```

#### Options
- `-p, --paths <PATHS>` - Comma-separated paths to search (default: current directory)
- `-l, --limit <NUMBER>` - Maximum number of results (default: 50)
- `-r, --rebuild` - Rebuild file index cache
- `-a, --apps` - Include installed applications in search (cross-platform)
- `--launch <APP_NAME>` - Launch the first matching application
- `--no-auto-open` - Disable auto-opening of single exact application matches
- `-h, --help` - Show help information

### Examples

```bash
# Find all Rust files
listary "rs"

# Search for configuration files
listary "config" --paths "/etc,~/.config"

# Find applications containing "chrome" (exact matches auto-open)
listary "chrome" --apps

# Find applications without auto-opening
listary "calculator" --apps --no-auto-open

# Launch Notepad directly
listary --launch "notepad"

# Interactive search with applications and custom limit
listary --apps --limit 100

# Search only in specific directories
listary "main" --paths "C:\Users\YourName\Documents,D:\Projects"

# Interactive mode examples
listary --apps
# search> Calculator    # Auto-opens Calculator app
# search> ↑↓           # Browse search history
# search> history      # View all search history
# search> 1            # Open first search result
```

### File Type Icons

The tool displays different icons for various file types:
- 📁 Directories
- 🚀 Applications (installed programs)
- 💻 Code files (.rs, .py, .js, etc.)
- 📄 Text files (.txt, .md, etc.)
- 🖼️ Images (.png, .jpg, etc.)
- 🎵 Audio files (.mp3, .wav, etc.)
- 🎬 Video files (.mp4, .avi, etc.)
- 📦 Archives (.zip, .tar, etc.)
- And more...

### Application Search Details

The application search feature scans multiple sources across platforms:

#### Windows
- **Windows Registry** - Installed programs from `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall`
- **Start Menu** - Shortcuts from user and system Start Menu folders
- **Program Files** - Executable files from `C:\Program Files` and `C:\Program Files (x86)`

#### macOS
- **Applications** - Apps from `/Applications`, `/System/Applications`, and `~/Applications`
- **System Apps** - Core system applications from `/System/Library/CoreServices`
- **App Bundles** - Parsing of `.app` bundles and Info.plist files

#### Linux
- **Desktop Entries** - Standard `.desktop` files in system and user directories
- **Executable Files** - Direct executable discovery using `xdg-open`

### Interactive Features

- **🔍 Search History** - All searches are automatically saved and can be browsed with ↑↓ arrow keys
- **🤖 Smart Auto-Open** - Exact application name matches are automatically opened (e.g., typing "Calculator" opens Calculator immediately)
- **⌨️ Keyboard Navigation** - Full shell-like experience with history, tab completion, and Ctrl+C handling
- **📜 History Management** - View history with `history` command, clear with `clear` command

### Performance

- **Fast indexing** - File system traversal with configurable depth limits
- **Smart caching** - Indexes are cached to avoid repeated scanning
- **Fuzzy matching** - Intelligent search algorithm that finds partial matches
- **Concurrent processing** - Multi-threaded operations for better performance