Set Up toscactl
Authenticate with Tosca Cloud and select a workspace.
Always use --json --silent on every toscactl command.
Steps
Check current state. Run
toscactl config --json --silent.- If already logged in and a workspace is set, report the current configuration and ask if the user wants to change anything. If not, stop here.
Login. If not logged in, or the user provided a tenant URL in
$ARGUMENTS:- Run
toscactl login --url <URL> --json --silentwhere<URL>is$ARGUMENTSor the URL from the current config. - If no URL is available, ask the user for their tenant URL (format:
tenant.my.tricentis.com). - Do not use
--headlessunless the user explicitly requests it.
- Run
List workspaces. Run
toscactl workspaces list --json --silentand present the available workspaces to the user.Set workspace. Ask the user which workspace to use, then run
toscactl workspaces set <chosen> --json --silent.Confirm. Run
toscactl config --json --silentand show the final configuration.
Error Handling
- If login fails, suggest checking the URL format (
tenant.my.tricentis.com) and network connectivity. - For CI/headless environments, mention that setting
TOSCA_CLIENT_IDandTOSCA_CLIENT_SECRETenvironment variables enables non-interactive authentication. - If
--headlessis needed, re-run login withtoscactl login --url <URL> --headless.