Skip to main content

DIRAI - Enhanced Directory Structure Analyzer with Security Features for AI Models

Project description

🤖 DIRAI: Your AI-Powered Directory Navigator 🚀

Build Status PyPI version License: MIT

✨ Unveiling the Magic of Your Project's Structure ✨

DIRAI isn't just another directory tool. It's your AI-enhanced companion for exploring, understanding, and documenting the intricate landscape of your projects. With its sleek design and powerful features, DIRAI transforms the mundane task of directory analysis into an insightful and visually engaging experience.

🌈 Feature Spotlight: What Makes DIRAI Shine?

  • 🎨 Profile Perfection: Tailor your analysis with custom profiles, each tuned to specific project types or tasks. Switch effortlessly between configurations for web projects, documentation, security audits, and more!
  • 🔍 Smart Filters: Wield the power of gitignore-style patterns to include or exclude files and directories with surgical precision. Focus on what truly matters.
  • 🎛️ Depth Dynamics: Control the exploration depth to zoom in on critical areas or get a bird's-eye view of your project's architecture.
  • 🔗 Symlink Savvy: Navigate the labyrinth of symbolic links with grace. Choose to follow them or skip them, and let DIRAI handle recursive traps.
  • 📝 Content Chronicles: Peek inside files without leaving your terminal! DIRAI displays file contents with customizable line limits, binary file awareness, and a touch of elegance.
  • 🙈 Secret Sentinel: Safeguard sensitive data with automatic redaction. API keys, tokens, and passwords vanish before your eyes, thanks to configurable patterns and ignore lists.
  • 🤝 Gitignore Guru: Seamlessly integrate with your existing .gitignore files for effortless exclusion management.
  • 💾 Output Oasis: Generate reports in your preferred format, be it plain text for quick scans or Markdown for stunning documentation. Or, pipe the output directly to your console for instant gratification.
  • 💬 Verbose Visionary: Debug with ease using detailed error messages that illuminate the path to resolution.
  • ⚙️ Configuration Charm: Bend DIRAI to your will using a .dirai.yaml file. Define profiles, defaults, and preferences with the elegance of YAML.

🛠️ Installation: Get Started in a Flash

Prerequisites

  • Python 3.7+
  • pip (the trusty Python package installer)

Steps

  1. Clone the Repository:

    git clone https://github.com/salah-alhajj/dirai.git 
    cd dirai
    
  2. Install with pip:

    pip install dirai
    

    Boom! DIRAI is now at your fingertips, ready to serve as a command-line companion.

🎮 Usage: Unleash the Power of DIRAI

Basic Command

dirai [OPTIONS]

Options: Your Control Panel

Option Description Default
-p, --profiles Run multiple profiles sequentially. Use 'all' for a config file profiles all
-d, --directory Specify the target directory .
-o, --output Choose the output file name (profile)
-x, --exclude Apply exclusion patterns (gitignore style!) (profile)
-i, --include Set inclusion patterns (also gitignore style!) (profile)
--max-depth Limit the analysis depth (profile)
--use-gitignore Toggle gitignore usage (true/false) (profile)
--gitignore-paths Add extra gitignore files to the mix (profile)
--show-content Display file contents (with redaction!) (profile)
--follow-symlinks Decide whether to follow symbolic links (profile)
--verbose Get the full story with detailed error messages false

Examples: DIRAI in Action

  1. Quick Scan (Default Profile):

    dirai
    
  2. Web Project Analysis:

    dirai -p web -d /path/to/your/website
    
  3. Targeted Exclusions:

    dirai -x "node_modules/" ".git/"
    
  4. Precision Inclusions:

    dirai -i "*.py" "*.md"
    
  5. Depth Control:

    dirai --max-depth 3
    
  6. Markdown Magic:

    dirai -o beautiful_report.md
    
  7. Content Preview with Security:

    dirai --show-content
    
  8. Symlink Exploration:

    dirai --follow-symlinks
    
  9. Run All Profiles from Config:

    dirai --profiles all
    
  10. Run Selected Profiles:

    dirai --profiles web,security
    

⚙️ Configuration: Your .dirai.yaml Sanctuary

Customize DIRAI's behavior with a .dirai.yaml file. Place it in your project's root, your home directory, or the current working directory.

Default Configuration: The Foundation

default:
  exclude: []
  include: []
  use_gitignore: true
  show_content: true
  show_hidden: false
  output: structure.txt
  max_depth: null
  follow_symlinks: false
  gitignore_paths: []
  max_lines: -1
  include_vcs: false
  ignore_variables: []
  redaction_patterns:
    - api[_-]?key
    - secret[_-]?key
    - token
    - password
    - credentials
    - auth
    - authorization
    - access
    - session
    - cookie
    - bearer
    - api_key
    - api_token
    - api_secret
    - api_password
    - api_username
    - apikey
    - apitoken
    - apisecret
    - apipassword
    - apiusername

Example Configuration: A Glimpse into Customization

default:
  exclude:
    - "node_modules/"
    - ".venv/"
  max_depth: 5
  max_lines: 50

web:
  include:
    - "*.html"
    - "*.css"
    - "*.js"
  exclude:
    - "tests/"
  output: web_wonder.md

docs:
  include:
    - "*.md"
    - "*.rst"
  output: docs_digest.txt

Configuration Hierarchy: The Order of Power

  1. Command-line Arguments: The ultimate authority.
  2. .dirai.yaml Profile Settings: Your custom preferences.
  3. Default Settings: The fallback for anything not specified.

🙌 Contributing: Join the DIRAI Movement

We welcome contributions! Check out CONTRIBUTING.md for guidelines.

📜 License

This project is licensed under the MIT License. See LICENSE for details.

🙏 Acknowledgements

  • Inspired by the venerable tree command.
  • Powered by the pathspec library for gitignore pattern matching.

📞 Contact

For questions, issues, or just to say hi, open an issue on our cozy GitHub repository. Let's make DIRAI even better together! 🌠

Made with ❤️ by developers, for developers.

---

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dirai_tool-0.0.6.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dirai_tool-0.0.6-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file dirai_tool-0.0.6.tar.gz.

File metadata

  • Download URL: dirai_tool-0.0.6.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for dirai_tool-0.0.6.tar.gz
Algorithm Hash digest
SHA256 58d5fe9a5350793bcb65d5c5a9411a6dabc8c6e57feaef3c46680e31f9e20d35
MD5 04e4609faf9327cd04edeb79882322a0
BLAKE2b-256 f8d15c81fbe4097430f364521dca70b4fca78236761f08a8e73280da87535b83

See more details on using hashes here.

File details

Details for the file dirai_tool-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: dirai_tool-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for dirai_tool-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e5a1f379f6b46ffa5a4a42cd071fc15357581a89db88764156eb054d9059df97
MD5 6e94a267f07093a6d0fef41af62468e2
BLAKE2b-256 da2b4af02bd949322d9d82cc0388854d21c291b1c575d8850f3512f5e393c0d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page