nls introduces Nushell-style tabular directory listings for terminal users
nls is a Go-based ls alternative that provides structured, tabular file metadata and JSON output for improved terminal workflows.
Summary
The nls utility has been released as a modern command-line alternative to the traditional ls command. Written in Go, it focuses on presenting directory contents through structured tables inspired by the Nushell shell, making file inspection more readable in interactive sessions.
The tool is designed to handle both human-readable terminal displays and machine-readable pipelines. It automatically detects when output is being redirected or piped, switching from visual tables to simpler formats or structured JSON to facilitate easier data processing in scripts and automation.
Technical features and output handling
- Output Modes: Automatically distinguishes between interactive terminal sessions and non-interactive pipes/redirects to ensure appropriate formatting.
- Data Formats: Supports standard tabular views for users and JSON output for programmatic file information processing.
- Metadata Integration: Includes Git status indicators for files and directories, alongside configurable columns for permissions, ownership, inodes, and timestamps.
- Performance Management: Implements directory size estimation with configurable calculation depth and time budgets to prevent long delays during large tree traversals.
- Configuration: Utilizes TOML files for persistent settings, while allowing command-line arguments to override specific parameters.
Why it matters
As a cross-platform tool supporting Linux, macOS, and Windows, nls provides a consistent way for developers to view structured file metadata. Its ability to output JSON makes it a viable replacement for complex shell scripts that require parsing directory contents.
Original reference: www.linuxlinks.com →