Skip to content

frodeborli/fubbertool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fubber

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.

Vision

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

Current Features (PHP)

  • 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

Installation

Via Composer (recommended)

composer global require fubber/fubber

Make sure your Composer global bin directory is in your PATH:

export PATH="$PATH:$HOME/.config/composer/vendor/bin"

From source

git clone https://github.com/frodeborli/fubber.git ~/fubbertool
cd ~/fubbertool
composer install
ln -s ~/fubbertool/bin/fubber ~/.local/bin/fubber

Usage

Navigate to any PHP project directory and run fubber:

cd /path/to/your/project
fubber --help

Basic Examples

Explore a namespace:

fubber App\\Models

View 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 parameter

Relationship Queries

Find all implementations of an interface:

fubber implements CacheInterface

Find all subclasses:

fubber extends Repository

Find classes using a trait:

fubber uses LoggableTrait

Type-based Queries

Find methods accepting a specific type:

fubber accepts Request

Find methods returning a specific type:

fubber returns Response

Attribute Queries

Find all uses of a PHP 8 attribute:

fubber attributes Route
fubber attributes Column

How It Works

Fubber uses PHP's built-in Reflection API to analyze your codebase:

  1. Discovers classes via Composer's autoloader metadata
  2. Uses reflection to extract signatures, types, and documentation
  3. Presents results in a clean, scannable format

No external dependencies required - if you can run PHP, you can run Fubber.

Future Plans

  • Python support: fubber-python using Python's inspect module
  • JavaScript/TypeScript: fubber-js using 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

Why Fubber?

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

Contributing

Contributions welcome! This is an early-stage project with lots of room for improvement.

License

MIT License - see LICENSE file for details

Author

Created by Frode Borli


Fubber: The name suggests a tool - like a Swiss Army knife for code inspection.

About

A tool for inspecting the codebase for AI assistants such as codex and claude code

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages