Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
cdf701d
Fix linting issues
dhruvkb Jan 21, 2025
92ba7cb
Make the first mention of `pls` a link
dhruvkb Jan 22, 2025
3bfb153
Add defaults for props and remove unwanted space around the text
dhruvkb Jan 22, 2025
758dac2
fixup! Fix linting issues
dhruvkb Jan 22, 2025
f14ad32
Move attributes to separate lines for linting
dhruvkb Jan 22, 2025
f9ba086
Expand Prettier config
dhruvkb Jan 22, 2025
3947906
Update favicon to the new `pls` logo
dhruvkb Jan 23, 2025
c538752
Use `--host` argument and remove redundant "start" script
dhruvkb Jan 23, 2025
5cb1bd8
Use TypeScript for Astro config
dhruvkb Jan 23, 2025
0c8df2e
Disable SmartyPants in docs
dhruvkb Feb 3, 2025
8154e3b
Update Rust packages
dhruvkb Feb 3, 2025
a18d68a
Replace Black with the Ruff formatter
dhruvkb Feb 3, 2025
0e24886
Use a newer version of pnpm
dhruvkb Feb 3, 2025
de726ab
Disable fail fast for matrix jobs
dhruvkb Feb 3, 2025
2cb31e2
Set `TERM` and `COLORTERM` when running unit tests
dhruvkb Feb 3, 2025
3b19f64
Use `.nvmrc` file for setting the Node.js version
dhruvkb Feb 3, 2025
50f7ee1
Set integrity keys for Corepack
dhruvkb Feb 3, 2025
7ab7f2f
Isolate RGB color tests from CI environment variables
dhruvkb Feb 3, 2025
3c6444f
Use `query_osc` and prevent leaving terminal in raw mode
dhruvkb Apr 13, 2025
4da1752
Render ANSI sequences without transforming to HTML
dhruvkb Apr 15, 2025
1458c37
Convert to Node.js monorepo
dhruvkb Apr 15, 2025
572a9b5
Fix formatting issues
dhruvkb Apr 15, 2025
2a80b32
git column
kenbanks-peng Jul 11, 2025
ac2b1c9
for directories
kenbanks-peng Jul 11, 2025
216c3df
Fix git status detection for directories and add proper color coding
kenbanks-peng Jul 11, 2025
f4c3fe2
Add test file
kenbanks-peng Jul 11, 2025
291cd8c
test
kenbanks-peng Jul 11, 2025
cb7ab95
test
kenbanks-peng Jul 11, 2025
6848385
test
kenbanks-peng Jul 11, 2025
c74e6fb
dirty directories *
kenbanks-peng Jul 11, 2025
96f55b3
Add line from main
kenbanks-peng Jul 11, 2025
29887de
ignored + conflicts
kenbanks-peng Jul 11, 2025
35f2fe5
!! for ignored directories
kenbanks-peng Jul 11, 2025
90e27c4
bug fixing
kenbanks-peng Jul 11, 2025
834ec15
bug fix
kenbanks-peng Jul 11, 2025
f738895
bugs
kenbanks-peng Jul 11, 2025
50df307
commit
kenbanks-peng Sep 3, 2025
4f331fe
commit
kenbanks-peng Sep 4, 2025
f1028ce
using git status
kenbanks-peng Sep 5, 2025
42cdd07
unpushed arrow
kenbanks-peng Sep 5, 2025
967f24b
yellow up arrow for directory
kenbanks-peng Sep 5, 2025
0a186ec
.
kenbanks-peng Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,19 @@ runs:
key:
${{ runner.os }}-${{ inputs.rust_cache_key }}-${{
hashFiles('**/Cargo.lock') }}

- name: Enable Corepack
shell: bash
run: corepack enable pnpm

- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version-file: .nvmrc
env:
COREPACK_INTEGRITY_KEYS: '{"npm":[{"expires":"2025-01-29T00:00:00.000Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="},{"expires":null,"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEY6Ya7W++7aUPzvMTrezH6Ycx3c+HOKYCcNGybJZSCJq/fd7Qa8uuAKtdIkUQtQiEKERhAmE5lMMJhP8OkDOa2g=="}]}'

- name: Install Node.js dependencies
shell: bash
run: pnpm install
19 changes: 5 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
unit:
name: Run unit test
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
Expand All @@ -64,6 +65,7 @@ jobs:
- lint
- unit
strategy:
fail-fast: false
matrix:
build:
- linux
Expand Down Expand Up @@ -134,22 +136,11 @@ jobs:
python-version-file: examples/pyproject.toml
cache-dependency-path: examples/pdm.lock

- name: Enable Corepack
run: corepack enable pnpm

- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version-file: docs/package.json
cache-dependency-path: docs/pnpm-lock.yaml

- name: Install all dependencies
run: just install

- name: Generate examples
working-directory: examples/
run: just all
run: |
just install
just all

- name: Build docs
working-directory: docs/
Expand Down
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
.vscode
.idea

# Node.js modules
node_modules

# Build artifacts
target
bin

# Profiling artifacts
flamegraph.svg
Expand All @@ -12,3 +16,12 @@ report.html

# pre-commit executable
pre-commit.pyz
ignored_file
test_mixed/ignored.txt
test_ignored/

# Test scenarios
test_scenarios/fully_ignored/
test_scenarios/partially_ignored/ignored.txt
test_scenarios/nested_ignored/sub1/
*.log
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
28 changes: 18 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,33 @@ repos:
# Python
# ======

# Runs before Black because fixed code might need to be formatted.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.1
hooks:
# Replaces flake8, isort and pyupgrade
- id: ruff
- id: ruff # replaces Flake8, isort, pydocstyle, pyupgrade
args:
- --fix
- --exit-non-zero-on-fix

- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
- id: ruff-format # replaces Black

# JavaScript
# ==========

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
- repo: local
hooks:
- id: prettier
name: prettier
"types": [text]
language: system
pass_filenames: true
# Set log-level to error to prevent prettier printing every single file it checks
# when running pre-commit with --all-files
entry: pnpm exec prettier --write --ignore-unknown --log-level error

- id: eslint
name: eslint
files: (frontend|automations|packages/js).*?\.(js|ts|mjs|vue|json5?)$
"types": [file] # ESLint only accepts [javascript] by default.
language: system
pass_filenames: false
entry: pnpm exec eslint --max-warnings=0 --no-warn-ignored --fix
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# pnpm lockfile
# Autogenerated
.astro

# Lockfiles
pnpm-lock.yaml
63 changes: 63 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

`pls` is a prettier and powerful `ls(1)` replacement written in Rust. It's designed to be a modern, fast, and feature-rich directory listing tool with extensive customization options.

## Architecture

The codebase is organized into several key modules:

- **Core**: `src/main.rs` contains the application entry point with a global `PLS` instance
- **Models**: `src/models/` contains core data structures including `Pls` (main application state), `Node` (file system entries), and `Window` (terminal info)
- **Configuration**: `src/config/` handles YAML configuration files and command-line argument parsing
- **Arguments**: `src/args/` manages command-line input processing and grouping
- **Output**: `src/output/` handles different display formats (grid, table, etc.)
- **Formatting**: `src/fmt/` provides text rendering and markup processing
- **Graphics**: `src/gfx/` handles terminal graphics protocol support (Kitty, SVG)
- **Enums**: `src/enums/` contains various enumeration types for appearance, sorting, etc.
- **Traits**: `src/traits/` defines common behaviors across different components
- **Utils**: `src/utils/` provides utility functions for paths, URLs, and vectors

## Development Commands

### Rust (Core Application)
- **Build**: `cargo build`
- **Run**: `cargo run -- [args]` or `just run [args]`
- **Test**: `cargo test` or `just test`
- **Debug**: `RUST_LOG=debug cargo run -- [args]` or `just debug [args]`
- **Release**: `cargo build --release` or `just release`

### Frontend/Documentation (JavaScript/TypeScript)
- **Lint**: `pnpm lint` (ESLint)
- **Format**: `pnpm format` (Prettier)
- **Check formatting**: `pnpm format:check`
- **All checks**: `pnpm checks` (lint + format check)
- **Fix linting**: `pnpm lint:fix`

### Project Management
- **Install dependencies**: `just install` (installs for all sub-projects)
- **Pre-commit setup**: `just pre-commit` (installs Git hooks)
- **Lint all**: `just lint` (runs pre-commit on all files)

## Key Configuration

The application uses:
- **Configuration files**: `.pls.yml` files for customization (handled by `ConfMan`)
- **Command-line args**: Parsed via `clap` crate
- **Environment**: `RUST_LOG` for debug logging
- **Package manager**: `pnpm` for JavaScript dependencies

## Multi-Language Setup

This is a polyglot project with:
- **Rust**: Main application (`src/`, `Cargo.toml`)
- **JavaScript/TypeScript**: Documentation site (`docs/`, Astro-based)
- **Python**: Examples and utilities (`examples/`, PDM-managed)
- **Just**: Task runner (`justfile` for automation)

## Terminal Graphics

The application detects and supports Kitty's terminal graphics protocol for enhanced visual output. This is handled in `src/gfx/` with runtime detection.
Loading