{"id":28628956,"url":"https://github.com/mgks/GitHubTree","last_synced_at":"2025-06-12T11:03:15.322Z","repository":{"id":279381773,"uuid":"938505608","full_name":"mgks/GitHubTree","owner":"mgks","description":"Visualize folder structure of any public GitHub repository.","archived":false,"fork":false,"pushed_at":"2025-06-03T08:19:23.000Z","size":623,"stargazers_count":52,"open_issues_count":0,"forks_count":14,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T05:39:37.918Z","etag":null,"topics":["api","github","structured-data","visualization"],"latest_commit_sha":null,"homepage":"https://githubtree.mgks.dev","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mgks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"mgks","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2025-02-25T04:09:09.000Z","updated_at":"2025-06-07T18:55:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"52ace271-87e2-4977-ac64-9ba26628de6d","html_url":"https://github.com/mgks/GitHubTree","commit_stats":null,"previous_names":["mgks/githubtree"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mgks/GitHubTree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgks%2FGitHubTree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgks%2FGitHubTree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgks%2FGitHubTree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgks%2FGitHubTree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgks","download_url":"https://codeload.github.com/mgks/GitHubTree/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgks%2FGitHubTree/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259453469,"owners_count":22860083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","github","structured-data","visualization"],"created_at":"2025-06-12T11:01:52.105Z","updated_at":"2025-06-12T11:03:15.286Z","avatar_url":"https://github.com/mgks.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/images/banner.png\" width=\"500\" alt=\"GitHubTree Banner\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e  \n  \u003cb\u003eWith GitHubTree, visualize the directory structure of any \u003ccode\u003epublic\u003c/code\u003e GitHub repository with a clean interface.\u003c/b\u003e\n\u003c/p\u003e\n\n----\n\n**GitHubTree allows you to:**\n\n*   **Explore:**  Easily browse the folder and file organization of a GitHub repo without cloning it.\n*   **Copy Paths:**  Quickly copy the path to any file or directory with a single click.\n*   **Copy Entire Tree:**  Copy the complete directory structure as plain text, perfect for documentation or sharing.\n*   **Jekyll Powered:** Built using the Jekyll static site generator for structure and organization, combined with vanilla JavaScript for GitHub API interaction.\n*   **No Authentication Required (for public repos):**  Uses the unauthenticated GitHub API, so you don't need to provide any credentials for public repositories.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/images/tree.png\" width=\"750\" alt=\"GitHubTree Repo Preview\"\u003e\n\u003c/p\u003e\n\n[**Try GitHubTree**](https://githubtree.mgks.dev)\n\n## How to Use\n\n1.  **Enter Repository:**  Type the GitHub repository name in the format `username/repo` (e.g., `mgks/shaml`).\n2.  **Enter Branch (Optional):**  Specify the branch name (defaults to `main`).\n3.  **Click \"Fetch\":**  The tool will retrieve and display the repository's folder structure.\n4.  **Copy Individual Paths:** Click the copy icon next to any file or directory to copy its path to your clipboard.\n5.  **Copy Entire Tree:** Click the \"Copy Complete Tree\" button to copy the complete structure as formatted text.\n\n## Use Cases\n\n*   **Quick Overview:**  Get a fast visual understanding of a repository's organization before deciding to clone it.\n*   **Documentation:**  Easily generate directory listings for project documentation.\n*   **Collaboration:**  Share the structure with others to discuss code organization.\n*   **Learning:**  Explore how other projects are structured to improve your own coding practices.\n\n## Local Development \u0026 Customization\n\nIf you want to run the project locally, customize it, or contribute:\n\n**Prerequisites:**\n\n*   **Ruby:** Ensure you have Ruby installed. Check with `ruby -v`. (Jekyll is Ruby-based). See [Installing Ruby](https://www.ruby-lang.org/en/documentation/installation/).\n*   **Bundler:** Install the Bundler gem: `gem install bundler`.\n\n**Steps:**\n\n1.  **Fork the Repository:** Create a fork of this repository on your own GitHub account.\n2.  **Clone Your Fork:** Clone your forked repository to your local machine:\n\n    ```bash\n    git clone https://github.com/mgks/GitHubTree.git\n    cd GitHubTree\n    ```\n3.  **Install Dependencies:** Install Jekyll and other required gems:\n\n    ```bash\n    bundle install\n    ```\n4.  **Run Locally:** Start the Jekyll development server:\n\n    ```bash\n    bundle exec jekyll serve\n    ```\n    This will build the site and serve it locally (usually at `http://localhost:4000`). Changes you make to most files will trigger an automatic rebuild.\n5.  **Make Changes:** Modify the source files as needed. Key areas include:\n    *   `_config.yml`: Site-wide configuration.\n    *   `_layouts/`: HTML layout templates.\n    *   `_includes/`: Reusable HTML snippets.\n    *   `assets/`: CSS, JavaScript (`script.js`), images.\n    *   `_data/`: Data files (like `repositories.json`).\n    *   `index.html`, `404.html`, etc.: Page content files.\n6.  **Commit and Push:** Commit your changes and push them to your forked repository:\n\n    ```bash\n    git add .\n    git commit -m \"Describe your changes\"\n    git push origin main # Or your default branch name\n    ```\n\n## Deployment\n\nThis project is automatically deployed to GitHub Pages using a **GitHub Actions workflow**.\n\n*   When changes are pushed to the `main` branch (or your configured default branch), the workflow runs.\n*   The workflow installs dependencies (`bundle install`) and builds the Jekyll site (`bundle exec jekyll build`).\n*   It then takes the generated static files from the `_site` directory and deploys them to the `gh-pages` branch (or whichever branch is configured for GitHub Pages hosting).\n*   **Important:** GitHub Pages serves the content from the deployment branch (`gh-pages`), *not* directly from your source code branch (`main`). Ensure GitHub Pages is enabled in your repository settings (Settings \u003e Pages) and configured to deploy from the correct branch (`gh-pages`).\n\n## Accessing Private Repositories (Advanced \u0026 Use With Extreme Caution)\n\n**Major Security Warning:** This tool, as deployed publicly, **cannot securely access private repositories.** The primary fetching logic runs in the user's browser (client-side JavaScript). Embedding API keys or tokens directly into client-side code is a **severe security risk**, as they can be easily extracted by anyone viewing the page source.\n\nTo access *your own* private repositories using a modified version of this tool, you **must**:\n\n1.  **Fork this project.**\n2.  **Make your fork PRIVATE.** Never make it public if you follow these steps.\n3.  **Obtain a GitHub Personal Access Token (PAT)** with the `repo` scope. Treat this token like a password.\n4.  **Modify `assets/js/script.js` in your PRIVATE fork:** Hardcode your PAT into the `GITHUB_PAT` constant within the script.\n5.  **Commit and push ONLY to your PRIVATE repository.**\n\n**Deployment of Private Fork:**\n\n*   The GitHub Actions workflow in your private fork will build the site (including the script with your embedded PAT).\n*   It will deploy the built site (from `_site`) to the `gh-pages` branch of your private repository.\n*   You can enable GitHub Pages on your private repository (Settings \u003e Pages) to serve from the `gh-pages` branch. The resulting URL will likely be accessible only to you (or collaborators on the private repo, depending on your GitHub plan settings).\n\n**Reiteration of Warnings:**\n*   **Never make your forked repository public if it contains your PAT hardcoded in `script.js`.** Your token will be exposed.\n*   This method embeds your token directly into the deployed JavaScript. **Anyone who can access the deployed GitHub Pages site for your private fork might be able to extract the token.**\n*   This modified version is strictly for **your personal use on a private fork** where you understand and accept the security risks.\n*   Regularly review and rotate your PATs. Consider more secure server-side proxy solutions if robust private repository access is needed.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit pull requests with bug fixes, improvements, or new features against the original `mgks/GitHubTree` repository.\n\n## License\n\nThis project is published under the MIT License - see [LICENSE](LICENSE) file for details or read [MIT license](https://opensource.org/licenses/MIT).\n\n## Support the Project\n\n**[GitHub Sponsors](https://github.com/sponsors/mgks):** You can support GitHubTree and my other projects by becoming a monthly or one-time GitHub sponsor.\n\n**[Follow Me](https://github.com/mgks) on GitHub** | **Add Project to Watchlist** | **Star the Project**\n\n\u003cbr /\u003e\u003cimg src=\"https://forthebadge.com/images/badges/built-with-love.svg\" alt=\"Built with Love\"\u003e\n","funding_links":["https://github.com/sponsors/mgks","https://github.com/sponsors/mgks):"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgks%2FGitHubTree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgks%2FGitHubTree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgks%2FGitHubTree/lists"}