https://github.com/triyanox/lla Skip to content Navigation Menu Toggle navigation Sign in * Product + GitHub Copilot Write better code with AI + Security Find and fix vulnerabilities + Actions Automate any workflow + Codespaces Instant dev environments + Issues Plan and track work + Code Review Manage code changes + Discussions Collaborate outside of code + Code Search Find more, search less Explore + All features + Documentation + GitHub Skills + Blog * Solutions By company size + Enterprises + Small and medium teams + Startups By use case + DevSecOps + DevOps + CI/CD + View all use cases By industry + Healthcare + Financial services + Manufacturing + Government + View all industries View all solutions * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} triyanox / lla Public * Notifications You must be signed in to change notification settings * Fork 1 * Star 91 A modern alternative to ls crates.io/crates/lla License MIT license 91 stars 1 fork Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights triyanox/lla main BranchesTags [ ] Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 64 Commits lla lla lla_plugin_interface lla_plugin_interface plugins plugins .gitignore .gitignore LICENSE LICENSE README.md README.md build.sh build.sh generate-plugins.py generate-plugins.py lla.png lla.png plugins.md plugins.md View all files Repository files navigation * README * MIT license lla - A modern alternative to ls lla is a high-performance, extensible alternative to the traditional ls command, written in Rust. It offers enhanced functionality, customizable output, and a plugin system for extended capabilities. lla in action Features * Efficient file listing: Optimized for speed, even in large directories * Multiple view modes: + Default view + Long format (-l) + Tree view (-t) + Recursive listing (-R) * Advanced sorting: + Alphabetical (default) + File size (-s size) + Modification date (-s date) * Flexible filtering: Filter by filename or extension (-f, --filter) * Customizable recursion: Set maximum depth for subdirectory traversal * Extensible plugin system: Develop and integrate custom functionality * Color-coded output: Easily distinguish file types and permissions * Git integration: Show git status for files (with plugin) * File categorization: Categorize files by type (with plugin) * Keyword search: Search file contents for specified keywords (with plugin) * File hash display: Show file hashes (with plugin) * Code complexity analysis: Analyze code complexity (with plugin) * File size visualization: Visualize file sizes (with plugin) * Duplicate file detection: Identify duplicate files (with plugin) * Directory metadata: Display detailed directory information (with plugin) * File metadata: Show extended file metadata (with plugin) * Last git commit info: Display information about the last git commit (with plugin) and more! Installation From crates.io cargo install lla For NetBSD users pkgin install lla (we see you, netbsd. we appreciate you.) Usage First you need to initialize the configuration file: lla init lla config # to view the config file Then you can start using lla: lla [OPTIONS] [DIRECTORY] Core Options * -l, --long: Use long listing format * -R, --recursive: List subdirectories recursively * -t, --tree: Display files in a tree structure * -s, --sort : Sort by "name", "size", or "date" * -f, --filter : Filter files by name or extension * -d, --depth : Set maximum recursion depth Plugin Management * --enable-plugin : Enable a specific plugin * --disable-plugin : Disable a specific plugin * --plugins-dir : Specify custom plugins directory * --plugin-arg : Pass arguments to enabled plugins Plugin Actions lla supports plugin-specific actions, allowing you to interact with plugins directly: lla plugin --name --action [--args ...] * --name : Specify the name of the plugin * --action : Specify the action to perform * --args ...: Provide arguments for the action (optional) Utility Commands * lla install: Install plugins + --git : Install from a Git repository + --dir : Install from a local directory * lla list-plugins: Display all available plugins * lla init: Initialize configuration file * lla config: View configuration file Configuration lla uses a TOML configuration file located at ~/.config/lla/ config.toml. Initialize with default settings: lla init lla config # to view the config file Example configuration: default_sort = "name" default_format = "default" enabled_plugins = ["git_status", "file_hash"] plugins_dir = "/home/user/.config/lla/plugins" default_depth = 3 Install Plugins You can install plugins from a local directory or from a Git repository. You can find official plugins here. From Git lla install --git From Local Directory lla install --dir Plugin Development Develop custom plugins to extend lla's functionality. Plugins are dynamic libraries that implement the Plugin trait from the lla_plugin_interface crate. Plugin Structure 1. Create a new Rust library: cargo new --lib my_lla_plugin 2. Add dependencies to Cargo.toml: [dependencies] lla_plugin_interface = "*" [lib] crate-type = ["cdylib"] 3. Implement the Plugin trait: use lla_plugin_interface::{Plugin, DecoratedEntry, EntryDecorator, CliArg}; pub struct MyPlugin; impl Plugin for MyPlugin { fn name(&self) -> &'static str { "my_plugin" } fn version(&self) -> &'static str { env!("CARGO_PKG_VERSION") } fn description(&self) -> &'static str { env!("CARGO_PKG_DESCRIPTION") } fn cli_args(&self) -> Vec { vec![ CliArg { name: "my-option".to_string(), short: Some('m'), long: Some("my-option".to_string()), help: "Description of my option".to_string(), takes_value: true, } ] } fn handle_cli_args(&self, args: &[String]) { // Handle CLI arguments passed to the plugin } fn perform_action(&self, action: &str, args: &[String]) -> Result<(), String> { match action { "my-action" => { // Perform custom action Ok(()) } _ => Err(format!("Unknown action: {}", action)), } } } impl EntryDecorator for MyPlugin { fn decorate(&self, entry: &mut DecoratedEntry) { // Add custom fields or modify entry } fn format_field(&self, entry: &DecoratedEntry, format: &str) -> Option { // Return formatted string for display } fn supported_formats(&self) -> Vec<&'static str> { vec!["default", "long", "tree"] } } lla_plugin_interface::declare_plugin!(MyPlugin); 4. Build your plugin: cargo build --release 5. Install the plugin: lla install --dir /path/to/my_lla_plugin or lla install --git Plugin Interface The lla_plugin_interface crate provides the following key components: * Plugin trait: Core interface for plugin functionality * EntryDecorator trait: Methods for decorating and formatting file entries * DecoratedEntry struct: Represents a file entry with metadata and custom fields * CliArg struct: Defines command-line arguments for the plugin Examples # Long format, sorted by size, showing only .rs files lla -ls size -f .rs # Enable git status plugin lla --enable-plugin git_status # Enable multiple plugins lla --enable-plugin git_status categorizer # Disable git status plugin lla --disable-plugin git_status # Disable multiple plugins lla --disable-plugin git_status categorizer # Set keywords for the keyword search plugin using plugin action lla plugin --name keyword_search --action set-keywords --args "TODO" "FIXME" "BUG" # Show current keywords for the keyword search plugin lla plugin --name keyword_search --action show-keywords # Use the keyword search plugin with the set keywords lla --enable-plugin keyword_search Contributing Contributions are welcome! Please feel free to submit pull requests, report bugs, and suggest features. 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. About A modern alternative to ls crates.io/crates/lla Topics rust lightweight cargo crates-io ls replacement Resources Readme License MIT license Activity Stars 91 stars Watchers 3 watching Forks 1 fork Report repository Releases 12 v0.2.6 Latest Nov 24, 2024 + 11 releases Contributors 2 * @triyanox triyanox Mohamed Achaq * @0323pin 0323pin pin Languages * Rust 96.0% * Python 2.2% * Shell 1.8% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.