Skip to main content

What is sls?

sls (Swift List) is a modern CLI tool that serves as a drop-in replacement for the traditional ls command. Built with Swift, it provides enhanced functionality for listing directory contents with improved formatting, icons, colors, and flexible sorting options.

Command Syntax

sls [paths...] [options]

Components

  • paths - Optional. One or more paths to list. Defaults to current directory if omitted.
  • options - Flags and options that control output format, filtering, and sorting.

How sls Differs from ls

While maintaining compatibility with common ls patterns, sls offers:
  • Modern output formatting - Clean, readable display with optional icons and colors
  • Simplified flags - Intuitive short and long forms for all options
  • Type safety - Built with Swift for robust error handling
  • Flexible sorting - Sort by name (default), time, or size
  • Depth-controlled recursion - Limit how deep recursive listings go
  • Human-readable sizes - Easy-to-read file size formatting

Quick Examples

# List current directory
sls

# List with icons and colors
sls --icons --color

# Long format with human-readable sizes
sls -l --human-readable

# Recursive listing with depth limit
sls -r -L 2

Learn More

Explore the complete command reference:

Basic Usage

Core usage patterns and common workflows

Options Reference

Complete list of all flags and options

Examples

Real-world examples and use cases

Getting Help

Display built-in help at any time:
sls --help
Check the installed version:
sls --version

Build docs developers (and LLMs) love