Download the PHP package jdwx/cli without Composer

On this page you can find all versions of the php package jdwx/cli. 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 cli

jdwx/cli

PHP framework for developing extensible PHP CLIs.

This provides a strong foundation for developing PHP command-line interfaces (CLIs). It is designed to be easy to use and easy to extend and to provide features that can be tedious to implement from scratch.

It provides:

Installation

You can require it directly with Composer:

Or download the source from GitHub: https://github.com/jdwx/args.git

Requirements

This library requires PHP 8.2 or later with the readline extension. It might work with earlier versions of PHP 8, but it has not been tested with them.

Usage

Using this framework involves two steps:

1) Creating commands that extend the AbstractCommand class and implement a run() method. These classes have constant properties that define the command name, help text, usage examples, aliases and (where applicable) predefined options. See the builtin commands for details.

2) Subclass the Interpreter class and add your commands in the constructor with the addCommandClass() method. Instantiate your interpreter subclass and call the run() method to start the interpreter. The php_sh.php file in the bin directory provides a simple example of how to do this.

Arguments are passed to the command using the Arguments class. For complex applications, you may want to subclass Arguments to provide additional methods to handle types relevant to your application. If you do, it is generally helpful to create an abstract subclass of AbstractCommand that defines a signature for the run() method using your custom Arguments subclass. E.g.:

Then use that as the parent class of your custom commands.

The Command class is provided for use when the generic Arguments implementation is sufficient.

Stability

This framework is considered stable and is used in production code. However, it has been refactored and improved for general use, and those features may not be as well-tested.

History

This framework has been in production for many years. It was refactored out of a larger codebase and released as an open-source standalone module in 2024.

There is a method called addCommand() that is present for historical reasons. It is used extensively in legacy code that implements commands as methods of the Interpreter class instead of separate classes, resulting in unmaintainable 10,000-line classes. It is retained for compatibility for now because refactoring those classes is exactly as quick and pleasant as you'd expect (i.e., not at all). It absolutely must not be used in new code. We look forward to removing it someday. When that day arrives, no advance warning will be given.


All versions of cli with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2.0
ext-readline Version *
jdwx/args Version ^1.0
jdwx/app Version ^1.0.4
psr/log Version ^3.0
ext-mbstring Version *
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 jdwx/cli contains the following files

Loading the files please wait ....