{"id":28337485,"url":"https://github.com/ga1az/pathdigest","last_synced_at":"2026-04-24T07:34:28.403Z","repository":{"id":294766563,"uuid":"988014115","full_name":"ga1az/pathdigest","owner":"ga1az","description":"A command-line tool written in Go that analyzes Git repositories, local directories, or individual files and generates a structured, LLM-friendly text digest of their content.","archived":false,"fork":false,"pushed_at":"2026-04-13T20:02:19.000Z","size":63,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-13T21:30:03.778Z","etag":null,"topics":["cli","code-analysis","code-summarization","context-generator","git","go","llm","text-processing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ga1az.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-21T23:41:07.000Z","updated_at":"2026-04-13T20:02:22.000Z","dependencies_parsed_at":"2025-05-22T00:48:47.859Z","dependency_job_id":null,"html_url":"https://github.com/ga1az/pathdigest","commit_stats":null,"previous_names":["ga1az/pathdigest"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ga1az/pathdigest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ga1az%2Fpathdigest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ga1az%2Fpathdigest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ga1az%2Fpathdigest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ga1az%2Fpathdigest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ga1az","download_url":"https://codeload.github.com/ga1az/pathdigest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ga1az%2Fpathdigest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32214418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","code-analysis","code-summarization","context-generator","git","go","llm","text-processing"],"created_at":"2025-05-26T23:20:38.459Z","updated_at":"2026-04-24T07:34:28.397Z","avatar_url":"https://github.com/ga1az.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PathDigest\n\nPathDigest is a command-line tool written in Go that analyzes Git repositories, local directories, or individual files and generates a structured, LLM-friendly text digest of their content. The digest can be used as context for Large Language Models (LLMs) in tools like Cursor, VSCode, Gemini, and others.\n\nInspired by web-based tools like [gitingest](https://github.com/cyclotruc/gitingest) by @cyclotruc, PathDigest brings similar powerful code-to-context capabilities directly to your terminal as a native, efficient binary.\n\n\u003e I made this tool for my own use, but I thought it might be useful to others.\n\n## Installation\n\n### Via `go install` (requires Go 1.23+)\n\nMake sure `$HOME/go/bin` (or `$GOPATH/bin`) is in your `PATH`.\n\n```bash\ngo install github.com/ga1az/pathdigest@latest\n```\n\n### Via install script (macOS \u0026 Linux)\n\n```bash\n# Install to default directory ($GOPATH/bin or ./bin)\ncurl -sSfL https://raw.githubusercontent.com/ga1az/pathdigest/main/install.sh | sh -s\n\n# Install to a specific directory\ncurl -sSfL https://raw.githubusercontent.com/ga1az/pathdigest/main/install.sh | sh -s -- -b /usr/local/bin\n\n# Install a specific version\ncurl -sSfL https://raw.githubusercontent.com/ga1az/pathdigest/main/install.sh | sh -s -- v0.2.0\n```\n\n### Via GitHub Releases\n\nDownload the binary for your platform from [github.com/ga1az/pathdigest/releases](https://github.com/ga1az/pathdigest/releases).\n\n```bash\n# macOS (Apple Silicon)\ncurl -sL https://github.com/ga1az/pathdigest/releases/latest/download/pathdigest_0.0.0_darwin_arm64.tar.gz | tar xz\nchmod +x pathdigest\nmv pathdigest /usr/local/bin/\n\n# macOS (Intel)\ncurl -sL https://github.com/ga1az/pathdigest/releases/latest/download/pathdigest_0.0.0_darwin_amd64.tar.gz | tar xz\nchmod +x pathdigest\nmv pathdigest /usr/local/bin/\n\n# Linux (amd64)\ncurl -sL https://github.com/ga1az/pathdigest/releases/latest/download/pathdigest_0.0.0_linux_amd64.tar.gz | tar xz\nchmod +x pathdigest\nmv pathdigest /usr/local/bin/\n\n# Linux (arm64)\ncurl -sL https://github.com/ga1az/pathdigest/releases/latest/download/pathdigest_0.0.0_linux_arm64.tar.gz | tar xz\nchmod +x pathdigest\nmv pathdigest /usr/local/bin/\n```\n\n## Usage\n\n### Basic\n\n```bash\n# Digest a local directory (outputs to pathdigest_digest.txt by default)\npathdigest ./my-project\n\n# Digest a Git repository URL\npathdigest https://github.com/ga1az/pathdigest\n\n# Output to stdout (useful for piping)\npathdigest ./my-project -o -\n\n# Output to a specific file\npathdigest ./my-project -o digest.txt\n```\n\n### JSON Output\n\nUse `--format json` (or `-f json`) for structured output that tools and scripts can consume:\n\n```bash\n# JSON to file\npathdigest ./my-project -f json -o digest.json\n\n# JSON to stdout\npathdigest ./my-project -f json -o -\n\n# Default text format (unchanged behavior)\npathdigest ./my-project\n```\n\nThe JSON output includes:\n- `summary` — source path, file count, total size, patterns used\n- `tree` — nested directory structure with names, paths, types, sizes\n- `files` — flat array of all processed files with content\n- `git_info` — repository metadata when processing a Git URL\n\n### Filtering\n\n```bash\n# Exclude additional patterns (adds to built-in defaults)\npathdigest ./my-project -e \"*.test.ts\" -e \"coverage/\"\n\n# Include only specific patterns (overrides excludes)\npathdigest ./my-project -i \"*.go\" -i \"go.mod\"\n\n# Limit max file size (default: 10MB)\npathdigest ./my-project -s 1048576  # 1MB limit\n```\n\n### Git Integration\n\n```bash\n# Clone and digest a specific branch\npathdigest https://github.com/user/repo -b develop\n\n# Digest a specific path within a repo\npathdigest https://github.com/user/repo/tree/main/internal/pkg\n```\n\n### All Flags\n\n```\nFlags:\n  -b, --branch string             Branch to clone and ingest (if source is a Git URL)\n  -e, --exclude-pattern strings   Glob patterns to exclude (adds to defaults)\n  -f, --format string             Output format: text or json (default \"text\")\n  -h, --help                      Help for pathdigest\n  -i, --include-pattern strings   Glob patterns to include (overrides excludes)\n  -s, --max-size int              Maximum file size in bytes (default 10485760)\n  -o, --output string             Output file path (default \"pathdigest_digest.txt\")\n```\n\n## Shell Completions\n\nPathDigest supports autocompletion for **bash**, **zsh**, and **fish**.\n\n### Bash\n\n```bash\n# Generate and load completions\npathdigest completion bash \u003e ~/.config/pathdigest/completion.bash\necho 'source ~/.config/pathdigest/completion.bash' \u003e\u003e ~/.bashrc\n\n# Or if you use bash-completion (recommended)\npathdigest completion bash \u003e $(brew --prefix)/etc/bash_completion.d/pathdigest  # macOS\npathdigest completion bash \u003e /etc/bash_completion.d/pathdigest                  # Linux\n```\n\n### Zsh\n\n```bash\n# Generate completions to your fpath\npathdigest completion zsh \u003e \"${fpath[1]}/_pathdigest\"\n\n# Or manually:\nmkdir -p ~/.zfunc\npathdigest completion zsh \u003e ~/.zfunc/_pathdigest\n\n# Make sure ~/.zfunc is in your fpath in ~/.zshrc:\n# fpath+=~/.zfunc\n# autoload -U compinit \u0026\u0026 compinit\n```\n\n### Fish\n\n```bash\npathdigest completion fish \u003e ~/.config/fish/completions/pathdigest.fish\n```\n\n## Features\n\n- **Versatile Source Input** — Process Git repository URLs (cloning specific branches/commits), local directories, or single files.\n- **Text \u0026 JSON Output** — Default text format for human consumption, JSON format (`-f json`) for tools and scripts.\n- **Smart Filtering** — Built-in exclude patterns for common noise (`.git/`, `node_modules/`, `build/`, etc.) plus custom glob patterns.\n- **Git Integration** — Specify branches, commits, and sub-paths when providing a Git URL.\n- **File Size Control** — Set a maximum file size to skip very large files.\n- **Cross-Platform** — Pre-built binaries for macOS, Linux, and Windows (amd64 and arm64).\n- **Shell Completions** — Autocompletion for bash, zsh, and fish.\n\n## Build from Source\n\n```bash\ngit clone https://github.com/ga1az/pathdigest.git\ncd pathdigest\ngo build ./cmd/pathdigest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fga1az%2Fpathdigest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fga1az%2Fpathdigest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fga1az%2Fpathdigest/lists"}