{"id":25402310,"url":"https://github.com/andrewrgarcia/twee","last_synced_at":"2026-05-05T15:35:35.962Z","repository":{"id":276712043,"uuid":"930049734","full_name":"andrewrgarcia/twee","owner":"andrewrgarcia","description":"A Tree Viewer for the AI Era. Extract all content from your codebase to a single output. Content now includes pdfs.","archived":false,"fork":false,"pushed_at":"2025-03-16T00:25:13.000Z","size":524,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T06:29:27.522Z","etag":null,"topics":["c","diff","directory","git","terminal","terminal-based","tree"],"latest_commit_sha":null,"homepage":"","language":"C","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/andrewrgarcia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2025-02-10T01:14:08.000Z","updated_at":"2025-03-16T00:25:17.000Z","dependencies_parsed_at":"2025-02-10T16:30:38.417Z","dependency_job_id":null,"html_url":"https://github.com/andrewrgarcia/twee","commit_stats":null,"previous_names":["andrewrgarcia/twee"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrgarcia%2Ftwee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrgarcia%2Ftwee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrgarcia%2Ftwee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrgarcia%2Ftwee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewrgarcia","download_url":"https://codeload.github.com/andrewrgarcia/twee/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248560974,"owners_count":21124750,"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":["c","diff","directory","git","terminal","terminal-based","tree"],"created_at":"2025-02-16T01:34:06.823Z","updated_at":"2026-05-05T15:35:35.935Z","avatar_url":"https://github.com/andrewrgarcia.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15033378.svg)](https://doi.org/10.5281/zenodo.15033378)  \n[![Project Status: Moved](https://img.shields.io/badge/status-moved-blue)](https://github.com/andrewrgarcia/yggdrasil-cli)\n\n\u003e ⚠️ **Project Status: Evolved**  \n\u003e Twee was my original C prototype. The project has now **moved and evolved** into  \n\u003e [🌳 Yggdrasil CLI](https://github.com/andrewrgarcia/yggdrasil-cli) — a Rust re-imagining with more features, Markdown codex mode, and active updates.  \n\u003e Twee remains here for historical and citation purposes (see DOI above).\n\n# 🌳 Twee - A Tree Viewer for the AI Era  \n\nTwee is a fast and feature-rich alternative to `tree`, with **.gitignore awareness**, **file content preview (`--show`)**, and **built-in directory \u0026 file comparison (`--diff`)**. Twee respects `.gitignore`, ensuring accurate directory views of what's important.\n\nThe `--show` functionality in Twee is based on the efficient **\"show\" algorithm** from [`showfileshere`](https://github.com/andrewrgarcia/showfileshere), developed under the [MIT LICENSE](https://github.com/andrewrgarcia/showfileshere/blob/main/LICENSE).\n\nhttps://github.com/user-attachments/assets/b054aec1-46f6-4644-9627-dc1d1a385757\n\n\n## AI Injection\n\u003cimg height=\"250\" alt=\"ChatGPT Image Jul 10, 2025, 03_07_37 PM\" src=\"https://github.com/user-attachments/assets/5c449157-d9cc-42db-9192-91b23df6132f\" /\u003e\n\n\n\u003e **“Wow. That was an epic tale you just pasted into my mouth like a mom bird regurgitating a worm.”**\n\u003e — *Your AI, after `twee --show \u003e show.txt`*\n\n---\n\n\nTwee's **file content preview (`--show`)** is an *underrated superpower*; it allows **structured extraction of codebases, configuration files, and entire directory snapshots** for use in **AI models, ChatGPT, and LLM-powered workflows** 📥🤖\n\n### Use Cases:\n✅ Inject an entire codebase into an AI-powered assistant for **context-aware debugging \u0026 refactoring**  \n✅ Extract structured content for **automated documentation or static analysis**  \n✅ Feed large repositories into **fine-tuned models \u0026 embeddings** without copy-pasting  \n\n#### Example:\n```sh\ntwee --show c h py \u003e project_dump.txt\n```\n_(Feed `project_dump.txt` into ChatGPT or any LLM for deep analysis.)_\n\n---\n\n## 🚀 Features\n\n| Feature                                      | `twee` | `tree` | `eza --tree` |\n|----------------------------------------------|--------|--------|--------------|\n| **Directory Tree View**                      | ✅ Yes | ✅ Yes | ✅ Yes |\n| **File Size \u0026 Metadata (`--details`)**       | ✅ Yes | ❌ No | ✅ Yes |\n| **Gitignore Awareness (Always On)**          | ✅ Yes | ❌ No | ✅ Yes |\n| **File Differences (`--diff`)**              | ✅ Yes | ❌ No | ✅ Yes |\n| **File Content Preview (`--show`)**          | ✅ Yes [*(AI-ready code extraction)*](#ai-injection) | ❌ No | ❌ No |\n| **PDF Text Extraction (`--show pdf`)**       | ✅ [*(Optional)*](#optional-pdf-support) | ❌ No | ❌ No |\n| **Flat View (`--flat`)**                     | ✅ Yes | ❌ No | ❌ No |\n| **Written in C for Speed**                   | ✅ Yes | ❌ No | ❌ No |\n---\n\n## 📚 Usage Guide\n\n```sh\nUsage: twee [options] [directory]\n\nOptions:\n  -h, --help         Show this help message and exit\n  -L \u003clevel\u003e         Limit directory depth to \u003clevel\u003e\n  --no-emoji         Disable emojis in output\n  --details          Show file details (size, modified date)\n  --show [exts]      Show contents of files with given extensions (e.g., `py js md pdf`)\n  --ignore \u003cname\u003e    Ignore file/directory by name (can be used multiple times)\n  --only \u003cdir\u003e...    Limit view to only the specified directories\n                       Use +root to include top-level files (e.g. README.md)\n  --no-git           Do not auto-ignore files listed in .gitignore\n  --flat             Disable tree view (list as flat structure)\n  --head \u003cN\u003e         Show only first N lines per file (used with --show)\n  --tail \u003cN\u003e         Show only last N lines per file (used with --show)\n  --dif \u003cdir1\u003e \u003cdir2\u003e   Compare directory structures (existence-only)\n  --diff \u003cdir1\u003e \u003cdir2\u003e  Compare directory structures AND file contents  \n```\n\n\n---\n\n\n\n\n### 📝 Examples\n\n```sh\n# Show tree of current directory\ntwee\n\n# Limit depth to 2 levels\ntwee -L 2\n\n# Disable emoji icons\ntwee --no-emoji\n\n# Ignore multiple directories\ntwee --ignore node_modules build\n\n# Only show files inside 'src' and top-level root files\ntwee --show --only src +root\n\n# Show C/JSON/Markdown files from specific subdir, plus top-level root files (+root)\ntwee --show md c json --only tests/dir1 +root --index\n\n# Compare structures between two directories\ntwee --dif dir1 dir2\n\n# Compare structures AND file contents\ntwee --diff dir1 dir2\n\n# Show contents of all `.py` and `.rs` files\ntwee --show py rs\n\n# Show contents of PDFs (if built with PDF support)\ntwee --show pdf\n\n# Show contents but limit output to first 10 lines per file\ntwee --show py --head 10\n```\n\n---\n## 📦 Installation  \n\n### Linux \u0026 macOS\n```sh\ngit clone https://github.com/YOUR_USERNAME/twee.git\ncd twee\nmake\nsudo mv build/twee /usr/local/bin/twee\n```\n\n### Windows (via MinGW or WSL)\n```sh\ngit clone https://github.com/YOUR_USERNAME/twee.git\ncd twee\nmake\n```\n_(Optionally move `twee.exe` to a location in your PATH.)_\n\n---\n\n## Optional PDF Support\n\nhttps://github.com/user-attachments/assets/1e5a4f86-6e18-4077-a1c5-f01188d8883d\n\nTwee supports **PDF text extraction** with `--show pdf`, but it is not built by default.  \nTo enable **PDF reading**, install `poppler-glib` and build with the `pdf` target:\n\n### Install Required Libraries\n#### Debian/Ubuntu\n```sh\nsudo apt install libpoppler-glib-dev\n```\n#### Arch Linux\n```sh\nsudo pacman -S poppler-glib\n```\n#### Fedora\n```sh\nsudo dnf install poppler-glib-devel\n```\n#### macOS (Homebrew)\n```sh\nbrew install poppler\n```\n\n### Build with PDF Support\n```sh\nmake pdf\n```\n\nNow, Twee can **extract text from PDFs** using:\n```sh\ntwee --show pdf\n```\n\n---\n\n## 🌍 Global Usage\n\nTo make `twee` available globally, add it to your shell configuration:\n\n### Linux/macOS (Add to `.bashrc` or `.zshrc`)\n```sh\necho 'twee() { \"$HOME/twee/build/twee\" \"$@\"; }' \u003e\u003e ~/.bashrc\nsource ~/.bashrc\n```\n\n### Windows (PowerShell)\n```powershell\n[System.Environment]::SetEnvironmentVariable(\"Path\", $Env:Path + \";C:\\\\path\\\\to\\\\twee\", [System.EnvironmentVariableTarget]::User)\n```\n\n---\n\n\n## 🌟 **Why Twee?**\nTwee isn't just a tree viewer—it’s a **developer’s productivity tool**:  \n\n- 🎨 **Beautifully formatted output** with emoji-based file types  \n- 🚀 **Fast execution**, even on large projects  \n- 🛠️ **Built-in directory \u0026 file comparisons**, replacing `diff -rq`  \n- 🔥 **Git-aware** it automatically respects `.gitignore`  \n- 📂 **File Content Previewing (`--show`)** perfect for AI workflows, code analysis, and LLM-powered tools  \n- 📖 **Optional PDF text extraction (`--show pdf`)**  \n- ⚡ **Written in C for speed**, ensuring optimal performance  \n\n🔗 **GitHub Repository:** [github.com/andrewrgarcia/twee](https://github.com/andrewrgarcia/twee)  \n\n✨ Star the repo if you like it! 🚀\n\n## 📄 Citation\nIf you use Twee in your research, please cite:\n\n\u003e **Garcia, A. R.** (2025). *Twee: Lightweight Git-aware File Extraction for AI-driven Code Analysis*. Zenodo. [https://doi.org/10.5281/zenodo.15033378](https://doi.org/10.5281/zenodo.15033378)\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15033378.svg)](https://doi.org/10.5281/zenodo.15033378)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewrgarcia%2Ftwee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewrgarcia%2Ftwee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewrgarcia%2Ftwee/lists"}