Skip to main content

Overview

Lists directory contents in a token-optimized format with automatic noise filtering and file statistics. Reduces output by 60-70% compared to raw ls -la.

Syntax

rtk ls [OPTIONS] [PATH...]

Arguments

PATH
string[]
Directories to list. Defaults to current directory if not specified.

Options

-a, --all
flag
Show hidden directories like .git and node_modules (normally filtered)
-l
flag
Detailed listing (always enabled by RTK)
-R
flag
Recursive listing
-h
flag
Human-readable sizes (always enabled by RTK)

Automatic Filtering

RTK automatically excludes common noise directories unless -a is specified:
  • node_modules, .git, target
  • __pycache__, .next, dist, build
  • .cache, .turbo, .vercel
  • .pytest_cache, .mypy_cache, .tox
  • .venv, venv, coverage

Output Format

src/
Cargo.toml  1.2K
README.md  5.5K

📊 2 files, 1 dirs (2 .rs, 1 .toml)
Features:
  • Directories shown with / suffix
  • Human-readable file sizes (K, M)
  • Summary line with file count by extension
  • No permissions, timestamps, or ownership clutter

Token Savings

65% reduction - removes metadata while preserving essential information
rtk ls
# Output:
# src/
# tests/
# Cargo.toml  1.2K
# README.md  5.5K
# 📊 2 files, 2 dirs

Exit Codes

  • 0 - Success
  • 1 - Directory not found or permission denied
  • rtk tree - Recursive tree view
  • rtk find - Search for files
  • rtk read - View file contents