A powerful CLI tool to discover shell commands using natural language
When you can't remember a command, you think "What's The Function I need?" - that's WTF! π
π Advanced Natural Language Search - Find commands by describing what you want to do in plain English
π§ Intent Detection - Understands your intent (create, search, compress, install, etc.) for better results
π Massive Command Database - 3,268+ commands sourced from TLDR pages and community contributions
π― Context-Aware Suggestions - Smart recommendations based on your current directory and project type
β‘ Fuzzy Search & Typo Tolerance - Finds commands even with spelling mistakes
π₯οΈ Platform Filtering - Filter commands by platform (Linux, macOS, Windows, cross-platform)
π Search History & Analytics - Tracks your searches to improve recommendations
π Personal Command Notebook - Save and organize your custom commands
π― Interactive Command Builder - Step-by-step wizards for complex commands
π Pipeline Search - Specialized search for multi-command workflows
β‘ Lightning Fast - ~200ms search performance with advanced scoring and caching
οΏ½ Cross-Platform - Works on Windows, macOS, and Linux
π¨ Beautiful Output - Clean results with relevance scores; list/table/json formats; optional colors
π§© Scriptable Output - JSON output for easy integration with other tools
# Download from releases page (coming soon)
# Extract and run: ./wtf "your query"git clone https://github.com/Vedant9500/WTF.git
cd WTF
# On Windows
build.bat build
# On Linux/Mac (with make)
make build
# Alternative (any platform)
go build -o wtf ./cmd/wtf# Search for commands
wtf "compress files"
wtf "find large files"
wtf "git commit changes"
# Set up your preferred command name
wtf setup hey
hey "docker commands"
# Alternate output formats
wtf search --format table "docker build"
wtf search --format json "git status"
# Disable color (flag or env)
wtf --no-color "compress files"
# or set NO_COLOR=1WTF leverages excellent community-driven projects as its command database sources:
Primary Sources:
- TLDR Pages - Simplified, example-focused help pages for command-line tools
- Cheat/Cheatsheets - Community-maintained cheatsheets for various tools and technologies
Database Features:
- 3,845+ Commands: Comprehensive coverage of common CLI tools
- Community Curated: Maintained by developers worldwide
- Example-Focused: Practical usage patterns, not just syntax
- Always Updated: Fresh content from both communities
- Multi-Source: Best commands from multiple trusted sources
# Natural language search with advanced NLP
wtf "compress files" # Finds tar, zip, gzip commands
wtf "create directory" # Prioritizes mkdir over other tools
wtf "download file" # Returns wget, curl commands
wtf "git commands" # Git-specific operations
# Advanced search options
wtf search "docker" --limit 10 # More results
wtf search "process" --verbose # Show relevance scores and NLP analysis
wtf search "commands" --database custom.yml # Custom database
# Platform-specific searches
wtf "list files" --platform linux # Linux-specific commands + cross-platform
wtf "compress files" --platform windows,macos # Multiple platforms
wtf "process management" --all-platforms # Override filtering, show all
wtf "system tools" --platform linux --no-cross-platform # Linux only
# Fuzzy search handles typos
wtf "comprss files" # Still finds compression commands
wtf "mkdir direectory" # Still finds directory commands
wtf "gti comit changez" # Finds git commit commandsWTF uses a universal BM25F-based inverted index for fast, scalable search across:
- Command text (highest weight)
- Keywords and tags
- Descriptions
NLP enhances long or fuzzy queries:
- Intent/actions/targets (e.g., create/delete/view + file/folder) boost relevant commands
- TopβIDF term selection trims long queries to the most informative words
- Optional semantic reranking uses TFβIDF cosine similarity to refine top results
You can tune behavior via search options (limit, NLP on/off, topβterms cap).
WTF now includes sophisticated NLP features for better command understanding:
Intent Detection:
createβ Prioritizes mkdir, touch, make commandscompressβ Focuses on tar, zip, gzip toolssearchβ Emphasizes grep, find, locate commandsdownloadβ Highlights wget, curl, fetch toolsinstallβ Boosts package managers (apt, pip, npm)
Query Processing:
- Action Recognition: Identifies verbs like "compress", "extract", "download"
- Target Detection: Recognizes objects like "file", "directory", "package"
- Synonym Expansion: "folder" β "directory", "get" β "download"
- Stop Word Removal: Filters out "the", "and", "with" for cleaner matching
Example NLP in action:
wtf "I want to compress some files into an archive"
# Detects: Intent=compress, Action=compress, Target=files
# Returns: tar, zip, gzip commands with high relevance scores
wtf "help me create a new directory please"
# Detects: Intent=create, Action=create, Target=directory
# Returns: mkdir commands prioritized over other creation tools
WTF automatically detects your environment and prioritizes relevant commands:
# In a Git repository
wtf "commit" # Prioritizes git commands
# Directory with Dockerfile
wtf "build" # Prioritizes docker commands
# Directory with package.json
wtf "install" # Prioritizes npm commands
# Directory with Makefile
wtf "build" # Prioritizes make commands
# Python project (requirements.txt, .py files)
wtf "install" # Prioritizes pip commandsContext Detection Features:
- 15+ Project Types: Git, Docker, Node.js, Python, Go, Rust, Java, and more
- File Pattern Recognition: Detects project files like package.json, Dockerfile, go.mod
- Smart Boosts: Gives relevant commands higher priority scores
- Multi-Context Support: Handles projects with multiple technologies
WTF now supports filtering commands by platform, perfect for developers working across multiple operating systems:
# Filter by specific platform
wtf "list files" --platform linux
wtf "compress files" --platform windows
wtf "process management" --platform macos
# Multiple platforms
wtf "text processing" --platform linux,macos
wtf "network tools" --platform windows,linux
# Cross-platform behavior
wtf "git commands" --platform linux # Linux + cross-platform commands
wtf "docker tools" --platform linux --no-cross-platform # Linux only
wtf "system tools" --all-platforms # All platforms (override filtering)
# Verbose output shows platform filtering
wtf "compression" --platform linux --verbose
# Platform filter: [linux] + cross-platform
# Shows which platforms are being searchedPlatform Filtering Features:
- Supported Platforms:
linux,macos,windows,cross-platform - Smart Defaults: Cross-platform commands included by default
- Multiple Selection: Comma-separated platform lists
- Override Options:
--all-platformsto disable filtering entirely - Exclusion Control:
--no-cross-platformto exclude cross-platform commands - Performance: Platform filtering with full caching support
Use Cases:
- Learning: Discover Linux commands while on Windows
- Documentation: Find platform-specific alternatives
- Migration: Compare commands across different systems
- Development: Work with multi-platform deployment scripts
Build complex commands step-by-step with interactive wizards:
# Interactive tar archive builder
wtf wizard tar
β What do you want to do? [c]reate/e[x]tract: c
β Archive name: backup.tar.gz
β Files to archive: /home/user/documents
β Result: tar -czf backup.tar.gz /home/user/documents
# Interactive find command builder
wtf wizard find
β Starting directory: .
β File name pattern: *.log
β Result: find . -name "*.log"
# Interactive ffmpeg converter
wtf wizard ffmpeg
β Input file: video.mp4
β Output format: mp3
β Result: ffmpeg -i video.mp4 output.mp3Find and visualize multi-step command workflows:
wtf pipeline "text processing"
wtf pipeline "log analysis"
wtf pipeline "find and replace"
# Example output:
π Found pipeline command:
find . -name "*.txt" β xargs grep "error" β head -10
π find text files and show first 10 errors
π Pipeline steps:
1. find . -name "*.txt"
2. xargs grep "error"
3. head -10WTF tracks your search patterns to provide better recommendations:
# View search history
wtf history
# Recent searches:
# 1. "compress files" β tar -czf (3 times today)
# 2. "git commit" β git commit -m (2 times today)
# 3. "docker build" β docker build . (1 time today)
# Search analytics
wtf history --stats
# π Search Statistics:
# Total searches: 47
# Most searched: "git commands" (8 times)
# Success rate: 94% (commands found vs not found)
# Average results per search: 4.2History Benefits:
- Personalized Results: Frequently used commands get slight priority boosts
- Usage Patterns: Understand your command habits
- Success Tracking: See which searches work best
- Auto-Cleanup: Old history automatically managed
Save and organize your custom commands:
# Save a regular command
wtf save
β Command: docker ps -a --format "table {{.Names}}\t{{.Status}}"
β Description: Show docker containers with custom format
β Keywords: docker, containers, format
β Saved to personal notebook!
# Save a pipeline workflow
wtf save-pipeline
β Command: find . -name "*.log" | grep -v "debug" | tail -20
β Description: Get recent non-debug log entries
β Keywords: logs, debug, recent
β Saved to personal notebook!
# Your commands appear in all searches
wtf "docker containers" # Shows both official and your custom commandsWTF provides clean, formatted output with advanced relevance scoring:
π Searching for: compress files
π Found 5 matching command(s):
1. tar -czf archive.tar.gz folder/
π compress a folder into a tar.gz archive
π Category: compression
π·οΈ Keywords: tar, compress, archive
π Relevance Score: 127.3
2. zip -r archive.zip folder/
π compress folder into a zip file
π Category: compression
π·οΈ Keywords: zip, compress, archive
π Relevance Score: 98.7
3. gzip file.txt
π compress a single file with gzip
π Category: compression
π·οΈ Keywords: gzip, compress, file
π Relevance Score: 85.2
Verbose Mode shows NLP analysis:
wtf search "compress files" --verbose
π§ NLP Analysis:
Intent: compress
Actions: [compress]
Targets: [files]
Enhanced Keywords: [compress, archive, files, tar, zip]
π Scoring Details:
Command Match: +15.0 (exact match bonus)
Domain Specific: +12.0 (compression domain)
Intent Boost: Γ2.5 (compression intent)
Category Boost: Γ1.5 (compression category)
Platform Filter: [all platforms]Platform Filtering in Verbose Mode:
wtf "system tools" --platform linux --verbose
π₯οΈ Platform Analysis:
Filter: [linux] + cross-platform
Excluded: windows, macos (platform-specific)
Included: 1,247 commands (38% of database)
π Results by Platform:
Linux-specific: 3 commands
Cross-platform: 2 commandsWTF supports multiple output formats and color controls to fit your workflow:
- Formats:
list(default): readable list with fieldstable: compact columns for quick scanningjson: machine-readable for scripting and pipelines
- Color:
- Enabled by default in list/table
- Disable with
--no-coloror by setting theNO_COLORenvironment variable
Examples:
# List (default)
wtf "compress files"
# Table
wtf search --format table "git commit"
# JSON (verbose adds keywords/platforms/score fields)
wtf search --format json --verbose "docker build"
# No color
wtf --no-color "find files by name"Set up WTF with any command name you prefer:
# One-command setup (creates alias/script automatically)
wtf setup hey # Creates 'hey' command
wtf setup miko # Creates 'miko' command
wtf setup cmd # Creates 'cmd' command
# Manual setup options:
# Windows (PowerShell)
Set-Alias hey wtf
# Windows (CMD)
doskey hey=wtf.exe $*
# Linux/Mac
alias hey='wtf'
echo "alias hey='wtf'" >> ~/.bashrcWTF comes with 3,845+ curated commands sourced from TLDR pages and supports custom databases:
# Use custom database
wtf --database /path/to/custom.yml
# Database locations:
# Default: assets/commands.yml (3,845+ commands from TLDR)
# Personal: ~/.config/wtf/personal.yml (auto-created)
# Custom: any YAML file following the schema
# Database stats
wtf stats
# π Database Statistics:
# Total commands: 3,845
# Categories: 12 (compression, system, networking, etc.)
# Platforms: Linux, macOS, Windows
# Average keywords per command: 4.2# Clone repository
git clone https://github.com/Vedant9500/WTF.git
cd WTF
# Install dependencies
go mod tidy
# Build for current platform
go build -o wtf ./cmd/wtf
# Or use build scripts:
# Windows
build.bat build
# Linux/Mac (with make)
make build# Build for all platforms
build.bat build-all # Windows
make build-all # Linux/Mac
# Creates binaries for:
# - Linux (amd64, arm64)
# - macOS (amd64, arm64)
# - Windows (amd64)# Run tests
go test ./...
# With coverage
build.bat test # Windows
make test-coverage # Linux/Mac (generates coverage.html)
# Run benchmarks
make benchmarkWTF is optimized for speed with advanced algorithms:
- Search Performance: ~200ms average response time (optimized for accuracy)
- NLP Processing: < 50ms for intent detection and query analysis
- Database Size: 3,268+ commands, ~2.8MB total
- Memory Usage: < 20MB RAM (includes enhanced search algorithms)
- Binary Size: < 25MB (statically linked with all features)
- Cold Start: < 150ms first run
- Fuzzy Search: Advanced typo correction with Levenshtein distance
- Platform Filtering: Instant filtering with full caching support
Optimization Features:
- Hybrid Search Algorithm: Combines exact, fuzzy, and semantic matching
- Smart Scoring: Multi-factor relevance calculation with domain-specific boosts
- Efficient NLP: Lightweight intent detection without external dependencies
- Memory Management: Smart caching and cleanup for long-running sessions
- 3,268+ curated commands from TLDR Pages and community contributions
- Categories: compression, system, networking, development, version-control, text-processing, and more
- Multi-Platform: Commands for Linux, macOS, Windows, and cross-platform tools
- Platform Filtering: Advanced filtering by platform with smart cross-platform handling
- Enhanced Coverage: Essential commands like
cal,wc,uniq,tr,yqincluded - Regular updates with new commands and improvements
- Community Driven: Maintained by multiple open-source communities worldwide
- Location:
~/.config/wtf/personal.yml - Auto-created when you save first command
- Merged with main database in search results
- Full CRUD operations via CLI
- Search Integration: Personal commands appear in all searches with proper scoring
- Intent-Aware Scoring: Commands scored based on detected user intent
- Domain-Specific Matching: Special relevance for command categories
- Fuzzy Matching: Handles typos and partial matches
- Context Boosting: Project-aware command prioritization
commands:
- command: "docker ps -a"
description: "list all docker containers"
keywords: ["docker", "containers", "ps"]
category: "development"
pipeline: falseWe welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Test thoroughly:
make test - Commit with clear messages:
git commit -m "Add amazing feature" - Push to your branch:
git push origin feature/amazing-feature - Open a Pull Request
- ποΈ Database: Add more commands and categories
- π Localization: Support for multiple languages
- π¨ Themes: Custom color schemes and output formats
- π Integrations: IDE plugins, shell integrations
- π± Platforms: Mobile apps, web interface
- TLDR Pages - Primary command database source (3,845+ commands)
- Cheat/Cheatsheets - Additional curated command examples and usage patterns
- Cobra - Excellent CLI framework
- Go Community - Amazing ecosystem and tools