Download the PHP package kode/console without Composer

On this page you can find all versions of the php package kode/console. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package console

Kode Console

健壮、通用的 PHP 控制台组件

PHP Version

📦 简介

kode/console 是一个专为现代 PHP 应用设计的通用控制台工具包,采用 PHP 8.1+ 最新特性,提供轻量、解耦、可扩展的命令行开发体验。

✨ 特性

📦 安装

🚀 快速开始

创建命令

运行命令

📖 详细文档

命令签名 DSL

使用签名 DSL 定义命令的参数和选项:

参数定义

格式 说明
{name} 必填参数
{name?} 可选参数
{name=default} 带默认值的参数
{name:string} 带类型的参数
{name:int=100} 带类型和默认值的参数

选项定义

格式 说明
{--flag} 布尔标志
{--option=} 必填值选项
{--option=default} 带默认值的选项
{--option:int} 带类型的选项
{--option\|-o} 带短别名的选项

支持的类型

输入处理

交互式输入

输出格式化

命令分组

中间件

事件系统

命令别名和示例

🏗️ 架构设计

📋 API 参考

Command 类

方法 说明
fire(Input, Output): int 执行命令(抽象方法)
sig(string): static 注册命令签名
alias(array): static 设置命令别名
example(string, string): static 添加使用示例
related(array): static 设置相关命令
group(string): static 设置命令分组
showHelp(Input, Output): void 显示帮助信息

Input 类

方法 说明
arg(string\|int, mixed): mixed 获取参数值
opt(string): mixed 获取选项值
flag(string): bool 检查标志是否存在
has(string): bool 检查参数是否存在
cast(mixed, string): mixed 类型转换
validate(string, mixed, array): bool 参数验证
ask(string, string): string 询问用户输入
confirm(string, bool): bool 确认操作
choice(string, array, mixed): mixed 选择选项

Output 类

方法 说明
line(string, string): void 输出一行文本
info(string): void 输出信息(蓝色)
warn(string): void 输出警告(黄色)
error(string): void 输出错误(红色)
success(string): void 输出成功(绿色)
raw(string): void 输出原始文本
styled(string, string): void 带样式输出
table(array, array): void 表格输出
progress(int, int, int): void 进度条输出
json(mixed): void JSON 输出

Kernel 类

方法 说明
add(string): static 注册命令
alias(string, string): static 添加命令别名
addGroup(CommandGroup): static 添加命令组
addMiddleware(IsMiddleware): static 添加中间件
setEventManager(IsEventManager): static 设置事件管理器
boot(array): int 运行控制台
all(): array 获取所有命令

📝 开发

环境要求

安装依赖

静态分析

📄 许可证

Apache 2.0 License


🌟 目标:成为 PHP 社区最轻量、最健壮、最通用的控制台底层包


All versions of console with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kode/console contains the following files

Loading the files please wait ...