Manage multiple environments with the ACLI properties file

Manage multiple environments with the ACLI properties file

You can configure ACLI to work with multiple environments, such as production, staging, and QA, by updating the acli.properties file. This setup lets you switch easily between environments without modifying scripts or command-line parameters.

Starting with CLI version 9.0, a new feature enables you to define these environments using a standard properties file. This simplifies configuration and removes the need for multiple custom start scripts.

The CLI distribution includes example property files for both Cloud and Server deployments.

Before you begin

Make sure you have:

  • Installed the CLI client. For setup instructions, see CLI Client Installation and Use.

  • Access to your CLI installation directory.

  • The appropriate credentials (username/password for Server or username/token for Cloud).

Update the acli.properties file

  1. Open your CLI installation directory.

  2. Locate or create the acli.properties file.

  3. Add or update environment configurations for your Cloud or Server instances.

Example acli.properties file

# Example Cloud configuration # Generate API tokens from: https://id.atlassian.com/manage/api-tokens cloudcredentials = --user automation@example.com --token xxxxxxxxxxxxxxxxxxxxxxxx myjira = jiracloud -s https://issues.example.com ${cloudcredentials} myconfluence = confluencecloud -s https://mydocs.example.com ${cloudcredentials} # Example Server configuration prodservercredentials = --user admin --password admin jiraserver = jira -s https://prodjira.examplegear.com ${prodservercredentials} confluenceserver = confluence -s https://prodconfluence.examplegear.com ${prodservercredentials} qacredentials = --user qauser --password qapass qajira = jira -s https://qajira.example.com ${qacredentials} qaconfluence = confluence -s https://qaconfluence.example.com ${qacredentials} # Define the default instance to use for CLI actions default = ${myjira}

Understanding the configuration

Each line in the properties file defines:

  • A unique name (like myjira, qajira, or jiraserver) pointing to a specific Atlassian instance.

  • A CLI client type (jira, jiracloud, confluence, confluencecloud) and its server URL.

  • A set of credentials that the CLI will use to authenticate against that instance.

You can reference these named configurations directly in your CLI commands.

For example:

credentials = --user automation@example.com --token xxxxxxxxxxxxxxxxxxxxxxxx

This line sets reusable authentication parameters for all related Cloud environments.

Run CLI actions with environment names

After saving the updated acli.properties file, you can run CLI commands against specific environments using the defined names:

acli qajira --action getServerInfo acli myconfluence --action addPage --space "demo" --title "This is title" --parent "@home" acli myjira --action cloneIssue --issue "JIRACLI-4" --summary "clone summary" --comment "comment for cloned issue"

You can also use the shorthand -a instead of --action:

acli -a getServerInfo

Tips

  • Use clear, descriptive names for each environment (for example, prodjira, qajira) to avoid confusion.

  • If you're managing many environments, group your credentials and instances in logical sections (as shown above).

  • Keep your acli.properties file secure, especially when storing passwords or tokens.