Skip to content

Directory structure generator with LLM context support

License

Notifications You must be signed in to change notification settings

fyzanshaik/dirgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌳 dirgo - Smart Directory Trees for LLMs & Devs

A lightning-fast directory structure generator with LLM context support, code analysis, and dependency tracking.

πŸš€ Quick Start

# Install globally
npm install -g dirgo

# Or run directly
npx dirgo

✨ Features

πŸ“ Quick Structure Generation

# Basic tree with emojis
dirgo

# Without emojis (new!)
dirgo -n

# Include file stats
dirgo -s

# Save to file
dirgo -o file -f project.txt

πŸ€– LLM Context Generation

Perfect for providing context to ChatGPT or other LLMs:

# Generate LLM-optimized context
dirgo --llm-context

# Without emojis (new!)
dirgo -n --llm-context

# With stats and clipboard copy
dirgo --llm-context -s -c

Output includes:
- Project type detection (Node.js, Python, Go)
- Directory structure
- Comprehensive dependency analysis
  - Direct and indirect Go dependencies
  - Python package requirements
  - Node.js dependencies

🎯 Smart Features

  • Go module analysis with direct/indirect dependencies
  • Python dependencies from requirements.txt and pyproject.toml
  • Node.js package.json analysis
  • File statistics and size information
  • Copy to clipboard support
  • Custom ignore patterns
  • Interactive mode

πŸ› οΈ Command Options

Basic Commands

dirgo              # Basic tree with emojis
dirgo -n           # Without emojis
dirgo -s           # Include statistics
dirgo -d ./path    # Specific directory
dirgo -c           # Copy to clipboard

LLM Context

dirgo --llm-context          # Full project context
dirgo --llm-context -s       # With file statistics
dirgo --llm-context -n -c    # No emojis, copy to clipboard

Output Options

dirgo -o file                # Save to file
dirgo -o both                # Console & file
dirgo -f custom-name.txt     # Custom filename

Customization

dirgo -n                     # No emojis (shorthand)
dirgo --no-emoji            # No emojis (long form)
dirgo --include-all         # Include node_modules
dirgo --ignore "dist,build" # Custom ignore patterns

🎨 Interactive Mode

Run with -i for an interactive menu:

dirgo -i

Provides options for:
βœ“ Quick structure generation
βœ“ LLM context generation
βœ“ Output customization
βœ“ File statistics
βœ“ Copy to clipboard

πŸ’‘ Use Cases

1. LLM Context

dirgo --llm-context -c
# Perfect for:
- Sharing project context with ChatGPT
- Getting AI assistance
- Project documentation

2. Project Documentation

dirgo -s -o file -f docs.md
# Great for:
- Project overviews
- Documentation
- Team onboarding

3. Quick Analysis

dirgo -s
# Shows:
- File counts
- Directory sizes
- Project structure

4. Dependency Analysis

dirgo --llm-context
# Shows:
- Go dependencies (direct/indirect)
- Python package requirements
- Node.js dependencies

🌟 Why dirgo?

For Developers

  • Quick project visualization
  • Easy documentation generation
  • Multiple output formats
  • Language-aware dependency analysis

For LLM Users

  • Optimized context generation
  • Smart project analysis
  • Comprehensive dependency tracking
  • Code relationship mapping

For Teams

  • Consistent project documentation
  • Easy project sharing
  • Quick project insights
  • Time-saving automation

πŸ“¦ Installation

Global Installation

npm install -g dirgo

One-time Use

npx dirgo

πŸ“ Version History

v1.0.7 (Current Stable)

βœ… Recommended version for full functionality

  • Fixed clipboard output formatting (no more ANSI color codes)
  • Added -n shorthand for --no-emoji
  • Enhanced Go dependency analysis (direct/indirect dependencies)
  • Fixed emoji display in LLM context
  • Memory optimization
  • Fixed project structure display
  • Added default clipboard copying

v1.0.4

⚠️ Had following issues:

  • Didn't have npm package due to my skill issue

v1.0.2

⚠️ Had following issues:

  • Clipboard copied ANSI color codes
  • Memory leaks in directory traversal
  • Emoji display issues in LLM context
  • Fixed recursive structure generation
  • Added better error handling

v1.0.1

❌ Not recommended due to:

  • Node module resolution issues
  • Hidden files being generated
  • Memory issues with large directories
  • CLI execution problems
  • Dependency tracking bugs

v1.0.0 (Initial Release)

❌ Initial test release with:

  • Basic directory structure generation
  • Simple dependency analysis
  • Known issues with module imports
  • Installation and execution problems

πŸ’‘ Installation Guide

For the best experience, install version 1.0.3:

# Install specific version globally
npm install -g dirgo@1.0.3

# Or run with npx
npx dirgo@1.0.3

🀝 Contributing

Contributions welcome! Feel free to:

  • Open issues
  • Submit PRs
  • Suggest features
  • Improve documentation

πŸ“„ License

MIT - feel free to use in your projects!

πŸ”— Links

About

Directory structure generator with LLM context support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published