Neurologically Paralyzing Mouseovers


    0.14.1 • Public • Published


    Package Version License PackagePhobia Node compatibility

    Basic CLI for Xen-Orchestra


    Installation of the npm package:

    > npm install --global xo-cli


    > xo-cli --help
      xo-cli --register [--allowUnauthorized] [--expiresIn duration] <XO-Server URL> <username> [<password>]
        Registers the XO instance to use.
        --allowUnauthorized, --au
          Accept invalid certificate (e.g. self-signed).
        --expiresIn duration
          Can be used to change the validity duration of the
          authorization token (default: one month).
      xo-cli --createToken <params>…
        Create an authentication token for XO API.
          Accept the same parameters as --register, see its usage.
      xo-cli --unregister
        Remove stored credentials.
      xo-cli --list-commands [--json] [<pattern>]...
        Returns the list of available commands on the current XO instance.
        The patterns can be used to filter on command names.
      xo-cli --list-objects [--<property>]… [<property>=<value>]...
        Returns a list of XO objects.
          Restricts displayed properties to those listed.
          Restricted displayed objects to those matching the patterns.
      xo-cli <command> [<name>=<value>]...
        Executes a command on the current XO instance.

    Register your XO instance

    > xo-cli --register admin
    Successfully logged with

    Note: only a token will be saved in the configuration file.

    List available objects

    Prints all objects:

    > xo-cli --list-objects

    It is possible to filter on object properties, for instance to prints all VM templates:

    > xo-cli --list-objects type=VM-template

    List available commands

    > xo-cli --list-commands

    Commands can be filtered using patterns:

    > xo-cli --list-commands '{user,group}.*'

    Execute a command

    The same syntax is used for all commands: xo-cli <command> <param name>=<value>...

    E.g., adding a new server:

    > xo-cli server.add username=root password=secret-password

    The return value is the identifier of this new server in XO.

    Because command lines are usually untyped, parameters (except true and false which are considered as booleans) are assumed as strings by default, other types must be encoded as JSON and prefixed by json::

    > xo-cli method string=foo number=json:42 array=json:'["item1", "item2"]'
    Configuration export
    > xo-cli xo.exportConfig @=config.json
    VM export
    > xo-cli vm.export vm=a01667e0-8e29-49fc-a550-17be4226783c @=vm.xva
    XVA VM import
    > xo-cli vm.import sr=60a6939e-8b0a-4352-9954-5bde44bcdf7d @=vm.xva

    Note: xo-cli only supports the import of XVA files. It will not import OVA files.

    OVA VM import

    A separate utility, xo-upload-ova, can be used to import .ova files.


    Contributions are very welcomed, either on the documentation or on the code.

    You may:

    • report any issue you've encountered;
    • fork and create a pull request.


    AGPL-3.0-or-later © Vates SAS


    npm i xo-cli

    DownloadsWeekly Downloads






    Unpacked Size

    18 kB

    Total Files


    Last publish


    • olivierlambert
    • julien-f
    • pdonias
    • tgoettelmann