GitHunt
SA

Sam1624/ProjectScribe

ProjectScribe is a lightweight C++ command-line tool that scans your project's directory, generates a clean file structure report, and includes the contents of all relevant source files. Useful for sharing your project with friends, collaborators, or language models for review and documentation.

๐Ÿ“ ProjectScribe

ProjectScribe is a command-line utility written in C++ that helps you quickly and easily generate a textual representation of your project structure. It's especially useful when sharing your project with others โ€” be it a friend, a colleague, or an LLM (Large Language Model) โ€” for review, analysis, or documentation.


๐Ÿ”ง Features

  • ๐Ÿ“ Generates a full project structure with folders, text files, and binary files
  • ๐Ÿงน Supports both .gitignore and .psignore for excluding files and directories
  • ๐Ÿ“„ Includes the contents of all text files in the final output file (project_structure.txt)
  • ๐Ÿง  Detects binary files based on null byte signatures

๐Ÿš€ Usage

./project_scribe [path] [options]

Arguments:

  • path โ€” path to the root project directory (defaults to the current directory)

Options:

  • --use-gitignore โ€” use .gitignore instead of .psignore
  • --help or -h โ€” display help message

Example:

./project_scribe ./my_project --use-gitignore

After execution, the tool generates a project_structure.txt file containing:

  • A hierarchy of files and folders
  • Indication of binary files
  • Contents of all readable text files

๐Ÿงพ About .psignore

ProjectScribe supports its own ignore format file called .psignore, and can also fall back to .gitignore if --use-gitignore is specified.

The .psignore file must be placed at the root of the project being scanned. If the file is not found, a default ignore list will be used.

Example .psignore:

# This is a comment, it will be ignored.
# Add folder or file names to skip here.
# One entry per line.

# Folders
.idea
out/
dist/

# Files
CMakeCache.txt
compile_commands.json

# Extensions (must start with a dot)
.log
.tmp
.bak

๐Ÿ“‚ Project Structure

ProjectScribe/
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ CMakeLists.txt
โ”œโ”€โ”€ include/
โ”‚   โ””โ”€โ”€ ProjectScanner.hpp
โ””โ”€โ”€ src/
    โ”œโ”€โ”€ main.cpp
    โ””โ”€โ”€ ProjectScanner.cpp

๐Ÿ“Œ Sample Output (project_structure.txt)

๐Ÿ“ Full project structure: ~/ProjectScribe

[FILE] .gitignore
[FILE] CMakeLists.txt
[DIR] include/
  [FILE] ProjectScanner.hpp
[DIR] src/
  [FILE] ProjectScanner.cpp
  [FILE] main.cpp

๐Ÿ“„ File contents:

[FILE] CMakeLists.txt:
--------------------
cmake_minimum_required(VERSION 3.16)
project(ProjectScribe)
...
--------------------

[FILE] src/main.cpp:
--------------------
#include "ProjectScanner.hpp"
...
--------------------

๐Ÿ“‹ Requirements

  • C++17 compatible compiler
  • CMake โ‰ฅ 3.16

โš™๏ธ Build

git clone https://github.com/Sam1624/ProjectScribe.git
cd ProjectScribe 
mkdir build && cd build
cmake ..
make
./project_scribe --help

๐Ÿ“œ License

This project is licensed under the MIT License. See the LICENSE file for details.

Sam1624/ProjectScribe | GitHunt