rcpassos/artisanfuzzy 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rcpassos/artisanfuzzy

最新稳定版本:v1.0.0

Composer 安装命令:

composer require rcpassos/artisanfuzzy

包简介

A zero-dependency, pure-PHP fuzzy search interface for Laravel's Artisan CLI. Instantly find routes, commands, and configs — no fzf required.

README 文档

README

🔍 A zero-dependency, pure-PHP fuzzy search interface for Laravel’s Artisan CLI.
Instantly find routes, commands, and config keys — no fzf required.

Latest Version License PHP Version Laravel Version Tests

✨ Overview

ArtisanFuzzy is a lightweight Laravel package that brings interactive fuzzy search to your Artisan CLI —
built entirely in pure PHP 8.3+, with no external binaries or dependencies.

Quickly search through large lists of routes, commands, or config keys without the need for grep or fzf.
It's fast, portable, and works anywhere Laravel does — macOS, Linux, or Windows.

Requires Laravel 12.x and PHP 8.3+.

🚀 Installation

Install via Composer:

composer require rcpassos/artisanfuzzy

Laravel will auto-discover the service provider. If you prefer manual registration, add this to your config/app.php:

'providers' => [
    App\Providers\AppServiceProvider::class,
    Rcpassos\ArtisanFuzzy\ArtisanFuzzyServiceProvider::class,
],

⚡ Usage

🔹 Find a Route

php artisan route:find login

Interactively fuzzy-search your application’s routes.

🔹 Find an Artisan Command

php artisan command:find queue

🔹 Find a Config Key

php artisan config:find app

Each command supports:

--pattern=<string>  Filter non-interactively (CI-safe)
--limit=<int>       Limit the number of matches (default: 30)
--json              Output the result in JSON

💡 How It Works

ArtisanFuzzy provides a pure PHP terminal interface:

  • Uses built-in fgets() for interactive input
  • Matches strings using weighted fuzzy ranking (similar_text() + substring boost)
  • Auto-detects TTY vs non-TTY environments
  • Displays colorized results using ANSI codes (auto-disabled on Windows)

No binaries, no shell scripts — just Laravel and PHP.

🧩 Supported Commands

Command Description
route:find Search registered routes
command:find Search Artisan commands
config:find Search config keys and values

🧪 Testing

To run the package tests:

composer install
composer test

You can also test it inside a local Laravel app using a path repository:

"repositories": [
  { "type": "path", "url": "../artisanfuzzy" }
]

Then run:

composer require rcpassos/artisanfuzzy:@dev
php artisan route:find

🛠️ Requirements

  • PHP 8.3+
  • Laravel 12.x
  • Works on macOS, Linux, and Windows terminals

🧭 Roadmap

  • Pagination (:next, :prev in picker)
  • Extend fuzzy search to migrations and events
  • Custom scoring algorithm plugin support

❤️ Contributing

Contributions are welcome! If you find a bug or have an idea, open an issue or PR.

To contribute:

git clone https://github.com/rcpassos/artisanfuzzy.git
composer install
composer test

📜 License

ArtisanFuzzy is open-sourced software licensed under the MIT license.

🌟 Acknowledgements

Inspired by the elegance of Laravel’s Artisan CLI and the simplicity of fuzzy searching. Built with ❤️ for the Laravel community.

“Make the command line delightful again.” – ArtisanFuzzy ⚡

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-13