Download the PHP package getkirby/cli without Composer

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

Kirby CLI

The Kirby command line interface helps simplifying common tasks with your Kirby installations.

Installation

Via Composer

Make sure to add your composer bin directory to your ~/.bash_profile (Mac OS users) or into your ~/.bashrc (Linux users).

Your global composer directory is normally either ~/.composer/vendor/bin or ~/.config/composer/vendor/bin. You can find the correct path by running …

Afterwards, add the result to your bash profile …

Did it work?

Check if the installation worked by running the following in your terminal.

This should print the Kirby CLI version and a list of available commands

Available core commands

Writing commands

You can create a new command via the CLI:

This will create a new site/commands folder in your installation with a new hello.php file

The CLI will already put the basic scaffolding into the file:

You can define your command logic in the command callback. The $cli object comes with a set of handy tools to create output, parse command arguments, create prompts and more.

Global commands

You might have some commands that you need for all your local Kirby installations. This is where global commands come in handy. You can create a new global command with the --global flag:

The command file will then be place in ~/.kirby/commands/hello.php and is automatically available everywhere.

Command environment

To load a custom environment config for a particular host, you can set an env variable

Command plugins

Your Kirby plugins can define their own set of commands: https://getkirby.com/docs/reference/plugins/extensions/commands

Check for installed commands

You can always check back if your commands have been created properly by running kirby again

Removing commands

Once you no longer need a command, you can remove it with …

If you have a local and a global command, you can choose which one to delete.

Debugging

Use the -d or --debug argument to run the command in debug mode:

Formatting Output

Sending messages to the terminal is super easy.

$cli->out()

$cli->success()

$cli->error()

$cli->bold()

$cli->br()

For more available colors and formats, check out the CLImate docs: https://climate.thephpleague.com/styling/colors/

Arguments

Your commands can define a list of required and optional arguments that need to be provided by the user.

The command can now be executed by providing the name …

If no name is provided, an error will be shown.

Argument docs

Arguments can be required, can set a default value and more. Check out the CLImate docs for additional options: https://climate.thephpleague.com/arguments/

Prompts

Instead of taking arguments from the command, you can also ask for them in a prompt:

As a third alternative you can either take the argument or ask for it if it is not provided:

Checkboxes Radios and more

The CLI also supports more complex ways to get input from users. Check out the CLImate docs how to work with user input: https://climate.thephpleague.com/terminal-objects/input/

Combining commands

You can reuse all existing commands in your custom commands to create entire chains of actions.

What's Kirby?


© 2009 Bastian Allgeier getkirby.com · License agreement


All versions of cli with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0 || ~8.2.0 || ~8.3.0
ext-zip Version *
composer-runtime-api Version ^2.2
guzzlehttp/guzzle Version ^7.8
league/climate Version ^3.8.2
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 getkirby/cli contains the following files

Loading the files please wait ....