Skip to content

tobiashochguertel/explainshell

Β 
Β 

Repository files navigation

πŸš€ explainshell - Community Integration Fork

Python 3.12 Compatible | Modern Dependencies | Security Fixes | Dark Mode Support

This is a community-maintained fork of idank/explainshell that integrates valuable open pull requests into a working, tested Python 3.12-compatible version.

Original Project Python 3.12 Flask 3.0 License: GPL v3


πŸ†• What's New in This Fork

This fork integrates 6 valuable community pull requests from the original repository: This fork integrates 6 valuable community pull requests from the original repository:

Feature Status PR Contributor
🐍 Python 3.12 Migration βœ… #330 @mundanevision20
πŸ”§ pymongo 4.x Compatibility βœ… #323 @cben
πŸŒ™ Dark Mode Support βœ… #237 @rugk
🎨 Search Box Fix βœ… #248 @apoorvlathey
πŸ“š Better Examples βœ… #293 @Strahinja
πŸ“– Ubuntu Noble Manpages βœ… #232 @wesinator

See COMMUNITY_INTEGRATION.md for detailed information.

⚠️ Manpages Status

Important

explainshell is actively maintained in terms of keeping it healthy and functional -- issues are addressed, and the core remains stable.

However, please note that the manpages are outdated. The previous system for generating them was unsustainable, and they haven't been updated in some time. There are currently no active plans to revise this mechanism.

If you're relying on manpages, be aware that they may not reflect the latest behavior. Contributions in this area are welcome but would require rethinking the documentation pipeline.


πŸ“‹ Table of Contents


πŸ€” About explainshell

explainshell.com is a tool capable of parsing man pages, extracting options and explaining a given command-line by matching each argument to the relevant help text in the man page.

How It Works

explainshell is built from these components:

  1. Man page reader - Converts man pages from raw format to HTML
  2. Classifier - Identifies paragraphs containing options
  3. Options extractor - Scans and extracts options from classified paragraphs
  4. Storage backend - Saves processed man pages to MongoDB
  5. Matcher - Walks the command's AST (parsed by bashlex) and matches nodes to help text

When you query explainshell:

  1. Parses your command into an AST
  2. Visits interesting nodes (commands, shell operators like |, &&)
  3. Matches each token to known options and help text
  4. Returns formatted matches via Flask web interface

🎯 Why This Fork?

The original explainshell is an amazing tool, but it's been stuck on Python 2.7 (end-of-life since 2020) with several valuable community contributions waiting for review.

The Problem

$ docker compose build
# ❌ Error: Debian Buster repositories not found
# ❌ Error: Python 2.7 packages unavailable
# ❌ Security vulnerabilities in old dependencies

The Solution

This fork:

  • βœ… Works with modern Docker images
  • βœ… Fixes security vulnerabilities
  • βœ… Integrates tested community improvements
  • βœ… Provides Python 3.12 compatibility
  • βœ… Maintains backward compatibility for users

πŸ”₯ Key Improvements

Security Enhancements

Component Before After Benefit
Python 2.7 (EOL) 3.12 Modern security patches
Flask 0.12 3.0.3 CVE-2023-30861 fixed
nltk 3.4.5 3.9.1 ReDoS vulnerabilities fixed
pymongo 3.13.0 4.8.0 Modern MongoDB support

User Experience

  • πŸŒ™ Auto Dark Mode: Respects system preferences
  • 🎨 Fixed UI: No more search box overlap
  • πŸ“š Modern Examples: Uses current best practices, not deprecated syntax
  • πŸ“– Latest Docs: Ubuntu 24.04 LTS (noble) man pages

Developer Experience

  • 🐍 Python 3.12: Modern syntax and features
  • πŸ“ Better Logging: Enhanced with loguru
  • 🐳 Docker Support: Works with current images
  • πŸ”§ Type Hints: Improved code quality

πŸš€ Quick Start

Option 1: Docker (Recommended)

# Clone this fork
git clone https://github.com/tobiashochguertel/explainshell.git
cd explainshell

# Start the application
docker compose up --build

Visit http://localhost:5000 πŸŽ‰

Option 2: Local Python

# Clone and install
git clone https://github.com/tobiashochguertel/explainshell.git
cd explainshell
pip install -r requirements.txt

# Run the application
python3 runserver.py

Option 3: With Man Pages Database

# Download man pages database
curl -L -o /tmp/dump.gz https://github.com/idank/explainshell/releases/download/db-dump/dump.gz

# Clone and start
git clone https://github.com/tobiashochguertel/explainshell.git
cd explainshell
docker compose up --build

πŸ“š Documentation

Updated Dependencies

Flask==3.0.3        # was 0.12
nltk==3.9.1         # was 3.4.5
pymongo==4.8.0      # was 3.13.0
bashlex==0.18       # was 0.12
loguru==0.7.2       # new
nose==1.3.7         # same

🀝 Contributing

We welcome contributions! This fork aims to:

  1. Maintain compatibility with the original project
  2. Integrate valuable community contributions
  3. Provide a working version for users needing Python 3

How to Contribute

  1. Fork this repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ™ Credits

Original Project

Massive thanks to @idank for creating this incredible tool!

Community Contributors

This fork wouldn't exist without these amazing contributors:

Fork Maintainer

Tobias HochgΓΌrtel (@tobiashochguertel)


πŸ“œ License

GPL-3.0 License (same as the original project)

Copyright (C) 2024 Tobias HochgΓΌrtel Copyright (C) 2013-2024 Idan Kamara

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.


πŸ”— Links


⚠️ Note to Users

This fork exists to:

  1. Help the community use explainshell on modern infrastructure
  2. Demonstrate that community PRs work and are valuable
  3. Provide an interim solution while the original project is updated

We encourage you to support the original project!

If the original maintainer merges these PRs, this fork may become unnecessary (which would be great! πŸŽ‰)


Made with ❀️ by the open source community

⭐ Star this repo | πŸ› Report Bug | πŸ’‘ Request Feature

About

match command-line arguments to their help text

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Python 58.8%
  • JavaScript 29.6%
  • HTML 7.9%
  • Perl 2.0%
  • CSS 1.2%
  • Shell 0.4%
  • Other 0.1%