| Crates.io | pacont |
| lib.rs | pacont |
| version | 0.5.3 |
| created_at | 2025-11-04 08:28:05.798737+00 |
| updated_at | 2025-11-04 08:28:05.798737+00 |
| description | CLI tool to gather code context for LLMs |
| homepage | |
| repository | https://github.com/Tmpecho/pacont |
| max_upload_size | |
| id | 1915948 |
| size | 59,579 |
A tool to easily gather code context to give to an AI like ChatGPT or Claude.
Pacont (short for Path and Content) is a simple and efficient CLI tool designed to recursively print file paths and their contents within specified directories or files. This tool is particularly useful for gathering code context to provide to AI models like ChatGPT or Claude, making it easier to analyze and understand large codebases.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone https://github.com/Tmpecho/pacont.git
cd pacont
cargo build --release
sudo cp target/release/pacont /usr/local/bin/pacont
brew tap Tmpecho/pacont
brew install pacont
For the --copy flag to work on Linux, you need one of the following clipboard utilities installed:
sudo apt-get install xclipsudo apt-get install xselwl-clipboard packageOn most Linux distributions, you can install xclip with:
# Debian/Ubuntu
sudo apt-get install xclip
# Fedora
sudo dnf install xclip
# Arch Linux
sudo pacman -S xclip
Without these utilities, the clipboard functionality will fall back to a native implementation that may not persist after the program exits on some systems.
pacont [OPTIONS] <PATH>...
-m, --max-depth <MAX_DEPTH>: Maximum recursion depth for directories (0 means no recursion) [default: usize::MAX]-i, --include-errors: Include error messages in the output-o, --output-information: Get number of characters, words and non-empty lines of output-c, --copy: Copy the output to clipboard-h, --help: Print help information-V, --version: Print version informationGiven a directory structure:
src/
├── div
│ └── test.kt
└── main.kt
README.md
misc/
├── notes.txt
Running pacont src README.md misc/ will output:
**div/test.kt**
//comment
**main.kt**
println("hello")
--------------------------------------------------------------------------------
**README.md**
# Pacont
A very simple CLI tool to recursively print file paths and contents in a directory.
--------------------------------------------------------------------------------
**notes.txt**
Some notes here...
Running pacont -o src README.md misc/ will output:
Total Characters: 1234
Total Words: 234
Total Non-Empty Lines: 56
Contributions are welcome! Feel free to open an issue or submit a pull request if you have any improvements or new features to add.