Multi-language codebase inspection tool for developers and AI coding assistants
Fubber is a command-line tool for browsing and analyzing code using reflection and static analysis. Currently supports PHP with plans for Python, JavaScript, and more.
Fubber aims to be the Swiss Army knife for codebase exploration:
- Multi-language: Currently PHP, with Python, JavaScript, TypeScript, and more planned
- Fast exploration: Query your codebase without opening an IDE
- AI-friendly: Perfect for LLM coding assistants to understand codebases
- Framework-agnostic: Works with any PHP project
- Entity lookup: Explore namespaces, classes, interfaces, traits, enums, methods, properties, constants, and functions
- Pattern search: Find entities by name or signature using substring or regex patterns
- Relationship queries: Find implementations, subclasses, trait users
- Type queries: Find methods accepting or returning specific types
- Attribute queries: Discover PHP 8 attribute usage across your codebase
composer global require fubber/fubberMake sure your Composer global bin directory is in your PATH:
export PATH="$PATH:$HOME/.config/composer/vendor/bin"git clone https://github.com/frodeborli/fubber.git ~/fubbertool
cd ~/fubbertool
composer install
ln -s ~/fubbertool/bin/fubber ~/.local/bin/fubberNavigate to any PHP project directory and run fubber:
cd /path/to/your/project
fubber --helpExplore a namespace:
fubber App\\ModelsView class documentation:
fubber "App\\Models\\User"View method details:
fubber "App\\Models\\User::save"Search for entities:
fubber search Router # Find anything with "Router"
fubber search -i cache # Case-insensitive search
fubber search '\$request' # Find methods with $request parameterFind all implementations of an interface:
fubber implements CacheInterfaceFind all subclasses:
fubber extends RepositoryFind classes using a trait:
fubber uses LoggableTraitFind methods accepting a specific type:
fubber accepts RequestFind methods returning a specific type:
fubber returns ResponseFind all uses of a PHP 8 attribute:
fubber attributes Route
fubber attributes ColumnFubber uses PHP's built-in Reflection API to analyze your codebase:
- Discovers classes via Composer's autoloader metadata
- Uses reflection to extract signatures, types, and documentation
- Presents results in a clean, scannable format
No external dependencies required - if you can run PHP, you can run Fubber.
- Python support:
fubber-pythonusing Python's inspect module - JavaScript/TypeScript:
fubber-jsusing TypeScript compiler API - Full-text search: SQLite FTS5 indexing of docblocks
- Cross-language queries: Find similar patterns across languages
- C binary: Fast dispatcher to delegate to language-specific implementations
For developers:
- Faster than opening an IDE for quick lookups
- Great for exploring unfamiliar codebases
- Works over SSH where GUIs aren't available
For AI coding assistants:
- Efficient way to understand project structure
- More accurate than grep/text search
- Type-aware queries reduce hallucination
Contributions welcome! This is an early-stage project with lots of room for improvement.
MIT License - see LICENSE file for details
Created by Frode Borli
Fubber: The name suggests a tool - like a Swiss Army knife for code inspection.