Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 GitHub - AndreyHa/list-files-cli: Cli tool for copying dir content into clipboard
Nothing Special   »   [go: up one dir, main page]

Skip to content

AndreyHa/list-files-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lf - List Files CLI

lf – lightning-fast project snapshotter (code + docs ⇢ clipboard / file)

TL;DR

# everything except hidden + Node artefacts
lf . @.git @node_modules        # → clipboard

# whole project → file
lf . -o gist.txt

# only src/, exclude utils/
lf src @src/utils/**/*.ts

Installation

# Full build with token counting (default)
cargo build --release

# Slim build (no token counting, smaller binary)
cargo build --release --no-default-features
  • On Windows, the default binary is ~5.0 MB
  • With --no-default-features, it shrinks to ~1.07 MB

The executable will be in target/release/lf.

Linux/WSL Clipboard Requirements

On Linux and WSL, clipboard functionality requires additional system dependencies:

For X11:

sudo apt-get install xclip
# or
sudo apt-get install xsel

For Wayland:

sudo apt-get install wl-clipboard

For WSL specifically:

  • WSL2 with WSLg (Windows 11) has built-in clipboard support
  • Older WSL versions may need xclip or xsel with X server configured

If clipboard dependencies are not installed, lf will print the output to stdout with an informative error message.

Concepts

  • Include / Exclude – glob, prefix @ to drop.
  • Shell Escaping – On Unix systems, quote exclusion patterns: lf . "@.git" "@node_modules"
  • Hidden rule – any path with /. ignored unless your pattern also starts with . or contains /..
  • Directory shorthand – bare dir name ⇒ <dir>/**.
  • .gitignore aware – by default, entries ignored by .gitignore, global gitignore, and .git/info/exclude are skipped. Use --no-gitignore to disable.

Cheat-sheet

Intention Command
Add single hidden file lf . .env
Add hidden dir lf . .obsidian
Everything, even hidden lf "**/*"
Only Rust tests lf **/*_test.rs

Examples

Basic Usage

# Get all .rs files in the project
lf *.rs

# Get specific files
lf src/main.rs Cargo.toml README.md

# Get all files in src directory
lf src/

Exclusion Examples

# All Rust files except tests
lf **/*.rs @**/*test*

# Everything except hidden directories and node_modules
lf . @.git @node_modules @.vscode

**Note:** On Unix shells (bash, zsh), quote exclusion patterns to prevent shell interpretation:
```bash
lf . "@.git" "@node_modules" "@.vscode"

### Hidden Files

Hidden files (starting with `.`) are excluded by default unless explicitly
specified:

```bash
# This will NOT include .env, .gitignore, etc.
lf *

# This WILL include .env specifically
lf src/ .env .gitignore

# This will include ALL files including hidden ones
lf "**/*"

Output Options

# Write to file instead of clipboard
lf *.rs -o output.txt

# Disable clipboard (write to stdout)
lf *.rs --no-clipboard

# Pipe to other commands
lf *.rs --no-clipboard | grep "TODO"

Java import masking

.gitignore handling

By default lf honors .gitignore, global gitignore, and Git exclude files using the same engine as ripgrep.

Examples:

# Respect .gitignore (default)
lf . --no-clipboard

# Ignore .gitignore rules (include everything that matches patterns)
lf . --no-gitignore --no-clipboard

If you want to anonymize Java imports (replace import something with import ...) use:

# Mask imports in Java files
lf . --mask-java-imports

Appendix

Binary Files

Binary files are detected by extension and show metadata instead of content:

target/release/lf.exe
[Binary file: EXE - Size: 2.3 MB]

Supported binary types: executables, images, videos, audio, archives, documents, and more.

Hidden Path Semantics

"Hidden" means any path component beginning with dot – aligns with POSIX and Git-ignore semantics.

Tests

A basic test was added to ensure Java import masking behavior. See tests/hidden.rs.

About

Cli tool for copying dir content into clipboard

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0