This topic describes the system requirements, installation, and syntax for the XL Command Line Interface (XL CLI) used to support DevOps as Code.

System requirements

The XL CLI is supported on 64-bit versions of the following operating systems:

  • Linux
  • macOS
  • Windows

Install the XL CLI

You can install the XL CLI on any remote computer that can access the XL Deploy and XL Release servers in your environment.

Install the XL CLI on Linux

From the computer on which you want to install the XL CLI, open a terminal and run the following commands:

$ curl -LO https://dist.xebialabs.com/public/xl-cli/8.5.0/linux-amd64/xl
$ chmod +x xl
$ sudo mv xl /usr/local/bin

Note: The /usr/local/bin location is an example. You can place the file in a preferred location on your system.

Install the XL CLI on macOS

From the computer on which you want to install the XL CLI, open a terminal and run the following commands:

$ curl -LO https://dist.xebialabs.com/public/xl-cli/8.5.0/darwin-amd64/xl
$ chmod +x xl
$ sudo mv xl /usr/local/bin

Note: The /usr/local/bin location is an example. You can place the file in a preferred location on your system.

Install the XL CLI on Windows

From the computer on which you want to install the XL CLI, do the following:

  1. Download the XL CLI executable file from the following location:
https://dist.xebialabs.com/public/xl-cli/8.5.0/windows-amd64/xl.exe
  1. Place the file in a preferred location on your system (for example, C:\Program Files\XL CLI).

Set environment variables

Set environment variables so that you can run the standalone executable for the XL CLI from a command line without specifying the path in which the executable is located:

  • For macOS or Linux, you can place the XL CLI executable in your usr/local/bin location. You can also modify your path to include another directory in which the executable is stored.

  • For Windows, add the root location where you placed the XL CLI executable to your system Path variable.

XL CLI command reference

This section describes syntax and examples for the XL CLI.

Display help output

To display the XL CLI help output, type the following from your command line:

$ xl help

Commands

General usage: xl [command] [flag] [parameters]

Available commands: apply blueprint generate help license version wrapper

Command details

xl apply command details

Use the xl apply command to execute YAML specifications.

Syntax

xl apply [flag] [value]

Command-specific flags
Flag Description
-f, --file stringarray Required. Path(s) to the file(s) to apply
-h, --help Help for the apply command
--values stringToString Values (default [])
Global flags

You can use global flags within all XL CLI commands to pass config file detail, credentials, and server URLs. You can also use global flags to control verbosity of the output.

Flag Description
--blueprint-repository-password string Password for the blueprint repository
--blueprint-repository-url string URL for the blueprint repository. Default: https://dist.xebialabs.com/public/blueprints)
--blueprint-repository-username string Username for the blueprint repository
--config string Config file. Default: $HOME/.xebialabs/config.yaml
-q, --quiet Suppress all output, except for errors
-v, --verbose Provide verbose output
--xl-deploy-password string Password to access the XL Deploy server. Default: admin
--xl-deploy-url string URL to access the XL Deploy server. Default: http://localhost:4516/
--xl-deploy-username string Username to access the XL Deploy server. Default: admin
--xl-release-password string Password to access the XL Release server. Default: admin
--xl-release-url string URL to access the XL Release server. Default: http://localhost:5516/
--xl-release-username string Username to access the XL Release server. Default: admin
File order processing

You must choose at least on YAML file to perform an apply operation, but if you want to execute two or more YAML files, you can use one of the following methods:

Import kind YAML : The preferred method is to use a separate YAML file of the kind “Import” and list the YAML files to apply in order.

For example, you can create a YAML file called import-yamls.yaml

apiVersion: xl/v1
kind: Import
metadata:
  imports:
    - infra.yaml
    - env.yaml
    - app.yaml
    - xlr-pipeline.yaml

Using this method, you can then simply run the xl apply -f /tmp/umport-yamls.yaml file which will in turn sequentially run the YAML files listed in the imports: section.

String multiple files in the CLI: You can also specify multiple YAML files to apply in order when running the xl apply command. For example:

xl apply -f /tmp/infra.yaml -f /tmp/env.yaml -f /tmp/app.yaml -f xlr-pipeline.yaml
Examples
xl apply -f /tmp/infra.yaml
xl apply -f /tmp/infra.yaml -f /tmp/env.yaml -f /tmp/app.yaml -f /tmp/xlr-pipeline.yaml

xl blueprint command details

You can use the xl blueprint command to download and install XL YAML files from one of the blueprints provided by XebiaLabs, or one that you create.

Syntax

xl blueprint [flag] [parameter]

Command-specific flags
Flag Description
-b, --blueprint string The blueprint to use, a path relative to the blueprint repository or a local path
-h, --help Help for the blueprint command
Global flags

You can use global flags within all XL CLI commands to pass config file detail, credentials, and server URLs. You can also use global flags to control verbosity of the output.

Flag Description
--blueprint-repository-password string Password for the blueprint repository
--blueprint-repository-url string URL for the blueprint repository. Default: https://dist.xebialabs.com/public/blueprints)
--blueprint-repository-username string Username for the blueprint repository
--config string Config file. Default: $HOME/.xebialabs/config.yaml
-q, --quiet Suppress all output, except for errors
-v, --verbose Provide verbose output
--xl-deploy-password string Password to access the XL Deploy server. Default: admin
--xl-deploy-url string URL to access the XL Deploy server. Default: http://localhost:4516/
--xl-deploy-username string Username to access the XL Deploy server. Default: admin
--xl-release-password string Password to access the XL Release server. Default: admin
--xl-release-url string URL to access the XL Release server. Default: http://localhost:5516/
--xl-release-username string Username to access the XL Release server. Default: admin
Blueprint repository

By default, when you run the xl blueprint command without any flags, a list of publicly-available XebiaLabs blueprints stored in https://dist.xebialabs.com/public/blueprints/ is displayed.

You can also run the xl blueprint --blueprint-repository-url command and explicitly specify a blueprint repository URL (e.g., xl blueprint --blueprint-repository-url <your_blueprint_provider-URL).

Your blueprints

You create and manage your own blueprints and select from an accessible path or URL location using the xl blueprint -b command.

Examples
xl blueprint -b /tmp/myblueprint
xl blueprint --blueprint-repository-url <registry_location>/blueprints
xl blueprint --blueprint-repository-url https://mycompany/myblueprints --blueprint-repository-username USERNAME --blueprint-repository-password PASSWORD

xl generate command details

Use the xl generate command to generate a YAML file for existing configurations in XL Deploy or XL Release. You can use the generated specifications to extend or build your own specifications that can be executed directly using the XL CLI using the xl apply command.

In the XL Deploy UI, the nodes listed in the Explorer tree contain the equivalent configuration information for which you can generate individual YAML files:

  • Applications
  • Infrastructure
  • Environments
  • Configuration

For XL Release, you can generate a YAML file for the following configuration:

  • Template

Important: There are limitations to the number of objects you can generate:

  • For XL Deploy, the generate operation is limited to 256 configuration items (CIs).
  • For XL Release, a reasonable limit to the number of templates you can generate is enforced.
Syntax

xl generate [flag] [value]

Command-specific flags
Flag Description
-f, --file string Required. Path and filename where the generated YAML file will be stored
-h, --help Help for the generate command
-o, --override Set to true to overwrite an existing YAML file with the same name in the target directory
-p, --path string Required. Server path which will be generated
-s, --server string Server from which the YAML file will be generated. Can be xl-deploy (default) or xl-release
Global flags

You can use global flags within all XL CLI commands to pass config file detail, credentials, and server URLs. You can also use global flags to control verbosity of the output.

Flag Description
--blueprint-repository-password string Password for the blueprint repository
--blueprint-repository-url string URL for the blueprint repository. Default: https://dist.xebialabs.com/public/blueprints)
--blueprint-repository-username string Username for the blueprint repository
--config string Config file. Default: $HOME/.xebialabs/config.yaml
-q, --quiet Suppress all output, except for errors
-v, --verbose Provide verbose output
--xl-deploy-password string Password to access the XL Deploy server. Default: admin
--xl-deploy-url string URL to access the XL Deploy server. Default: http://localhost:4516/
--xl-deploy-username string Username to access the XL Deploy server. Default: admin
--xl-release-password string Password to access the XL Release server. Default: admin
--xl-release-url string URL to access the XL Release server. Default: http://localhost:5516/
--xl-release-username string Username to access the XL Release server. Default: admin
Examples
xl generate -p Applications -f /tmp/applications.yaml
xl generate -p Infrastructure -f /tmp/infra.yaml
xl generate -p Environments -f /tmp/env.yaml
xl generate -p Configuration -f /tmp/config.yaml
xl generate -s xl-release -p MyTemplate -f /tmp/template.yaml

xl license command details

You can display license information for the open source software used in the XL CLI using the xl license command.

Command-specific flags
Flag Description
-h, --help Help for the version command
Examples
xl license

xl version command details

You can display version information for the XL CLI using the xl version command.

Command-specific flags
Flag Description
-h, --help Help for the version command
Examples
xl version

xl wrapper command details

You can use the xl wrapper command to generate wrapper scripts to bootstrap the XL CLI commands on your Continuous Integration (CI) servers without having to install the XL CLI executable itself. See Using XL wrapper scripts.

Syntax

xl wrapper

Flags
Flag Description
-h, --help Help for the wrapper command
Global flags

You can use global flags within all XL CLI commands to pass config file detail, credentials, and server URLs. You can also use global flags to control verbosity of the output.

Flag Description
--blueprint-repository-password string Password for the blueprint repository
--blueprint-repository-url string URL for the blueprint repository. Default: https://dist.xebialabs.com/public/blueprints)
--blueprint-repository-username string Username for the blueprint repository
--config string Config file. Default: $HOME/.xebialabs/config.yaml
-q, --quiet Suppress all output, except for errors
-v, --verbose Provide verbose output
--xl-deploy-password string Password to access the XL Deploy server. Default: admin
--xl-deploy-url string URL to access the XL Deploy server. Default: http://localhost:4516/
--xl-deploy-username string Username to access the XL Deploy server. Default: admin
--xl-release-password string Password to access the XL Release server. Default: admin
--xl-release-url string URL to access the XL Release server. Default: http://localhost:5516/
--xl-release-username string Username to access the XL Release server. Default: admin
Examples
xl wrapper
xl wrapper -v