定制 pollora/cli 二次开发

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

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

pollora/cli

最新稳定版本:v1.0.0

Composer 安装命令:

composer require pollora/cli

包简介

Pollora CLI Tool

README 文档

README

Pollora

Latest Stable Version Total Downloads License

About Pollora CLI

The Pollora CLI is a command-line tool for creating and managing Pollora projects. It provides interactive scaffolding with optional DDEV integration, and acts as an intelligent proxy to framework commands when used inside a project.

Installation

Install the CLI globally via Composer:

composer global require pollora/cli

Make sure the Composer global vendor/bin directory is in your system's PATH:

composer global config bin-dir --absolute

Add the returned path to your shell profile if it's not already configured:

Bash~/.bashrc
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
Zsh~/.zshrc
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
Fish~/.config/fish/config.fish
fish_add_path $HOME/.config/composer/vendor/bin
Windows (PowerShell)
# Add to your PowerShell profile ($PROFILE)
$env:PATH = "$env:APPDATA\Composer\vendor\bin;$env:PATH"

Note: On some systems, the Composer global directory may be ~/.composer/vendor/bin instead of ~/.config/composer/vendor/bin. Use the composer global config bin-dir --absolute command to check.

After updating your profile, reload your shell (source ~/.zshrc, source ~/.bashrc, etc.) or open a new terminal.

Creating a new project

Standard install

pollora new my-site

The command will:

  1. Run composer create-project pollora/pollora
  2. Execute php artisan pollora:install for WordPress setup
  3. Optionally initialize a Git repository

With DDEV (recommended)

pollora new my-site --ddev

When the --ddev flag is passed (or selected interactively), the CLI will:

  1. Configure DDEV (WordPress, PHP 8.4, MariaDB 10.11)
  2. Start the DDEV environment
  3. Install the project via ddev composer create-project
  4. Run pollora:install inside the container
  5. Publish the ./pollora binary and ddev pollora command

Your site will be available at https://my-site.ddev.site.

Options

Option Description
--ddev Set up the project with DDEV
--force, -f Force install even if the directory already exists
--git Initialize a Git repository
--branch=NAME Branch name for the new repository (default: main)

Using Pollora commands

Inside a Pollora project

When you run pollora inside a directory that contains both artisan and vendor/pollora/framework, the CLI acts as a proxy and delegates commands to php artisan pollora:{command}:

cd my-site

pollora status            # => php artisan pollora:status
pollora make-plugin Foo   # => php artisan pollora:make-plugin Foo
pollora make-theme starter # => php artisan pollora:make-theme starter

With DDEV

If you set up your project with --ddev, a custom ddev pollora command is available:

ddev pollora status
ddev pollora make-plugin Foo
ddev pollora list

With the local ./pollora binary

The framework provides a dedicated ./pollora binary (published via vendor:publish --tag=pollora-binary) that shows only Pollora-related commands with short names:

./pollora list

# Available commands:
#   install        Install and configure WordPress
#   status         Display Pollora framework status
#   make-plugin    Generate plugin structure
#   make-theme     Generate theme structure
#   make-block     Create a new Gutenberg block
#   make-posttype  Create a new custom post type
#   ...

The original php artisan pollora:* signatures continue to work as aliases.

Updating

The CLI checks for updates automatically (once every 24 hours) and displays a notification when a new version is available:

  A new version of Pollora CLI is available: v0.3.0 (current: v0.2.0)
  Run pollora self-update to update.

To update manually:

pollora self-update

This runs composer global update pollora/cli under the hood. You can also use the alias pollora self:update.

Other commands

Command Description
pollora version Display the CLI version
pollora self-update Update the CLI to the latest version (alias: self:update)

Requirements

  • PHP >= 8.2
  • Composer 2.x
  • DDEV (optional, for --ddev mode)

Testing

composer test              # Run all checks (Rector, Pint, PHPStan, Pest, type-coverage)
composer test:unit         # Run Pest tests
composer test:types        # Run PHPStan static analysis (level 5)
composer test:lint         # Check code style with Pint
composer test:refacto      # Check refactoring rules with Rector
composer test:type-coverage # Check type coverage (>= 98%)

License

Pollora CLI is open-sourced software licensed under the GPL-2.0-or-later.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-05-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固