Skip to main content

What The F*** Can I Run? - Fast command launcher

Project description

WTF - What The F*** Can I Run?

A blazing-fast terminal launcher with built-in documentation - discover, understand, and run your installed tools

GitHub release License: MIT

The Problem

You've installed 200+ tools via Homebrew, npm, cargo, pip, and who knows what else. You remember maybe 5 of them. The rest? Lost in the void of /opt/homebrew/bin, ~/.cargo/bin, /usr/local/bin...

The Solution

wtf - A smart command launcher that:

  • ๐Ÿ“– Shows instant help - See tldr/man pages in the preview pane WITHOUT running commands
  • ๐Ÿ” Discovers all your installed tools automatically
  • ๐Ÿš€ Launches them with fuzzy search
  • ๐Ÿ“Š Learns what you use most (frecency)
  • ๐Ÿš Works with any shell (Fish, Zsh, Bash)
  • โšก Lightning fast (pure Python, no shell loops)

Quick Install

Prerequisites

# Required
brew install fzf          # Fuzzy finder (required)
brew install python@3.12  # Python 3.12+

# Optional but recommended
brew install tealdeer     # Better command documentation (tldr pages)

Note: There's an existing wtf command (acronym translator) in Homebrew. If you have conflicts, you can:

  • Use an alias: alias wtfl='path/to/wtf' (wtf launcher)
  • Install via pipx/uv which isolates the command: pipx install wtf-launcher
  • Or rename the Homebrew one: brew unlink wtf

Install with uv (recommended)

# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone and install
git clone https://github.com/adriangalilea/wtf
cd wtf
uv tool install -e .

# Ensure ~/.local/bin is in your PATH
# Fish users: fish_add_path $HOME/.local/bin
# Bash/Zsh users: export PATH="$HOME/.local/bin:$PATH"

Shell Integration

The wtf command needs shell integration to properly insert commands into your prompt (instead of just printing them).

Fish

# Add to ~/.config/fish/config.fish
function wtf --description "What the f*** can I run?"
    command wtf | read -l cmd
    and commandline -r $cmd
end

bind \ew 'wtf'  # Option+W to launch

Or run this to see the code:

wtf init fish

Zsh/Bash

# Add to ~/.zshrc or ~/.bashrc
eval "$(wtf init zsh)"  # Or use 'wtf init bash' for Bash

This will:

  • Create a shell function that captures wtf's output
  • Insert the selected command into your prompt (not execute it)
  • Set up Option+W (or Alt+W) keybinding for quick access

Without shell integration, wtf will just print the command path, which isn't very useful.

Usage

wtf                      # Show only user-installed commands (default)
wtf --all/-a            # Show ALL commands including system utilities
wtf config              # Edit configuration file
wtf --list/-l           # List all commands to stdout (for piping)
wtf --list --all        # List all commands including system
wtf init <shell>        # Generate shell integration code

Built-in Help Preview ๐Ÿ“–

WTF shows you instant documentation for any command without running it! As you navigate through commands, the preview pane displays:

  • tldr pages - Concise examples and explanations (if tealdeer is installed)
  • man pages - Traditional documentation
  • --help output - When other docs aren't available

This means you can quickly understand what a command does before using it. No more accidentally running dangerous commands or forgetting what that cryptic tool name means!

Keyboard Shortcuts

  • Alt+W / Option+W - Quick launch
  • โ†‘โ†“ - Navigate options
  • Enter - Insert selected command into prompt
  • Ctrl+/ - Toggle preview pane (shows tldr/man/help)
  • Esc - Cancel

System vs User Commands

By default, wtf filters out pre-installed system commands to focus on what YOU installed. System paths that are excluded:

  • /bin/* - Core system utilities (cat, ls, cp, etc.)
  • /sbin/* - System administration commands
  • /usr/bin/* - User utilities (git, ssh, etc.)
  • /usr/sbin/* - User admin utilities
  • /System/* - macOS system files

Use wtf --all to see everything including system commands.

Configuration

WTF uses a JSON configuration file at ~/.config/wtf/config.json. Edit it with:

wtf config

Configuration options:

{
  "system_paths": [
    "/bin/",
    "/sbin/",
    "/usr/bin/",
    "/usr/sbin/",
    "/System/"
  ],
  "extra_search_paths": [
    "/opt/homebrew/bin",
    "/usr/local/bin",
    "~/.cargo/bin",
    "~/.local/bin"
  ],
  "categories": {
    "git": ["git", "tig", "gh"],
    "editors": ["vim", "nvim", "hx", "code"]
  },
  "dangerous_commands": ["rm", "dd", "mkfs"],
  "excluded_commands": ["pip-*", "*-config", "git-receive-pack"],
  "show_paths": true,
  "preview_enabled": true
}
  • system_paths: Paths to exclude when not using --all
  • extra_search_paths: Additional paths to search for commands
  • categories: Custom categorization rules
  • dangerous_commands: Commands to never execute in preview
  • excluded_commands: Commands to always hide (supports wildcards)
  • show_paths: Show paths in the command list
  • preview_enabled: Enable preview pane by default

Features

Current (v0.1)

  • โœ… Rich previews - Shows tldr pages, man pages, or help text WITHOUT executing
  • โœ… Discovers commands from multiple sources (PATH, Homebrew, npm, cargo, etc.)
  • โœ… Fuzzy search with fzf integration (searches command names only, not paths)
  • โœ… Smart categorization (Git, Editors, Package managers, etc.)
  • โœ… Shell-agnostic Python core (Fish, Zsh, Bash support)
  • โœ… Frecency tracking - Your most-used commands bubble to the top
  • โœ… Pydantic-based config file - Fully customizable
  • โœ… System command filtering - Focus on YOUR tools by default
  • โœ… Automatic deduplication - No duplicate entries for CLI/App versions
  • โœ… Excludes junk commands - Hides build tools, internals, and noise

Planned (v1.0)

  • ๐Ÿ“ Custom aliases - Add descriptions to cryptic commands
  • ๐ŸŽจ Themes - Because developers like pretty things
  • ๐Ÿ”Œ Plugin system - Add custom command sources

Future (v2.0+)

  • ๐Ÿ” Help-based search - Fuzzy search command descriptions, not just names
  • ๐Ÿค– AI command suggestions based on context
  • ๐ŸŒ Command sharing/sync across machines
  • ๐Ÿ“Š Usage analytics and insights

Architecture

wtf/
โ”œโ”€โ”€ wtf.py               # Main launcher (Carmack style - flat and direct)
โ”œโ”€โ”€ wtf_config.py        # Pydantic configuration
โ”œโ”€โ”€ wtf_preview.sh       # Preview script for fzf
โ”œโ”€โ”€ pyproject.toml       # Modern Python packaging with uv
โ””โ”€โ”€ README.md

Simple, flat structure. No over-engineering.

What We Built

  • โœ… Fast Discovery - Finds all your commands from PATH, Homebrew, npm, cargo, etc.
  • โœ… Smart Filtering - Separates YOUR tools from system commands
  • โœ… Rich Previews - Shows tldr/man pages without executing commands
  • โœ… Frecency Tracking - Most-used commands rise to the top
  • โœ… Full Configuration - Pydantic-based config with validation
  • โœ… Multi-shell Support - Works with Fish, Zsh, and Bash
  • โœ… Safe Preview - Never executes dangerous commands
  • โœ… Clean Architecture - Single file, no dependencies except Pydantic

Contributing

This project is in early development. Ideas, bug reports, and PRs welcome!

Development Setup

git clone https://github.com/adriangalilea/wtf
cd wtf
uv venv
source .venv/bin/activate
uv pip install -e .

Why Python?

  • Portability: Works everywhere, no compilation needed
  • Speed: Fast enough for this use case (launching is instant)
  • Ecosystem: Rich libraries for shell integration, caching, etc.
  • Iteration: Much faster to develop and maintain than Rust/Go
  • Distribution: Easy via pip, pipx, uv, conda, homebrew

License

MIT - Do whatever the f*** you want with it.


Built with โค๏ธ and frustration by developers who can't remember what they installed

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

wtf_launcher-0.1.1.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

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

wtf_launcher-0.1.1-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file wtf_launcher-0.1.1.tar.gz.

File metadata

  • Download URL: wtf_launcher-0.1.1.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for wtf_launcher-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5f88b08b17a70c7d7a8b390ee6a75812d6a111b859c36030017775dd3625bdfb
MD5 d9405dce013230b62987fa16fb2688b4
BLAKE2b-256 d35940b46f5558c4d39eb55ac0f1abc84db3004619378e602bed51eeb6397208

See more details on using hashes here.

Provenance

The following attestation bundles were made for wtf_launcher-0.1.1.tar.gz:

Publisher: release.yml on adriangalilea/wtf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wtf_launcher-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: wtf_launcher-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for wtf_launcher-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d256634280d3c78bd96d45518b2d8ef527220aec21094fecc4469e96419a0a1f
MD5 9949e68df4a7c3481263e99943e07e9a
BLAKE2b-256 0eb6be809a92ded316d321aa422c91953c8e75f6f88d223f426ef51be1f4e793

See more details on using hashes here.

Provenance

The following attestation bundles were made for wtf_launcher-0.1.1-py3-none-any.whl:

Publisher: release.yml on adriangalilea/wtf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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