Skip to main content

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 .gitignore and .summaryignore.
  • Supports additional ignore patterns with CLI options.
  • Supports file type filtering such as .py and .md.
  • Attempts utf-8, utf-8-sig, and shift_jis when 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

generate_project_summary-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

generate_project_summary-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file generate_project_summary-0.1.0.tar.gz.

File metadata

File hashes

Hashes for generate_project_summary-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7f931ca5558e14c66b49e803eda64dcf24eb6c581ee35096d25602dc6278f415
MD5 4da5c1e80e01d3711020850c6a670848
BLAKE2b-256 8cbef0b7f68e292369957d11a9f76354bd6436839114244c2060d2fa906c2c58

See more details on using hashes here.

File details

Details for the file generate_project_summary-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for generate_project_summary-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ada7c4e0147d668fd378d6c43809e07748580361637939c994e4ca279db32620
MD5 49b9fa84bd0bebe1e02846eeb423f71c
BLAKE2b-256 35d28a469e7f03bcc1c028d87563fa23f9d7e5fc39ea9bc2c9f3de67e4c6501c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page