Contexts
The command line interface can connect to several instances of the Admin Service at a time, such as a test and production environment. The details for each connection and a cache of its available commands are stored in a context.
acme-test
, with a hypothetical URL https://admin.acme.com/test
.Create
Use the context create
command to create a context for an Admin Service deployment with a
name and a URL:
mtxctl context create --url https://admin.acme.com/test acme-test
After creating a new context, run mtxctl context refresh
to update the available commands.
Login
If the Admin Service is secured with OAuth, you must log in to the context after it is created, or after your access token expires, with a command similar to the following:
mtxctl context login --username myusername --password pa$$w0rd123 acme-test
List
The context list command lists all configured contexts:
mtxctl context list
Select
The context select
command sets the specified context as the one to use for all subesquent commands:
mtxctl context select acme-test
Refresh
The context refresh
command refreshes the command cache for the named context (or the currently selected one if no name is provided):
mtxctl context refresh
Remove
The context remove
command deletes the specified context:
mtxctl context remove acme-test