Generate a comprehensive Markdown document for any project directory via CLI
Project description
proj2md
proj2md is a command-line tool that generates a comprehensive Markdown document
for any project directory. It traverses files, extracts structure and contents,
and outputs a self-descriptive .md file ideal for LLM ingestion or static documentation.
Features
- Recursive directory traversal with extension filtering
- Optional ASCII tree view of the project structure
- Automatic table of contents with anchors
- YAML front-matter with project metadata (name, version, author, date)
- Modes:
light: only tree + existing READMEfull: complete extraction of all files
- List of dependencies from
pyproject.tomlorpoetry - Customizable snippet length (
--max-snippet-lines) - Exclusion patterns for files/folders (
--exclude) - Easy installation via
pipand entry-pointproj2md
Installation
Requires Python 3.13 or higher.
Install from PyPI:
pip install proj2md
Or install locally from source:
git clone https://github.com/yourusername/proj2md.git
cd proj2md
pip install .
Usage
Basic usage (note that the actual file will be prefixed with generated_):
Note: regardless of the name provided via --output-file, the output
file will be prefixed with generated_ to avoid self-inclusion.
Basic usage:
proj2md --input-dir ./my_project --output-file ./project.md
Available options:
--input-dir, -i PATH Root directory (default: .)
--output-file, -o FILE Output Markdown file (default: project.md)
--with-tree / --no-tree Include project tree (default: with-tree)
--with-deps / --no-deps Include dependencies list (default: with-deps)
--extensions, -e EXT1,EXT2 Comma-separated extensions (default: .py,.md,.yaml,.json)
--mode [light|full] Extraction mode (default: full)
--max-snippet-lines N Limit lines per file snippet
--exclude, -x PAT1,PAT2 Comma-separated ignore patterns
Examples
Full extraction with tree and dependencies:
proj2md -i ./src -o docs/project_full.md --with-tree --with-deps --mode full
Light mode (only tree + README):
proj2md -i ./src -o docs/project_light.md --no-deps --no-tree --mode light
Development
A Taskfile.yaml is provided to simplify common development workflows.
Install the Task runner (task command), then run:
# Setup development environment (venv, dependencies, pre-commit)
task setup-dev
# Run the test suite
task run-tests
# Run code formatting and linting
task linter
# Clean build artifacts and cache
task clean
To list all available tasks:
task --list
Contributing
See CONTRIBUTING.md for guidelines on contributing.
Code of Conduct
This project adheres to the Contributor Covenant.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 proj2md-0.1.0.tar.gz.
File metadata
- Download URL: proj2md-0.1.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47cc869cc249c60f5715200217bb487152c1997749d3e15dd07a26efa332b10d
|
|
| MD5 |
bf150a56d48cf0e5be66d95ee77120f6
|
|
| BLAKE2b-256 |
d83999ce382de633a8477e5fb1d8d5d2c41dcee8490e04f1dc30b53c159a032c
|
Provenance
The following attestation bundles were made for proj2md-0.1.0.tar.gz:
Publisher:
release.yml on thibaud-perrin/proj2md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proj2md-0.1.0.tar.gz -
Subject digest:
47cc869cc249c60f5715200217bb487152c1997749d3e15dd07a26efa332b10d - Sigstore transparency entry: 202177523
- Sigstore integration time:
-
Permalink:
thibaud-perrin/proj2md@a49575ec5aaff7abcdba3354d7993009f24dff37 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/thibaud-perrin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a49575ec5aaff7abcdba3354d7993009f24dff37 -
Trigger Event:
release
-
Statement type:
File details
Details for the file proj2md-0.1.0-py3-none-any.whl.
File metadata
- Download URL: proj2md-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c77dbe5125d3deef9fe2b3197a1aa1bff32a47e520918af8732d46d0d59a2f0
|
|
| MD5 |
819304bac900c9d6d4b36610f67b0eaf
|
|
| BLAKE2b-256 |
8f7d0b4ed9e598f87b8877a9a89949b34b5d409d143b9495b4fb338a494bebca
|
Provenance
The following attestation bundles were made for proj2md-0.1.0-py3-none-any.whl:
Publisher:
release.yml on thibaud-perrin/proj2md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proj2md-0.1.0-py3-none-any.whl -
Subject digest:
9c77dbe5125d3deef9fe2b3197a1aa1bff32a47e520918af8732d46d0d59a2f0 - Sigstore transparency entry: 202177526
- Sigstore integration time:
-
Permalink:
thibaud-perrin/proj2md@a49575ec5aaff7abcdba3354d7993009f24dff37 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/thibaud-perrin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a49575ec5aaff7abcdba3354d7993009f24dff37 -
Trigger Event:
release
-
Statement type: