Skip to content

triyanox/lla

Repository files navigation

lla - Blazing Fast ls Replacement with Superpowers

AUR package crates.io package Homebrew package nixpkgs unstable package pkgsrc current package

Overview

lla is a high-performance file explorer written in Rust that enhances the traditional ls command with modern features, rich formatting options, and a powerful plugin system.

Table of Contents

Installation

# Using Cargo
cargo install lla

# On macOS
brew install lla

# On Arch Linux
paru -S lla

# On NetBSD
pkgin install lla

# Manual - Example is for amd64 GNU, replaces the file names if downloading for a different arch.
wget -c https://github.com/triyanox/lla/releases/download/v0.3.0/lla-linux-amd64 -O lla
sudo chmod +x lla
sudo chown root:root lla
sudo mv lla /usr/local/bin/lla

After installation, initialize your setup:

# Create default config
lla init

# View your config
lla config

Features

Display Formats

Default View

Quick and clean directory listing

lla

default

Long Format

Detailed file information with metadata

lla -l

long

Tree View

Hierarchical directory visualization

lla -t

tree

Table View

Structured data display

lla -T

table

Grid View

Organized layout for better readability

lla -g

grid

Git-Aware View

Repository status and insights

lla -G

git

Timeline View

Group files by dates

lla --timeline

timeline

Sizemap View

Visualize file sizes relative to each other

lla -S

sizemap

Icons support

Icons are supported in all formats simply by using the --icons flag.

lla --icons

icons

Core Features

Display Options

  • Long format (-l, --long): Detailed file information with metadata
  • Tree view (-t, --tree): Hierarchical directory visualization
  • Table view (-T, --table): Structured data display
  • Grid view (-g, --grid): Organized layout for better readability
  • Size map (-S, --sizemap): Visual representation of file sizes
  • Timeline view (--timeline): Group files by time periods
  • Git-aware view (-G, --git): Repository status and information
  • Icons (--icons): Show icons for files and directories

Organization & Sorting

  • Sort files (-s, --sort):
    • By name (default)
    • By size
    • By date (modification time)
  • Sort modifiers:
    • Reverse order (-r, --sort-reverse)
    • Directories first (--sort-dirs-first)
    • Case-sensitive (--sort-case-sensitive)
    • Natural number sorting (--sort-natural)
  • Recursive listing with depth control (-d, --depth)
  • Performance optimization for large directories:
    • Configurable maximum entries for tree view (default: 20,000)
    • Configurable maximum entries for recursive listing (default: 20,000)

File Filtering

  • Filter by pattern (-f, --filter)
  • Case-sensitive filtering (-c, --case-sensitive)
  • Support for complex filter patterns:
    • Simple text matching
    • Regular expressions
    • Glob patterns
    • Logical operators (AND, OR, NOT, XOR)

Plugin System

  • Enable/disable plugins (--enable-plugin, --disable-plugin)
  • Custom plugin directory support (--plugins-dir)
  • Plugin action support (--plugin-arg)

Usage

Command Reference

Basic Usage

lla                     # List current directory (default view)
lla /path/to/dir       # List specific directory
lla -l                 # Long format with detailed information
lla -t                 # Tree view
lla -T                 # Table view
lla -g                 # Grid view
lla -G                 # Git-aware view
lla -S                 # Size map view
lla --timeline         # Timeline view
lla --icons           # Show file/directory icons

Sorting & Organization

lla -s name            # Sort by name (default)
lla -s size            # Sort by size
lla -s date            # Sort by date
lla -r                 # Reverse sort order
lla --sort-dirs-first  # List directories before files
lla --sort-case-sensitive # Case-sensitive sorting
lla --sort-natural     # Natural number sorting (2.txt before 10.txt)

Depth Control

lla -d 2               # List directory tree with depth 2
lla -t -d 3           # Tree view with max depth 3

Filter System

Basic Filtering

lla -f "test"              # Find files containing "test"
lla -f "test" -c          # Case-sensitive search
lla -f ".rs"              # Find files with .rs extension

Advanced Filters

Pattern Filters

lla -f "test,spec"         # OR operation
lla -f "+test,api"         # AND operation

Regular Expression Filters

lla -f "regex:^test.*\.rs$"   # Rust files starting with "test"
lla -f "regex:\d{4}"          # Files containing 4 digits

Glob Pattern Filters

lla -f "glob:*.{rs,toml}"     # Match .rs or .toml files
lla -f "glob:test_*"          # Files starting with test_

Composite Filters

lla -f "test AND .rs"         # AND operation
lla -f "test OR spec"         # OR operation
lla -f "NOT test"             # NOT operation
lla -f "test XOR spec"        # XOR operation

Plugin System

plugins-use.mp4

Installation

# From Git repository
lla install --git https://github.com/user/plugin

# From local directory
lla install --dir path/to/plugin

Management

You can use the following commands to manage plugins:

lla use                    # Interactive plugin manager
lla --enable-plugin name   # Enable plugin
lla --disable-plugin name  # Disable plugin
lla update                 # Update all plugins
# You also update a single plugin
lla update file_tagger

Plugin Actions:

Plugin actions are the functions which a given plugin can perform.

lla plugin --name file_tagger --action add-tag --args README.md "important"

Creating Shortcuts

Shortcuts allow you to save frequently used plugin commands with simpler aliases:

# Add a shortcut
lla shortcut add find file_finder search -d "Quick file search"
lla shortcut add hash file_hash calculate -d "Calculate file hashes"
lla shortcut add todos keyword_search find-todos -d "Find TODO comments"

# List all shortcuts
lla shortcut list

# Use shortcuts (remaining arguments are passed to the plugin)
lla find pattern           # Equivalent to: lla plugin --name file_finder --action search --args "pattern"
lla hash filename         # Equivalent to: lla plugin --name file_hash --action calculate --args "filename"
lla todos                # Equivalent to: lla plugin --name keyword_search --action find-todos

# Remove a shortcut
lla shortcut remove find

Configuration

The configuration file is located at ~/.config/lla/config.toml. You can modify it directly or use the lla config command.

Configuration File Format:

# Core Settings
default_sort = "name"          # Possible values: "name", "size", "date"
default_format = "default"     # Possible values: "default", "long", "tree", "grid"
enabled_plugins = ["git_status", "file_hash"]  # List of enabled plugins
plugins_dir = "/home/user/.config/lla/plugins" # Plugin directory location
default_depth = 3              # Default depth for recursive listing

# Performance Tuning
[formatters.tree]
max_lines = 20000             # Maximum entries in tree view
                             # Set to 0 for unlimited (may impact performance)

[listers.recursive]
max_entries = 20000          # Maximum entries in recursive listing
                             # Set to 0 for unlimited (may impact performance)

# Command Shortcuts
[shortcuts]
find = { plugin_name = "finder", action = "search", description = "Quick file search" }

Configuration Commands:

# Initialize config
lla init                  # Create default config file

# View current config
lla config               # Display current configuration

# Modify settings
lla config --set default_sort size
lla config --set default_format long
lla config --set plugins_dir /custom/path
lla config --set default_depth 5

# Manage shortcuts
lla shortcut add NAME PLUGIN ACTION [-d DESCRIPTION]  # Add shortcut
lla shortcut remove NAME                             # Remove shortcut
lla shortcut list                                    # List all shortcuts

CLI Configuration:

lla config --set default_sort size
lla config --set default_format long

Development

Plugin Development

Develop custom plugins using the Plugin trait from lla_plugin_interface. More details in the plugin development guide.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -m 'Add some new-feature')
  4. Push to the branch (git push origin feature/new-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.