Skip to content

Fully-functional Path Structure Generator. Interactive with many settings & QOL updates. watch-and-update working

Notifications You must be signed in to change notification settings

Kadenvh/Path-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Path Generator v2.1

PowerShell Version License

🚀 Features

  • 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 Tab to 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)

📋 Requirements

  • PowerShell 5.1 or higher
  • Windows, macOS, or Linux operating system

🎯 Quick Start

  1. Open PowerShell in your project directory
  2. Run the script:
    .\Path-Generator.ps1
  3. Follow the interactive prompts

Quick Commands

  • Browse Directories: Press B when prompted for path
  • Current Directory: Type . when prompted for path
  • Parent Directory: Type .. when prompted for path
  • Last Configuration: Press Tab at any prompt
  • Skip Optional Fields: Press Enter on optional prompts

📚 Usage

Basic Usage

# 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"

Configuration Commands

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 false

File Watcher

The 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 hour

📄 Output Format

The 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

Common Ignore Patterns

  • Node.js: node_modules;.git;coverage;dist
  • .NET: bin;obj;.vs;packages
  • Python: __pycache__;.pytest_cache;venv;.git
  • General: .git;.svn;.hg;.DS_Store

🐛 Troubleshooting

"Cannot be loaded because running scripts is disabled"

Run PowerShell as Administrator and execute:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Path not found errors

  • Use absolute paths: C:\Projects\MyApp
  • Use . for current directory
  • Check for typos and ensure the path exists

Access denied errors

The script will mark inaccessible directories with ❌ and continue scanning.

📝 Examples

Scan current directory with defaults

> .\file_structure_generator.ps1
📁 Path you want generated:
> .

Scan with multiple ignore paths

> .\file_structure_generator.ps1
📁 Path you want generated:
> C:\MyProject
🚫 Paths/Folders to ignore:
> node_modules;.git;dist;coverage

Quick scan using last configuration

> .\file_structure_generator.ps1
📁 Path you want generated:
> [Press Tab]

🤝 Contributing

Feel free to submit issues, fork the repository, and create pull requests for any improvements.

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • 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!

About

Fully-functional Path Structure Generator. Interactive with many settings & QOL updates. watch-and-update working

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published