| Crates.io | lsql |
| lib.rs | lsql |
| version | 1.11.0 |
| created_at | 2025-03-10 14:01:38.893457+00 |
| updated_at | 2025-03-11 17:56:40.826842+00 |
| description | A command-line utility that queries files and directories using SQL-like syntax |
| homepage | https://github.com/faltawy/lsql |
| repository | https://github.com/faltawy/lsql |
| max_upload_size | |
| id | 1586721 |
| size | 274,032 |
LSQL is a command-line utility that queries files and directories using SQL-like syntax.
The easiest way to install LSQL is via Cargo, Rust's package manager:
cargo install lsql
For faster installation without compilation, you can use cargo-binstall:
# Install cargo-binstall if you don't have it
cargo install cargo-binstall
# Install LSQL
cargo binstall lsql
To build from source, you'll need a Rust environment. If you don't have it yet, install it from rustup.rs.
# Clone the repository
git clone https://github.com/faltawy/lsql.git
cd lsql
# Build and install
cargo install --path .
You can also download pre-built binaries from the GitHub Releases page.
List all files and directories in the current directory:
lsql "select * from .;"
List files by selecting the type field:
lsql "select type from .;"
List specific fields including type:
lsql "select name, type, size from .;"
List all PNG files:
lsql "select * from . where ext = \"png\";"
List all files larger than 10MB:
lsql "select * from . where size > \"10mb\";"
List all hidden files:
lsql "select * from . where is_hidden = true;"
Combined conditions:
lsql "select * from . where ext = \"jpg\" and size > \"1mb\";"
Start the interactive shell:
lsql shell
In shell mode, you can type queries directly without wrapping them in quotes:
lsql> select * from .;
lsql> select type from /tmp where size > "1mb";
-n, --no-color: Disable colored output-r, --recursive: Enable recursive search-l, --log-level <LEVEL>: Set the logging level [possible values: off, error, warn, info, debug, trace] (default: info)--help: Show help information--version: Show version informationYou can adjust the verbosity of the log output using the --log-level option:
# Show only errors
lsql --log-level error "select * from .;"
# Show detailed debug information
lsql --log-level debug "select type from .;"
# Maximum verbosity for troubleshooting
lsql --log-level trace "select * from . where ext = \"jpg\";"
SELECT - What to display
*: All itemsselect name, size, ext, type from .;FROM - Where to search
. for the current directoryWHERE - Conditions for filtering
name, path, size, ext, modified, created, is_hidden, type, permissions=, !=, <, <=, >, >=, like, containsb, kb, mb, gb, tband, orInterested in contributing to LSQL? Check out the following resources:
The documentation covers how to:
We welcome all contributions, from bug fixes to new features!
MIT
LSQL supports customizable themes to personalize the appearance of the output. The application comes with several built-in themes:
default: Standard theme with a clean, modern lookdark: Optimized for dark terminal backgrounds with bright colorslight: Optimized for light terminal backgroundsvibrant: High-contrast theme with bright colorsminimal: Simplified theme with minimal stylingSelect a theme using the --theme (or -t) option:
lsql --theme dark "select * from .;"
List all available themes:
lsql --list-themes
LSQL provides commands to manage themes:
# List all available themes
lsql theme list
# Set a theme
lsql theme set --name dark
# Create a new theme
lsql theme create --name mytheme --base dark --description "My custom theme"
For detailed information about creating and customizing themes, see the Theme Guide.