From e3fd6ff6da61642ed509947febd10c5eda6b13aa Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Mon, 28 Nov 2022 15:42:30 +0100 Subject: [PATCH] Improve docs --- README.md | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index c5de94a..21ce1df 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,6 @@ The Kirby command line interface helps simplifying common tasks with your Kirby installations. -![kirby-cli](https://user-images.githubusercontent.com/24532/193451850-73b1404d-82e2-42d4-b62b-3122fdc3f005.png) - - ## Installation ### Via Composer @@ -57,10 +54,13 @@ This should print the Kirby CLI version and a list of available commands - kirby make:plugin - kirby make:snippet - kirby make:template +- kirby register - kirby remove:command +- kirby roots - kirby unzip - kirby uuid:generate - kirby uuid:populate +- kirby uuid:remove - kirby version ``` @@ -100,6 +100,24 @@ kirby make:command hello --global The command file will then be place in `~/.kirby/commands/hello.php` and is automatically available everywhere. +## Command plugins + +Your Kirby plugins can define their own set of commands: https://getkirby.com/docs/reference/plugins/extensions/commands + +```php +Kirby::plugin('your/plugin', [ + 'commands' => [ + 'your-plugin:test' => [ + 'description' => 'Nice command', + 'args' => [], + 'command' => function ($cli) { + $cli->success('My first plugin command'); + } + ] + ] +]); +``` + ## Check for installed commands You can always check back if your commands have been created properly by running `kirby` again @@ -246,19 +264,6 @@ return [ ]; ``` -### Where to place local commands - -The config can also set where local commands are stored. By default, they are stored in `/site/commands` - -```json -{ - "roots": { - "commands.local": "./commands", - "commands.global": "/var/kirby/commands", - } -} -``` - ## What's Kirby? - **[getkirby.com](https://getkirby.com)** – Get to know the CMS.