phphive/cli

A powerful, production-ready CLI tool for managing PHP monorepos with Turborepo integration


README

PhpHive Banner

PhpHive CLI

🐝 PHP Monorepo Management powered by Turborepo

PHP Version Packagist Version Downloads License CI Status Tests

FeaturesInstallationQuick StartDocumentationCommands

🎯 What is PhpHive?

PhpHive is a powerful, production-ready CLI tool for managing PHP monorepos with Turborepo integration. It provides a unified interface for scaffolding applications, managing dependencies, running quality tools, and orchestrating tasks across multiple packages.

Why PhpHive?

  • 🚀 Multi-Framework Support - Scaffold Laravel, Symfony, Magento, or skeleton apps with one command
  • ⚡ Turbo Speed - Parallel execution and intelligent caching via Turborepo
  • 🎯 Quality Built-in - PHPStan, Pint, Rector, PHPUnit, and Infection pre-configured
  • 🐝 Hive Workflow - All your PHP projects working together like bees in a hive
  • 💎 Beautiful CLI - Interactive prompts powered by Laravel Prompts
  • 🔧 Zero Config - Sensible defaults, works out of the box

✨ Features

Core Features

  • Workspace Management - Initialize and manage monorepo workspaces
  • App Scaffolding - Create Laravel, Symfony, Magento, or skeleton apps
  • Package Creation - Generate reusable packages with proper structure
  • Dependency Management - Unified Composer operations across workspaces
  • Task Orchestration - Run tasks in parallel with Turborepo

Quality & Testing

  • PHPUnit - Comprehensive test suite with 58+ tests
  • PHPStan - Static analysis at level 8
  • Laravel Pint - Automatic code formatting
  • Rector - Automated refactoring for PHP 8.3+
  • Infection - Mutation testing for test quality

Developer Experience

  • Auto-discovery - Commands are automatically discovered
  • Interactive Prompts - Beautiful CLI powered by Laravel Prompts
  • Command Suggestions - "Did you mean?" with fuzzy matching
  • Comprehensive Help - Detailed help text for every command
  • Error Handling - Clear, actionable error messages

📦 Installation

Requirements

  • PHP: 8.3 or higher
  • Composer: 2.0 or higher
  • Extensions: mbstring, json, tokenizer, xml, ctype, iconv

Global Installation (Recommended)

composer global require phphive/cli

Local Installation

composer require --dev phphive/cli

Verify Installation

hive version

⚡ Quick Start

1. Initialize a New Workspace

hive make:workspace

Follow the interactive prompts to create your monorepo structure.

2. Create an Application

# Laravel application
hive make:app my-api --type=laravel

# Symfony application
hive make:app my-service --type=symfony

# Magento store
hive make:app my-shop --type=magento

3. Create a Package

hive make:package my-package

4. Install Dependencies

hive composer:install

5. Run Quality Checks

# Run tests
hive quality:test

# Check code style
hive quality:lint

# Run static analysis
hive quality:typecheck

# Run all checks
cd cli && composer check

📚 Documentation

Comprehensive documentation is available in the docs directory:

🎮 Commands

PhpHive provides 30+ commands organized into 10 categories:

Workspace Management

  • hive make:workspace - Initialize a new monorepo workspace
  • hive workspace:list - List all workspaces
  • hive workspace:info - Show workspace details

Application Scaffolding

  • hive make:app - Create a new application (Laravel/Symfony/Magento/Skeleton)
  • hive make:package - Create a new package

Dependency Management

  • hive composer:install - Install dependencies
  • hive composer:require - Add a package
  • hive composer:update - Update dependencies
  • hive composer:run - Run Composer commands

Quality & Testing

  • hive quality:test - Run PHPUnit tests
  • hive quality:lint - Check code style with Pint
  • hive quality:format - Fix code style
  • hive quality:typecheck - Run PHPStan analysis
  • hive quality:refactor - Apply Rector refactoring
  • hive quality:mutate - Run Infection mutation testing

Framework Commands

  • hive framework:artisan - Run Laravel Artisan
  • hive framework:console - Run Symfony Console
  • hive framework:magento - Run Magento CLI

Development

  • hive dev:start - Start development server
  • hive dev:build - Build for production

Deployment

  • hive deploy:run - Run deployment pipeline
  • hive deploy:publish - Publish packages

Maintenance

  • hive clean:cache - Clean caches
  • hive clean:all - Deep clean (destructive)

Turborepo

  • hive turbo:run - Run Turbo tasks
  • hive turbo:exec - Execute Turbo commands

System

  • hive system:doctor - Check system health
  • hive system:version - Show version information

View complete command reference →

🏗️ Project Structure

monorepo/
├── apps/                    # Applications
│   ├── api/                # Laravel API
│   ├── admin/              # Admin dashboard
│   └── shop/               # Magento store
├── packages/                # Shared packages
│   ├── calculator/         # Example package
│   └── utilities/          # Shared utilities
├── cli/                     # PhpHive CLI tool
│   ├── bin/hive            # CLI entry point
│   ├── src/                # Source code
│   ├── tests/              # Test suite
│   └── docs/               # Documentation
├── composer.json            # Root composer file
├── turbo.json              # Turborepo config
└── pnpm-workspace.yaml     # Workspace config

🤝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

Quick Contribution Guide

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run quality checks (composer check)
  5. Commit your changes (git commit -m 'feat: add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

📄 License

PhpHive CLI is open-sourced software licensed under the MIT license.

🙏 Credits

Built with:

📞 Support

⬆ back to top

Made with ❤️ by the PhpHive team