A simple Python desktop utility (using Tkinter) designed to assist users, particularly when interacting with Large Language Models (LLMs), by bridging the gap between filesystem directory structures and their text-based map representations.
This tool has two main functions:
- Snapshot (Directory -> Map): Scans an existing directory on your filesystem (including the directory itself as the root) and generates a text-based map representing its structure (folders and files), suitable for copying. Includes options for output format (Standard Indent, Tabs, Tree), ignoring specific files/directories, and optionally including file/folder emojis based on file type.
- Scaffold (Map -> Directory): Parses an indented text map (in various common formats) and creates the corresponding nested directory structure and empty files within a user-selected base directory on the filesystem.
Core functionality is complete and packaged for basic distribution. Includes snapshot generation with root dir/emojis, multi-format scaffolding, config persistence, and interactive exclusion. Next steps involve creating a proper installer and refining context menu integration.
- Snapshot:
- Generates directory maps starting with the selected directory as the root.
- Multiple output formats: Standard Indent (2-space), Tabs, or Tree (preference saved in config).
- Option to include leading emojis based on file type (preference saved in config).
- Adds a trailing
/to directory names in the map. - Built-in default ignore patterns + loads user-defined defaults from
config.json. - Allows custom ignore patterns per run via GUI.
- Runs in a background thread with progress bar.
- Interactive map exclusion: Clicking lines/directories toggles strikethrough, adds clean item name to ignore list (handles prefixes/emojis), respects cascade.
- Copy to Clipboard (respects exclusions) / Save Map As buttons.
- Auto-copy option (preference saved in config).
- Scaffold:
- Parses multiple map formats (Auto-Detect, Spaces, Tabs, Tree, Generic). Format hint saved in config.
- Runs in a background thread with progress bar.
- Interactive map exclusion: Clicking lines/directories toggles strikethrough; creation process skips excluded items and their descendants.
- Paste/Load map input.
- "Open Output Folder" button on success.
- GUI & Config:
- Tkinter/ttk UI with Snapshot/Scaffold tabs.
- File/Directory browsers, Clear buttons, Tooltips, Status bars.
- Menu Bar (File, Edit->Preferences, Help->README/About).
- Settings persistence (
config.json) for paths, preferences, window state, user ignores. - Context Handling (launch via path for Snapshot or Scaffold).
- Application Icon: Custom icon set for executable and window title bar (Taskbar icon may still show default Tkinter icon - known issue).
- Packaging:
- Basic standalone executable created using PyInstaller (
--onedir).
- Basic standalone executable created using PyInstaller (
- Python 3.x (developed on 3.x)
- tkinter / ttk (usually included with Python)
- pyperclip (for clipboard)
- Download: Obtain the
DirSnap-v3.2.1.zip(or.7z) file (e.g., from the GitHub Releases page). - Extract: Unzip the entire archive to a location on your computer (e.g., your Desktop or Downloads folder). This will create a
DirSnapfolder. - Run: Open the extracted
DirSnapfolder and double-clickDirSnap.exeto launch the application. Do not moveDirSnap.exeout of this folder, as it needs the other files alongside it to work.
Context Menu Setup (Manual):
To enable right-clicking on folders/files to use DirSnap:
- Windows: Follow the instructions to modify the registry using the
setup_windows_right_click.regfile located in thescriptsfolder (you may need to edit the file first to ensure the path toDirSnap.exeis correct for where you extracted the application). Requires Administrator privileges. - macOS: Follow the instructions in
scripts/setup_macos_service_instructions.mdto create a Quick Action using Automator. - Linux: Follow the instructions in
scripts/setup_linux_action_instructions.mdfor your specific desktop environment/file manager.
- Clone the repository.
- (Recommended) Create and activate a virtual environment:
python -m venv venv, then activate it (.\venv\Scripts\activateorsource venv/bin/activate). - Install dependencies:
pip install -r requirements.txt. - Run:
python main.py.
- Completed / Mostly Done:
- Core MVP Logic & GUI Structure.
- Context Handling & QoL Features (Status, Clear, Tooltips, Open Folder).
- Multi-Format Parsing & Snapshotting.
- Interactive Exclusion (Snapshot & Scaffold) w/ Cascade & Prefix Stripping.
- Background Threading & Progress Bars.
- Config File Persistence (Paths, Prefs, Ignores, Window State).
- Help Menu & About Dialog.
- Snapshot: Root Dir included, Expanded Emojis, Config options saved.
- Scaffold: Descendant Exclusion handled.
- Basic Packaging (
--onedirexecutable created). - Application Icon (Window Title / File, Taskbar issue pending).
- Up Next:
- Distribution Prep:
- Create Windows Installer (Inno Setup) to automate installation, shortcut creation, and potentially context menu setup (
.regexecution). - Refine/Test Context Menu Setup scripts/instructions for all platforms.
- Create Windows Installer (Inno Setup) to automate installation, shortcut creation, and potentially context menu setup (
- Polish:
- Investigate remaining Taskbar icon issue on Windows.
- Further UI/UX Refinements (Layout, Error Dialogs).
- Refine "Open Folder" logic (edge cases).
- Final Documentation Review.
- Distribution Prep:
- Future / Deferred Ideas:
- Browser Extension Integration.
- Drag and Drop support.
- Advanced Config Options.