- Interactive Interface: User-friendly interface with step-by-step guidance
- Directory Browser: Visual directory navigation with arrow keys
- Configuration Memory: Automatically saves and recalls your last used settings
- Tab Completion: Press
Tabto quickly load your previous configuration - Visual Tree Structure: Beautiful file tree with folder 📁 and file 📄 icons
- Flexible Ignore Paths: Skip directories like
node_modules,.git, etc. - Depth Control: Limit how deep the tree structure goes
- Auto-Open: Automatically open generated files (configurable)
- File Watcher: Optional file system monitoring for automatic updates
- Non-Interactive Mode: Support for automation and scheduled tasks
- Configuration Commands: Direct command updates (e.g.,
/depth 7)
- PowerShell 5.1 or higher
- Windows, macOS, or Linux operating system
- Open PowerShell in your project directory
- Run the script:
.\Path-Generator.ps1 - Follow the interactive prompts
- Browse Directories: Press
Bwhen prompted for path - Current Directory: Type
.when prompted for path - Parent Directory: Type
..when prompted for path - Last Configuration: Press
Tabat any prompt - Skip Optional Fields: Press
Enteron optional prompts
# Interactive mode (recommended)
.\Path-Generator.ps1
# Show help
.\Path-Generator.ps1 -Help
# Show configuration
.\Path-Generator.ps1 /config
# Enable debug mode
.\Path-Generator.ps1 -Debug
# Non-interactive mode
.\Path-Generator.ps1 -NonInteractive -RootPath "C:\MyProject" -MaxDepth 5
# Silent mode (no output)
.\Path-Generator.ps1 -Silent -RootPath "C:\MyProject"During any prompt, you can use these commands:
/depth <number>- Set default max depth/ignore <paths>- Set default ignore paths (semicolon-separated)/path <path>- Set default root path/auto-open <true|false>- Set default auto-open behavior/output <path>- Set default output path
Examples:
/depth 7
/ignore node_modules;.git;bin
/auto-open falseThe script includes a file watcher that can automatically update the documentation when files change:
# Start the watcher
.\watch-and-update.ps1
# Silent mode
.\watch-and-update.ps1 -Silent
# Run for specific duration (in seconds)
.\watch-and-update.ps1 -Duration 3600 # Run for 1 hourThe script generates a FileStructure.md file in your project root with:
- Project name and timestamp
- Configuration details
- Beautiful tree structure with icons
- Proper markdown formatting
Example output:
# File Structure
**Generated on:** 2024-01-15 10:30:00
**Root Path:** `C:\Projects\MyApp`
**Max Depth:** 3
📂 MyApp ├── 📁 src │ ├── 📄 index.js │ └── 📁 components │ ├── 📄 Header.js │ └── 📄 Footer.js ├── 📁 public │ └── 📄 index.html └── 📄 package.json
## ⚙️ Configuration
The script saves your configuration in:
- Windows: `%USERPROFILE%\.pathgenerator_config.json`
- macOS/Linux: `~/.pathgenerator_config.json`
### Configurable Settings
- Default root path
- Default ignore paths
- Default maximum depth
- Default output path
- Auto-open behavior
### PowerShell Profiles
Add to your PowerShell profile for easy access:
```powershell
# Add to $PROFILE
Set-Alias pg "C:\Path\To\Path-Generator.ps1"
# Then use:
pg
- Node.js:
node_modules;.git;coverage;dist - .NET:
bin;obj;.vs;packages - Python:
__pycache__;.pytest_cache;venv;.git - General:
.git;.svn;.hg;.DS_Store
Run PowerShell as Administrator and execute:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser- Use absolute paths:
C:\Projects\MyApp - Use
.for current directory - Check for typos and ensure the path exists
The script will mark inaccessible directories with ❌ and continue scanning.
> .\file_structure_generator.ps1
📁 Path you want generated:
> .
> .\file_structure_generator.ps1
📁 Path you want generated:
> C:\MyProject
🚫 Paths/Folders to ignore:
> node_modules;.git;dist;coverage
> .\file_structure_generator.ps1
📁 Path you want generated:
> [Press Tab]
Feel free to submit issues, fork the repository, and create pull requests for any improvements.
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the need for quick, beautiful project documentation
- Built with ❤️ using PowerShell
Pro Tip: Add this script to your project templates to automatically generate documentation for new projects!