| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Struct_Repo is a command-line (CLI) tool written in Dart that analyzes a project's directory structure and generates a single, comprehensive Markdown file containing the contents of all its text-based files.
This tool is incredibly useful for:
The tool is designed to be smart: it automatically ignores binary files, focusing only on content that can be read as text.
You can use Struct_Repo by either compiling it from source or running it directly with the Dart SDK.
Compiling the tool creates a native executable that you can run from anywhere on your system without needing to call Dart directly.
Clone the repository:
git clone https://github.com/TrexPD/struct_repo.git
cd struct_repoCompile for your platform:
For Windows:
dart compile exe .\src\main.dart -o .\bin\structrepo.exeFor macOS or Linux:
dart compile exe src/main.dart -o bin/structrepo(Optional) Add the Executable to Your PATH: To use the structrepo command from any directory, add the project's bin folder to your system's PATH environment variable.
Windows (in PowerShell):
# Get the full path to the 'bin' directory
$binPath = (Get-Item "bin").FullName
# Add it to your user PATH (this change is permanent)
$oldPath = [System.Environment]::GetEnvironmentVariable("Path", "User")
[System.Environment]::SetEnvironmentVariable("Path", "$oldPath;$binPath", "User")
# You will need to restart your terminal for the change to take effect
Write-Host "The 'bin' directory has been added to your PATH. Please restart your terminal."macOS/Linux (for bash/zsh): Open your shell's configuration file (e.g., ~/.bashrc, ~/.zshrc, or ~/.profile) and add the following line:
export PATH="$PATH:/full/path/to/struct_repo/bin"Save the file and reload your shell configuration by running source ~/.bashrc (or the name of the file you edited).
If you prefer not to compile an executable, you can run the script directly.
Clone the repository:
git clone https://github.com/TrexPD/struct_repo.git
cd struct_repoRun the command:
Instead of structrepo, you will use dart run src/main.dart. See usage examples below.
The tool is designed for simplicity. The basic syntax is:
structrepo [directory_path]
Or, if you are using dart run:
dart run src/main.dart [directory_path]
Navigate to the project folder you want to document and run:
structrepo .Or, more simply:
structrepoThis will create a file named current_directory_name.md in that same location.
You can provide a relative or absolute path to any directory.
# Example with a relative path
structrepo ../my-other-project
# Example with an absolute path on Windows
structrepo C:\Users\YourName\Documents\Projects\my-web-project
# Example with an absolute path on macOS/Linux
structrepo /home/your_user/projects/my-api-projectThis will generate an output file (my-other-project.md, my-web-project.md, etc.) in the directory where you ran the command.
When structrepo is run on a project, it generates a Markdown file formatted as follows:
# Project Structure: project-name
### file1.txt
content...##### subdirectory/file2.dart
content......and so on for all text files.
Contributions are welcome! Feel free to report problems or send pull requests.
Struct_Repo is open-source under the MIT License.
Created with ❤️ and Dart by Paulo Daniel (TrexPD)!
| Back | FazBrowse Home | New Git URL |