cpdirmk
is a powerful command-line tool that generates a Markdown representation of directory structures, including the content of text files. It's perfect for documentation, project overviews, and sharing folder structures in a readable format.
- 📁 Generates a Markdown representation of directory structures
- 📄 Includes content of text files in the output
- 🌳 Supports customizable depth limitation for directory traversal
- 🚫 Allows ignoring specific files or directories
- 🔍 Intelligently identifies and handles various file types
- 🎨 Produces clean and formatted Markdown output
-
Clone this repository:
git clone https://github.com/your-username/cpdirmk.git
-
Navigate to the project directory:
cd cpdirmk
-
Run the installation script with root privileges:
sudo ./install.sh
The script will install
cpdirmk
and its man page, making it available system-wide.
Basic syntax:
cpdirmk [OPTIONS] DIRECTORY
-h, --help
: Display the help message and exit-v, --version
: Show the program version and exit-o, --output=FILE
: Specify the output file (default: output.md)-d, --depth=NUMBER
: Set the maximum depth for directory traversal-i, --ignore=PATTERN
: Ignore files/directories matching the specified pattern
-
Generate a Markdown representation of the current directory:
cpdirmk .
-
Create a structure of a specific directory with a custom output file:
cpdirmk -o project_structure.md /path/to/your/project
-
Limit the depth and ignore certain files/directories:
cpdirmk -d 3 -i '*.tmp' -i 'node_modules' -o limited_structure.md /path/to/project
cpdirmk
intelligently handles various file types:
- Text Files: Content is included in the Markdown output.
- Binary Files: Marked as binary without content display.
- Special Files: Identified and handled appropriately (e.g., executables, symlinks).
- Large Files: Size is displayed instead of content for files exceeding a certain threshold.
We welcome contributions to cpdirmk
! Here's how you can help:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with clear, descriptive messages.
- Push your changes to your fork.
- Submit a pull request with a clear description of your changes.
Please ensure your code adheres to the existing style and passes all tests.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Eric Coleta - ericbercol@gmail.com
- Thanks to all contributors who have helped shape
cpdirmk
. - Inspired by the need for easy-to-share directory structures in Markdown format.
For more detailed information, please refer to the man page by running man cpdirmk
after installation.