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
.gitignoreand.psignorefor 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.gitignoreinstead of.psignore--helpor-hโ display help message
Example:
./project_scribe ./my_project --use-gitignoreAfter 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.