Copy file contents under a directory to clipboard with tree and optional git log.
Project description
pylistall
pylistall is a cross-platform command-line tool that collects file contents under a directory and copies them to the system clipboard in a structured format.
It also prints the absolute path and a tree-style directory structure. If the directory contains a .git repository, it can optionally include the Git commit log.
This tool is designed for efficiently sharing project context with AI tools, debugging, documentation, or code review.
Features
-
Copy file contents directly to clipboard
-
Tree-style directory structure output (by default, only files in the current directory are included)
-
Display absolute path
-
Recursive traversal of subdirectories (optional, disabled by default)
-
Include or exclude files using glob patterns (optional, includes all non-binary files by default)
-
Include binary files (optional, disabled by default)
-
Include Git log (optional, disabled by default)
-
Cross-platform support:
- macOS (
pbcopy) - Windows (
clip) - Linux (
xcliporpyperclipfallback)
- macOS (
Installation
From the project root (where pyproject.toml is located):
python -m pip install .
Verify installation:
pylistall --help
Uninstall:
python -m pip uninstall pylistall
Usage
pylistall [path] [options]
If path is not provided, the current directory (.) is used.
Output Format
Example:
ROOT: /Users/example/project
TREE:
.
├── main.py
└── utils.py
GIT LOG:
a1b2c3d (HEAD -> main) Initial commit
`main.py`:
```
print("Hello")
```
`utils.py`:
```
def func():
pass
```
Options
Recursive traversal
-r, --recursive
Recursively include files in subdirectories. Optional, disabled by default. When enabled, both the tree structure and copied file contents will include files from the current directory, subdirectories, and all nested subdirectories.
Example:
pylistall -r
Include binary files
-b, --binary
Include binary files. Optional, disabled by default. When enabled, binary file contents will be included like regular files. Regardless of whether this option is enabled, binary file names will always appear in the tree structure.
Example:
pylistall -b
Include Git log
-g, --git-log [N]
Optional, disabled by default. Behavior depends on usage:
| Command | Result |
|---|---|
no -g |
do not include Git log |
-g |
include all Git log entries |
-g N |
include the last N Git log entries |
Examples:
pylistall -g
pylistall -g 5
When enabled, if the ROOT directory does not contain a .git folder, a message will be shown.
Include only specific files
-i, --include PATTERN
Include only files matching glob patterns. Optional, disabled by default. When enabled, both the tree structure and copied file contents will include only the selected files. Multiple patterns can be separated by commas.
Examples:
pylistall -i "*.py"
pylistall -i "*.py,README.md"
Omit specific files
-o, --omit PATTERN
Exclude files matching glob patterns. Optional, disabled by default. When enabled, both the tree structure and copied file contents will exclude the selected files. Multiple patterns can be separated by commas.
Examples:
pylistall -o "*.log"
pylistall -o "*.log,*.tmp"
Limit file read size
--max-bytes N
Limit the maximum number of bytes read per file. Optional, disabled by default. When enabled, reading of each file will be limited to at most N bytes.
Example:
pylistall --max-bytes 10000
Examples
Basic usage:
pylistall
Recursive traversal with Git log:
pylistall -r -g 3
Include binary files:
pylistall -b
Include only Python files:
pylistall -i "*.py"
Exclude test files:
pylistall -o "test_*"
Clipboard Support
Platform-specific clipboard backends:
| Platform | Backend |
|---|---|
| macOS | pbcopy |
| Windows | clip |
| Linux | xclip / pyperclip |
No additional configuration is required on macOS or Windows.
Requirements
Python 3.9 or higher
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pylistall-0.2.0.tar.gz.
File metadata
- Download URL: pylistall-0.2.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60634e7ec79e46c8b675ab6b0a9a494738d31b6199e8e205c86b95f78ba869d1
|
|
| MD5 |
ce0b0f656a69b03afed647ada664d310
|
|
| BLAKE2b-256 |
fc5078dbab17ac8a2e38453b53fb2567d14bf9928bb8c5414a8d8be9f503d9f7
|
File details
Details for the file pylistall-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pylistall-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
846828d5e48e97bfe30489a2760c53e5c997ca090ef4a7ad51a33316c0db3043
|
|
| MD5 |
629a04b5ea2840e4870ab4809a8625d7
|
|
| BLAKE2b-256 |
77cbea7d8d6586efebac698ef9331577ee2f8369838f9228b27ed987052766cb
|