Library for creating console commands.
composer required igor-kozhevnikov/cross
Run the follow command to create config.
Available extensions: php
json
.
./vendor/bin/cross config [<extension>]
A cross.php
or cross.json
config file locates in the root directory.
The plugins
and commands
array contains definitions and configurations of
plugins and commands.
For example:
<?php
return [
'plugins' => [
\Cross\Docker\Plugin\Plugin::class => [ 'env_path' => 'docker/.env' ],
\Cross\Git\Plugin\Plugin::class,
],
'command' => [
\Cross\Docker\Commands\SSH::class => [ 'container' => 'packager_workspace' ],
\Cross\Git\Commands\Snapshot::class => [ 'is_use_add' => false ],
],
];
{
"plugins": {
"\\Cross\\Docker\\Plugin\\Plugin": { "env_path": "docker/.env" },
"\\Cross\\Git\\Plugin\\Plugin": {}
},
"commands": {
"\\Cross\\Docker\\Commands\\SSH": { "container": "packager_workspace" },
"\\Cross\\Git\\Commands\\Snapshot": { "is_use_add": false }
}
}
./vendor/bin/cross
./vendor/bin/cross config [<extension>]
Arguments:
extension
Extension of config file. Available values:php
json
.
You can see commands based on this package in the following repositories:
Add the following code to ~/.zshrc
file to create the x
alias.
CROSS_LOCAL=./vendor/bin/cross
CROSS_GLOBAL=~/.composer/vendor/bin/cross
cross() {
if [[ -f $CROSS_LOCAL ]]; then
eval "alias x='${CROSS_LOCAL}'"
elif [[ -f $CROSS_GLOBAL ]]; then
eval "alias x='${CROSS_GLOBAL}'"
else
eval "alias x='echo The Cross package is not installed'"
fi
}
add-zsh-hook chpwd cross
eval cross
And use x command
instead of ./vendor/bin/cross command
.
The Cross is open-sourced software licensed under the MIT license.