Skip to content

Configuration

As with any plugin you can configure the plugin in your site/config/config.php file.

Command specific configurations

For command specific options please refer to the Command documentation for more explanation about the available options and their meaning.

Activating or deactiviting specific commands

This plugin comes packed with a lot of commands. It might be that you don't want to use all of them. You have 2 methods to activate or deactivate commands.

Method 1: Using the disabledCommands option

You can disable commands by adding the class name of the command to the disabledCommands array in your options configuration. All commands that are not in this array will be available. For a list of all available commands please refer to the Available Commands section.

Method 2: Using the availableCommands option

You can also use the availableCommands option to only enable the commands you want to use. This will disable all other commands. For a list of all available commands please refer to the Available Commands section. You can also change the order of the commands via the availableCommands option. The order in which the commands are listed in the array will be the order in which they are displayed in the CLI.

Namespacing

The class names should be fully namespaced: \X\Devutils\Commands\KirbyCommands\UpCommand::class. Although it is advised to define the namespace in your config file and use a short form.

site/config/config.php
<?php
use X\Devutils\Commands;

return [
    ...
    'kx-devutils.availableCommands' => [
        ...
        'Commands\KirbyCommands\UpCommand::class',
        ...
    ],
    ...
];

All available options

<?php

$options = [
    'maintenance' => true,
    'install' => [
        'createEnv' => false,
        'composerPrefix' => '',
    ],
    'plugins' => [
        'packages' => [
            //
        ]
    ],
    'availableCommands' => [
        /** Kirby Commands **/
        Commands\KirbyCommands\UpCommand::class,
        Commands\KirbyCommands\DownCommand::class,
        Commands\KirbyCommands\RootsCommand::class,
        Commands\KirbyCommands\UsersCommand::class,
        Commands\KirbyCommands\RoutesCommand::class,
        Commands\KirbyCommands\OptionsCommand::class,
        Commands\KirbyCommands\InstallCommand::class,

        /** Plugin Commands **/
        Commands\PluginCommands\ListCommand::class,
        Commands\PluginCommands\RemoveCommand::class,
        Commands\PluginCommands\InstallCommand::class,

        /** Future commands **/
        // Commands\Database\LoadSnapshotCommand::class,
        // Commands\Database\ListSnapshotsCommand::class,
        // Commands\Database\CreateSnapshotCommand::class,
        // Commands\Database\DeleteSnapshotCommand::class,
        // Commands\Database\CleanSnapshotsCommand::class,

        // Commands\Backup\ManualBackupCommand::class, // AWS or SFTP
        // Commands\Backup\RotateBackupCommand::class, // AWS or SFTP

        // Commands\Scheduler\RunCommand::class,
        // Commands\Scheduler\ListCommand::class,
        // Commands\Scheduler\AddCronCommand::class,
        // Commands\Scheduler\TestCronCommand::class,
    ],
    'disabledCommands' => [
        //
    ],
];