meritum/sage 问题修复 & 功能扩展

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

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

meritum/sage

Composer 安装命令:

composer create-project meritum/sage

包简介

Meritum CLI application scaffold

README 文档

README

Sage is a composer create-project scaffold for building CLI applications with the Meritum ecosystem. It ships a pre-wired meritum/cli kernel with a clean structure ready to build on.

Requirements

  • PHP 8.4+
  • Composer

Getting Started

composer create-project meritum/sage my-app
cd my-app

Copy .env.example to .env and adjust as needed:

APP_NAME='My App'
APP_ENV=local
APP_DEBUG=true

Run the application:

php bin/sage

Dev Environment

Sage ships with a devenv.nix for devenv:

devenv shell

PHP extensions and services (PostgreSQL, Redis, etc.) can be added in devenv.nix.

Adding a Command

Create a command class in src/Command/:

namespace App\Command;

use Meritum\Cli\ExitCode;
use Meritum\Cli\Command\Command;
use Meritum\Cli\Output\SageStyleInterface;

final class HelloCommand extends Command
{
    public function __invoke(SageStyleInterface $io): ExitCode
    {
        $io->success('Hello, world!');

        return ExitCode::Success;
    }
}

Register it in AppModule::register():

$kernel->define(HelloCommand::class, function (): HelloCommand {
    $command = new HelloCommand();
    $command->setName('hello')->setDescription('Say hello');
    return $command;
})->tag(CliKernelOption::CommandTag->value);

Structure

bin/sage                  Entry point
src/
  ModuleRepository.php    Register application modules
  AppModule.php           Register commands and application config
tests/
devenv.nix                Dev environment

Testing

composer test

Further Reading

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固