Skip to content

Instantly share code, notes, and snippets.

@asciidiego
Created May 6, 2023 23:32
Show Gist options
  • Save asciidiego/9b9809897e3cb1dac123178eedc57be7 to your computer and use it in GitHub Desktop.
Save asciidiego/9b9809897e3cb1dac123178eedc57be7 to your computer and use it in GitHub Desktop.
#!/opt/homebrew/bin/python3
import sys
import urllib.parse
import subprocess
if len(sys.argv) < 2:
print("Usage: python explainshell.py [shell command as string here]")
sys.exit(1)
command = ' '.join(sys.argv[1:])
url = f"https://explainshell.com/explain?cmd={urllib.parse.quote(command)}"
subprocess.run(['open', url])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment