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.1.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.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for generate_project_summary-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4b513541c0e3367dc2896a805ebf957cf79f746f829487008913de2c6462e604
MD5 8b79f844127d9ead626ff48295ee864b
BLAKE2b-256 f7a34dd7a802ebc123af42db99ce206a6763f075a2b2291d26d51cb0c1aa3327

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for generate_project_summary-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb631e97124394e2c4f39037418af99c2366696cf7e717d13e486c305a2013db
MD5 2d4e64a45a01b44e25b96cee397cd4fa
BLAKE2b-256 76eefbeaacc411e10d46c03ca7df544d9aaddd20b90474afda13c4619601844d

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