ImboClient - CLI¶
This is a command line wrapper around the official PHP-based client for Imbo servers.
Requirements¶
The client requires PHP >= 5.4.
Installation¶
ImboClientCli can be installed using Composer by requiring imbo/imboclient-cli
in your composer.json
file, or by running the following commands:
curl -s https://getcomposer.org/installer | php
php composer.phar create-project imbo/imboclient-cli [<dir>] [<version>]
Available versions can be located at packagist.
Usage¶
Once the client is installed you will find an executable called imboclient
in the bin
directory where you installed the client.
Below you will find documentation covering most features of the client.
- Configuration file
- Commands
- Activate a server -
activate
- Add one or more images -
add
(add-images
) - Deactivate a server -
deactivate
- Delete an image -
delete
(delete-image
) - Get help -
help
- List available commands -
list
- List servers in the configuration file -
list-servers
- Get the number of images -
num-images
- Get the server status -
server-status
- Activate a server -
Configuration file¶
To be able to use the client you will need to create a YAML configuration file that contains server definitions and key pairs. The client will look for the configuration file in the following paths (in the order specified):
./config.yml
~/.imboclient/config.yml
/etc/imboclient/config.yml
The client will use the first file it finds. A custom path can be specified by using the --config <path>
command line option.
The client ships with an example configuration file (shown below) that you can use as a base for your own configuration.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # Example configuration file
#
# Each server can have its own name (instead of server1, server2 and server3 as stated below).
# Remember to update the default server if you change the server names. Servers can be disabled by
# Changing the active state to false. The client will refuse to run any operations against inactive
# servers.
servers:
default: server1
server1:
url: http://imbo1.example.com
user: user
publicKey: public key
privateKey: private key
active: true
server2:
url: http://imbo2.example.com
user: user
publicKey: public key
privateKey: private key
active: true
server3:
url: http://imbo3.example.com
user: user
publicKey: public key
privateKey: private key
active: false
|
The default
key should point to the server definition that is to be used per default. If you need to execute a remote command (for instance adding / deleting images) from another server, specify the --server <server>
option when executing the command. When a server definition is labeled as not active (active: false
) you can not execute remote commands for that server. These flags can be changed manually by editing the configuration file, or by using the activate or deactivate commands in the client.
Commands¶
Below you will find all the different commands supported by the client, along with a detailed description of all options and arguments.
- Activate a server -
activate
- Add one or more images -
add
(add-images
) - Deactivate a server -
deactivate
- Delete an image -
delete
(delete-image
) - Get help -
help
- List available commands -
list
- List servers in the configuration file -
list-servers
- Get the number of images -
num-images
- Get the server status -
server-status