Command Line Interfaces
Published 07 November 2024
Before using any tool's Command Line Interfaces (CLIs), they must be authenticated (licensed). If an attempt is made to use a CLI without being authenticated, the following error message will be displayed:
You must be authenticated before you can continue.
Please run the 'auth' command, or configure personal access tokens (PAT).
Each tool’s CLI version shares the same licensing as its corresponding Graphical User Interface (GUI) version, if it has one. If you are logged in and licensed via the GUI, the corresponding CLI will automatically be authenticated for use as well. Similarly, logging out of the GUI tools will also log you out of the CLI (and vice versa).
Activation
To activate the tool directly from the CLI, you can pass the following commands:
--auth --IAgreeToTheEula
Online Activation
If the computer is connected to the internet and can contact our licensing servers, a web browser will automatically open for you to log in with your RedGate credentials. Upon successful activation, the CLI will display a message similar to:
Tool Name (edition)
License ID: <license id>
Expiry: <license expiry date>
If the CLI is already authenticated, the success message will just be shown without asking you to log in.
Logging Out
If you need to log out of the CLI, you can do so by running the following commands:
--auth --logout
Offline Activation
If the computer is unable to connect to our licensing servers, you will see an offline activation message, similar to:
It looks like you're offline. Please connect to the internet and retry.
Alternatively, you can create an offline permit:
1. Go to 'portal.red-gate.com/offline'
2. Enter the code 'XXXXXX'
3. Paste the contents of the permit below:
In this case, visit 'portal.red-gate.com/offline' from a device with internet access to generate an offline permit, entering the specified code. Once obtained, paste the contents of the permit directly into the terminal and press enter. If the permit is valid, you will receive the success message confirming activation, otherwise an error message will be displayed.
Unattended Mode Using Personal Access Tokens (PATs)
The CLI can also be used in unattended mode by specifying a Personal Access Token (PAT). Once you have obtained a PAT from the customer portal, you can include the following commands alongside any other CLI commands:
--email="your@email.com" --token="Your PAT token"
Alternatively, you can configure the CLI to use a PAT by setting some environment variables; set your email address and token in the REDGATE_LICENSING
_PAT_EMAIL
and REDGATE_LICENSING
_PAT_TOKEN
environment variables, respectively. This removes the need to pass the --email
or --token
options with each invocation of the CLI.
CLIs can be run from CI/CD Pipelines, following these docs.