AIに読み込ませやすいように、プロジェクトの構成とファイル内容をMarkdownに出力するCLIツール
Project description
Generate Project Summary
generate-project-summary is a CLI tool that scans a project directory and exports its structure and file contents into a single Markdown-style text file. It is useful when you want to share a codebase with AI tools, review a repository quickly, or keep a lightweight snapshot of a project's contents.
Features
- Generates a directory tree for the target project.
- Includes file contents in the output.
- Marks binary files as
(binary file). - Respects
.gitignoreand.summaryignore. - Supports additional ignore patterns with CLI options.
- Supports file type filtering such as
.pyand.md. - Attempts
utf-8,utf-8-sig, andshift_jiswhen reading text files. - Skips symlinks and junctions to avoid traversing outside the project.
- Omits very large text files from the contents section.
Installation
Install from PyPI:
pip install generate-project-summary
Quick Start
Run interactively:
generate-project-summary
or:
gen-pro
When prompted, enter the target project directory. Press Enter to use the current directory.
Output
By default, the tool writes a file named <project_name>_project_summary.txt in the current working directory.
Example structure:
# your_project
## Directory Structure
- your_project/
- generate_project_summary/
- main.py
- summarizer.py
- README.md
- pyproject.toml
## File Contents
### generate_project_summary/main.py
```python
def main():
...
```
Command Options
| Option | Description |
|---|---|
-d, --directory [PATH] |
Run non-interactively. -d alone uses the current directory. -d path uses the specified directory. |
-o, --output FILE |
Set the output file name. |
-i, --ignore PATTERN |
Add ignore patterns. Can be used multiple times. |
-t, --type EXT |
Include only specific file extensions. Can be used multiple times. |
-n, --name-type-only |
Output only directory/file names and file kind without embedding file contents. |
Examples
Use the current directory without prompts:
gen-pro -d
Target a specific directory:
gen-pro -d src
Save to a custom file:
gen-pro -o summary.txt
Ignore temporary files:
gen-pro -i '*.log' -i 'temp/'
Include only Python and Markdown files:
gen-pro -t .py -t .md
Combine multiple options:
gen-pro -d src -i '*.log' -t .py -t .md -o summary.txt
Output structure and file kinds only:
gen-pro -d src -n -o summary.txt
Ignore Files
You can exclude files and folders by creating ignore files in the project root.
.gitignore: patterns already used by Git.summaryignore: project-summary specific exclusions
Example:
*_project_summary.txt
__pycache__/
*.pyc
.venv/
Notes
- On Windows shells that treat backslashes specially, quote absolute paths when needed.
- Binary files are listed in the tree but their contents are not embedded.
- Large text files are listed and marked as omitted.
Development
Run tests with your project environment:
pytest -q
License
MIT
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 generate_project_summary-0.1.2.tar.gz.
File metadata
- Download URL: generate_project_summary-0.1.2.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7894e3e201c76e721ffcf4291d51aa361c3fc67a68bfe3499258a29aac71ed7a
|
|
| MD5 |
7e80325785b6259b05566f84fd2361f3
|
|
| BLAKE2b-256 |
9ee31b420342105cb489f66452b7ee839ef53e70260eb2a5d8bc6d4b2c48517a
|
File details
Details for the file generate_project_summary-0.1.2-py3-none-any.whl.
File metadata
- Download URL: generate_project_summary-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47fa2a0521811cb056b024c27216e7bfc8f482b0ad98c1834ec401357799ad9c
|
|
| MD5 |
0941665837150441bdc977c04987cc9a
|
|
| BLAKE2b-256 |
be73d8ff15046ba661e28dc7d0c8d4ab93d8b6cc305192c5319c091bd572f381
|