定制 unoforge/flexi-cli 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

unoforge/flexi-cli

Composer 安装命令:

composer require unoforge/flexi-cli

包简介

A modern CLI tool for rapidly scaffolding PHP web applications

README 文档

README

⚡ A modern CLI tool for rapidly scaffolding modern PHP web applications with flexible CSS frameworks and interactive components.

Overview

Flexiwind CLI is a command-line tool that streamlines the setup of modern web applications by providing:

  • Framework Support: Laravel and Symfony project initialization
  • CSS Framework Integration: TailwindCSS and UnoCSS support
  • Interactive Components: Livewire, Alpine.js, and Stimulus integration
  • Component Registry: Add pre-built UI components from remote registries
  • Smart Detection: Automatic project type and package manager detection

Documentation

Installation

Global Installation (Recommended)

composer global require unoforge/flexi-cli

Local Installation

composer require --dev unoforge/flexi-cli

Quick Start

Initialize a New Project

# Create a new Laravel project with TailwindCSS
flexi-cli init --new-laravel --tailwind

# or
php flexi-cli init --new-laravel --tailwind

# Create a new Symfony project with UnoCSS
flexi-cli init --new-symfony --uno

# Initialize in existing project or empty project
flexi-cli init

Add Components

# Add a button component from the default registry
flexi-cli add @flexiwind/button

# Add a modal component
flexi-cli add @flexiwind/modal

Commands

init

Initialize Flexiwind in your project with interactive setup.

Options:

  • --new-laravel, -nl: Create a new Laravel project
  • --new-symfony, -ns: Create a new Symfony project
  • --tailwind: Use TailwindCSS
  • --uno: Use UnoCSS
  • --css-path : Path to the CSS files
  • --js-path : Path to the JS files
  • --no-flexiwind : Initialize without Flexiwind UI

Examples:

flexi-cli init --new-laravel

add

Add UI components to your project from component registries.

Arguments:

  • component: Component name in format @source/name

Examples:

flexi-cli add @flexiwind/button
flexi-cli add @ui/card

Features

  • Project Initialization: Interactive setup for new and existing projects
  • Framework Detection: Automatic Laravel/Symfony project detection
  • Package Manager Detection: Auto-detect npm, yarn, or pnpm
  • CSS Framework Setup: TailwindCSS and UnoCSS integration
  • Interactive Components:
    • Livewire integration for Laravel
    • Stimulus JS setup for Symfony
    • Alpine.js setup
  • Configuration Management: YAML-based configuration files
  • File Generation: Base CSS, JS, and layout files

📋 Planned Features

  • Starter Templates: Pre-configured project templates
  • Component Library: Expanded built-in component collection

Project Structure

flexi-cli/
├── bin/
│   └── flexi-cli              # Main CLI executable
├── src/
│   ├── Command/               # CLI commands
│   │   ├── InitCommand.php    # Project initialization
│   │   └── AddCommand.php     # Component addition
│   ├── Core/                  # Core functionality
│   ├── Installer/             # Package installers
│   └── Service/               # Business logic services
├── stubs/                     # Template files
│   ├── css/                   # CSS templates
│   ├── js/                    # JavaScript templates
│   ├── laravel/               # Laravel-specific templates
│   ├── symfony/               # Symfony-specific templates
│   ├── tailwind/              # TailwindCSS templates
│   └── uno/                   # UnoCSS templates
└── composer.json              # Package configuration

Configuration

Flexiwind uses a flexiwind.yaml configuration file in your project root:

framework: laravel
livewire: true
alpine: false
theme: flexiwind
themeMode: Both
cssFramework: tailwindcss
js_folder: resources/js
css_folder: resources/css
defaultSource: http://localhost:4500/public/r/{name}.json
registries:
  '@flexiwind': http://localhost:4500/public/r/{name}.json

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Clone the repository
  2. Install dependencies: composer install
  3. Make your changes
  4. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-14