Skip to content

Releases: mgks/GitHubTree

gh-tree@0.3.0

18 Mar 04:34

Choose a tag to compare

The v0.3.0 release introduces a significant overhaul of the user experience, focusing on professional aesthetics, intelligent navigation, and streamlined controls.

Visit GitHubTree 🚀

✨ Major Enhancements

1. Unified Tree Controls

  • Consistently manageable navigation with the new Unified Toggle. Merged "Expand All" and "Collapse All" into a single button that intelligently adapts its state (Compact vs. Expand) and icon based on the tree view.
  • Improved Sort and Style dropdowns with robust event handling for reliable switching.
  • Fetch Reliability: Fixed the "Fetch" button on the homepage to ensure consistent search triggering alongside the Enter key.

2. Intelligent Hierarchical Search

  • Context-Aware Filtering: When searching for files, parent folders are now preserved in the view. This ensures you always know the exact directory path of your results.
  • Auto-Expansion: Folders leading to search matches are automatically expanded, eliminating manual clicks during exploration.

3. Visual & Input Robustness

  • URL Auto-Sanitization: You can now paste a full GitHub URL (e.g., https://github.com/user/repo) directly into the repository field. It automatically cleans the input to user/repo.
  • New Visual Style: Bulleted (•): Introduced a clean, modern Bulleted style for tree visualization. This minimalist approach provides an alternative to traditional ASCII branches.

📱 Mobile-First Toolbar

  • Re-engineered the toolbar with a responsive 3-line grid layout for mobile devices.
  • Optimised element order for better thumb-reach and accessibility.
  • Automatic text-hiding on narrow screens to prioritize icons and save vertical space.

🛠 Core & Reliability

  • 422 Error Resolution: Modernized the core engine with the latest GitHub API headers and versioning, resolving intermittent "Unprocessable Entity" errors.
  • Smart Branch Handling: Improved default branch detection and persistence in URLs.
  • Npm Readiness: Prepped for gh-tree@0.3.0 publishing with verified binary paths and updated versioning.
  • Security Update: Enhanced Content Security Policy (CSP) to resolve Google Analytics connectivity.

📦 Installation

npm install gh-tree@latest

New Contributors

  • @raj-kapil made their first contribution "feature/add collapsible/expandable folder tree with toggle controls" in #7

Full Changelog: 0.2.0...0.3.0

gh-tree@0.2.0

04 Jan 13:26

Choose a tag to compare

This release focuses on Robustness and User Experience. We've eliminated the frustration of guessing branch names (main vs master) and improved error clarity across the board.

Visit GitHubTree 🚀

🧠 Core & CLI (gh-tree)

  • Smart Branch Detection: If a requested branch does not exist, the tool now queries the repository metadata to find the actual default branch and retries the fetch automatically.
  • Feedback Loop: The CLI now informs you if it had to switch branches (e.g., ℹ️ Branch 'main' not found. Switched to 'master').
  • Explicit Versioning: Added -v / --version flags to the CLI.
  • Error Handling: Replaced generic "API Error" messages with specific, actionable feedback (e.g., "Repository not found," "Bad Credentials").

🌐 Web App

  • Auto-Correction UI: If the app detects a branch mismatch, it notifies the user via the status bar and updates the URL history to reflect the correct branch.
  • Cache Optimization: Fixed caching logic to ensure corrected branches are cached under their true names, preventing wasted API calls on subsequent visits.
  • Mobile Layout: Improved responsiveness for the file list view on smaller screens.

📦 Installation

npm install gh-tree@latest

Contributors

Full Changelog: 0.1.0...0.2.0

gh-tree@0.1.0-npm-release

21 Dec 23:51

Choose a tag to compare

🚀 NPM Package Release: gh-tree

GitHubTree (gh-tree) is a high-performance tool to fetch, visualize, and generate ASCII directory trees for GitHub repositories without cloning. This release introduces the Core API and the CLI tool.

✨ Features

  • CLI Tool: Instant directory visualization via terminal.
    npx gh-tree facebook/react
  • Visual Styles: Supports multiple tree formats:
    • Classic: ├── src/
    • Minimal: Indentation only
    • ASCII: +-- src/
  • Private Repos: Securely access private repositories using a Personal Access Token (PAT).
  • Zero Dependencies: The core logic uses native Node.js/Browser APIs, ensuring a tiny footprint and maximum speed.
  • Web Integration: Powers the web interface at githubtree.mgks.dev.

📦 Installation

# Global Install
npm install -g gh-tree

# Per-project
npm install gh-tree

💻 Usage

CLI:

gh-tree <user/repo> [flags]
# Flags: --icons, --branch, --token

API:

import { GitHubTree } from 'gh-tree';
const gt = new GitHubTree();
const { tree } = await gt.getTree('mgks/gh-tree');
console.log(gt.generateAsciiTree(tree));

View the full documentation on GitHub.

Full Changelog: v0.5...0.1.0

🚀 GitHubTree 0.5 (Support the Project)

11 Apr 23:49

Choose a tag to compare

✨ Features and Improvements:

  • Migration to Jekyll: We've migrated to Jekyll now, static page builder for improved page rendering and plugin options that we can leverage in future for better UX.
  • Dark Mode: A very much needed feature, saves preference in browser memory.
  • Preconnecting GitHub: Improved page speed and API callback by preconnecting to external scripts.
  • ❤️ Support the Project (consider supporting the project via GitHub Sponsors).

🐞 Bug Fixes:

  • File trail URL throwing 404 errors because of repo slash encoding; fix commit by @max-programming
  • Canonical URLs pointing to the root only.

See Complete Changelog: v0.4...v0.5

🚀 GitHubTree 0.4

02 Apr 00:06

Choose a tag to compare

✨ Features and Improvements:

  • Dynamic Loading Indicator: The "Fetching..." message now dynamically displays the repository and branch being loaded, improving user context and potentially providing more information to crawlers during rendering.
  • SEO-Optimized Metadata: Dynamically generated page titles (<title>) and meta descriptions are now more descriptive and keyword-rich, using the repository name, branch, and description (if available) to enhance search engine visibility for specific repo views.
  • Enhanced Error Handling & Feedback:
    • Implemented more specific error messages for various GitHub API responses (e.g., 401 Unauthorized, 403 Forbidden, 404 Not Found, Rate Limits).
    • Rate limit messages now provide estimated reset times and suggest using a PAT (in private forks) for higher limits.
  • Clearer Truncation Warning: Added a distinct (non-blocking) warning message if the GitHub API indicates the returned tree data was truncated due to repository size.
  • Code Structure: Introduced a getApiHeaders helper function to centralize API request header generation, simplifying PAT integration.
  • Clipboard Functionality: Minor refinement to the copyToClipboard fallback mechanism.
  • ❤️ Support the Project (consider supporting the project via GitHub Sponsors).

🐞 Bug Fixes:

  • Corrected Private Repository Access: Fixed the implementation for using a Personal Access Token (PAT). API calls now correctly include the Authorization header if a PAT is provided in the script.js (intended for private forks only).
  • Improved URL Encoding: Ensured file/directory paths containing special characters are properly encoded in the generated links within the tree view.
  • Robust Empty/Invalid State Handling: Added specific checks and clearer user messages for scenarios like empty repositories (409 Conflict), invalid branches (404/422), or missing tree data.

🚀 GitHubTree 0.3

27 Mar 21:05

Choose a tag to compare

✨ Features:

  • Custom URL support (fetch content directly via URL).
  • New Share button, now you can share URLs directly.
  • Copy buttons now indicate successful execution.
  • 404 URLs handling.
  • ❤️ Support the Project (consider supporting the project on GitHub).

🐞 Bug Fixes:

  • No visual indication for content being copied.
  • Invalid URLs not handled properly.

* Crawlers without JavaScript rendering are going to see homepage meta instead of repo title and description. 😑

🚀 GitHubTree 0.2

11 Mar 06:46

Choose a tag to compare

✨ Features:

  • Added button ❤️ Support the Project (consider supporting the project on GitHub).
  • Added Tree Sorting: Now you can sort tree in folder first and alphabetical orders.

🐞 Bug Fixes:

  • Previous release was making unnecessary API requests, optimized now.
  • Improved grid layout for trees.

🚀 GitHubTree 0.1

26 Feb 08:45

Choose a tag to compare

Visualize the directory structure of any public GitHub repository with a clean interface.

✨ Features:

  • Instant Visualization: See the structure in a clean, terminal-like interface.
  • Copy Paths: Easily copy the path to any file or folder.
  • Copy Entire Tree: Grab the whole structure as formatted text.
  • No Auth Required: Works with public repos using the GitHub API (no login needed).
  • Fast & Lightweight: Built with vanilla JavaScript, HTML, and CSS.