承接 leafs/cli 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

leafs/cli

Composer 安装命令:

composer require leafs/cli

包简介

A simple command line tool for installing and interacting with your leaf apps

README 文档

README




Leaf CLI 2

Latest Stable Version Total Downloads License



A simple command line tool for creating and interacting with your leaf projects. You can do stuff like installing packages, interacting with your app, previewing your app, ...

Installation

You can get this tool up and running on your system using composer:

composer global require leafs/cli

Make sure to place Composer's system-wide vendor bin directory in your $PATH so the leaf executable can be located by your system. This directory exists in different locations based on your operating system; however, some common locations include:

  • Windows: %USERPROFILE%\AppData\Roaming\Composer\vendor\bin
  • macOS: $HOME/.composer/vendor/bin
  • GNU / Linux Distributions: $HOME/.config/composer/vendor/bin or $HOME/.composer/vendor/bin

You could also find the composer's global installation path by running composer global about and looking up from the first line.

Eg (Adding composer bin to path linux):

export PATH=$PATH:$HOME/.config/composer/vendor/bin

Eg (Adding composer bin to path mac):

export PATH=$PATH:$HOME/.composer/vendor/bin
echo $PATH

Usage Guide

Creating projects

To start a new project, simply open up your console or terminal in your directory for projects and enter:

With leaf 3:

leaf create <project-name>

This will now prompt you to select a preset

Creating a new Leaf app "<project-name>" in ./projects-directory.

* Please pick a preset 
  [0] leaf
  [1] leaf mvc
  [2] leaf api
 > 

Selecting a number will generate a leaf app based on the associated preset. As you can see, there are 3 presets:

  • Leaf: a bare leaf 3 project
  • Leaf MVC: a leaf MVC project with leaf 3
  • Leaf API: a leaf API project with leaf 3

You can also pick a preset directly without going through the interactive installer.

Leaf:

leaf create <project-name> --basic

Leaf API:

leaf create <project-name> --api

Leaf MVC:

leaf create <project-name> --mvc

You can also add --custom for a fully customisable leaf project.

leaf create <project-name> --custom

Installing packages

This cli tool also adds a feature to install modules from composer

leaf install ui

This installs the leafs/ui package.

You can also install third party packages from packagist

leaf install psr/log

Interactive Shell

You can also use the interactive shell to interact with your app.

$ leaf interact
...
>>> $user = new User;
...
>>> $user->name = "Mychi";
...
>>> $user->save();

Previewing your app

This opens up your app on the PHP local server.

leaf serve

You can also specify the port

leaf serve -p 8000

In v2.1, you can also start the leaf server with hot module watching. This reloads your application anytime a change is made to your application code. To get started, simply start the leaf server with the --watch flag.

leaf serve --port 8000 --watch

License

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

😇 Contributing

We are glad to have you. All contributions are welcome! To get started, familiarize yourself with our contribution guide and you'll be ready to make your first pull request 🚀.

To report a security vulnerability, you can reach out to @mychidarko or @leafphp on twitter. We will coordinate the fix and eventually commit the solution in this project.

Code contributors


Michael Darko

tedtop

Sponsoring Leaf

Your cash contributions go a long way to help us make Leaf even better for you. You can sponsor Leaf and any of our packages on open collective or check the contribution page for a list of ways to contribute.

And to all our existing cash/code contributors, we love you all ❤️

Cash contributors

You can view all sponsors @ https://leafphp.dev/#sponsors

🤯 Links/Projects

leafs/cli 适用场景与选型建议

leafs/cli 是一款 基于 TypeScript 开发的 Composer 扩展包,目前已累计 9.26k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2020 年 07 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「database」 「php」 「installer」 「deploy」 「server」 「leaf」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 leafs/cli 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 leafs/cli 我们能提供哪些服务?
定制开发 / 二次开发

基于 leafs/cli 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 0
  • Forks: 5
  • 开发语言: TypeScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-07