Set up Kobiton Command Line Interface Before you begin Obtain the username and API key from a Kobiton Enterprise account. Ensure devices are available in the Kobiton Portal. CLI sessions are supported on devices from the Private & Local Devices and Public Cloud Devices tabs. Access the Kobiton CLI from the Downloads icon in the left navigation of the Kobiton Portal. The package is available for the following platforms: macOS - ARM64 (for Macs with Apple silicon) Linux - x64 Windows - x64 Setup and authentication macOS or Linux Windows Open a terminal window on the machine. Navigate to the directory of the downloaded CLI package. Extract the downloaded package to create the kobiton executable file. tar -zxvf kobiton-cli.<platform>.<version>.tgz Export the following environment variables for authentication using the command export <VARIABLE_NAME>=<VALUE> KOBITON_PORTAL: the Server URL of the Kobiton Portal without /wd/hub. Example: if the Server URL is https://api.kobiton.com/wd/hub, then use https://api.kobiton.com KOBITON_USER: the Kobiton username KOBITON_API_KEY: the Kobiton API Key Examples # Check the actual server URL of your Kobiton Portal export KOBITON_PORTAL=https://api.kobiton.com # Obtain the following from the Profile and Settings page of the Kobiton Portal export KOBITON_USER=johndoe export KOBITON_API_KEY=be99***0-c*df-4224-aed6-907****92d0 Put the export commands for the above variables in a .env file, then run source <env-filename> to export all variables. Example # The following assumes that all required export variable commands are in the file variables.env source variables.env Open the location of the downloaded CLI package in File Explorer. Right-click the kobiton-cli.win-x64.<version>.zip package and select Extract All…, then choose Extract. This results in a folder with the file kobiton.exe. Open PowerShell, then navigate to the location of the kobiton.exe file. Export the following environment variables for authentication using the command $env:<VARIABLE_NAME>="<VALUE>" in PowerShell. KOBITON_PORTAL: the API URL of the Kobiton Portal Example: if the Server URL is https://api.kobiton.com/wd/hub, then use https://api.kobiton.com KOBITON_USER: the Kobiton username KOBITON_API_KEY: the Kobiton API Key Cloud/Hybrid # Check the actual server URL of your Kobiton Portal $env:KOBITON_PORTAL = "https://api.kobiton.com" # Obtain the following from the Profile and Settings page of the Kobiton Portal $env:KOBITON_USER = "johndoe" $env:KOBITON_API_KEY = "be99***0-c*df-4224-aed6-907****92d0" For Command Prompt (cmd.exe), use the following command instead to set environment variables: set KOBITON_PORTAL=https://api.kobiton.com set KOBITON_USER=johndoe set KOBITON_API_KEY=be99***0-c*df-4224-aed6-907****92d0 After the CLI has been set up for the appropriate platform, run the following command from the same location as the kobiton file to verify the variables and confirm the CLI is working: macOS, Linux, Windows - PowerShell Windows - Command Prompt ./kobiton device list --private kobiton device list --private If the device list is returned without any error, then the CLI is set up and ready for use. If there is any error, follow the troubleshooting guide to resolve the issue. Add environment variables to shell initialization script (optional) macOS or Linux Windows - Command Prompt Windows - PowerShell These commands can be added to your shell initialization script to persist the variables across shell sessions. The shell configuration file is typically .bashrc, .zshrc, or .bash_profile. Consult your shell’s documentation if you’re unsure. You can also update the PATH environment variable to include the kobiton location. # Export authentication variables export KOBITON_PORTAL=<PORTAL_URL> export KOBITON_USER=<USERNAME> export KOBITON_API_KEY=<API_KEY> # Add kobiton executable path to PATH export PATH=$PATH:<PATH_TO_KOBITON> Exit the current shell instance, and launch a new one to apply the changes. Run these commands to set the permanent environment variables for shell instances. You can also update the PATH variable to include the tool directories if needed. REM Run the following to export authentication variables setx KOBITON_PORTAL=<PORTAL_URL> setx KOBITON_USER=<USERNAME> setx KOBITON_API_KEY=<API_KEY> REM Run the following to add kobiton executable path to PATH setx PATH "%PATH%;<PATH_TO_KOBITON>" Exit the current shell instance, and launch a new one to apply the changes. Run these commands to set the permanent environment variables for shell instances. You can also update the PATH variable to include the tool directories if needed. # Run the following to export authentication variables [System.Environment]::SetEnvironmentVariable("KOBITON_PORTAL","<PORTAL_URL>","User") [System.Environment]::SetEnvironmentVariable("KOBITON_USER","<USERNAME>","User") [System.Environment]::SetEnvironmentVariable("KOBITON_API_KEY","<API_KEY>","User") # Run the following to add kobiton executable path to PATH [System.Environment]::SetEnvironmentVariable("PATH",$env:PATH + ";<PATH_TO_KOBITON>","User") Exit the current shell instance, and launch a new one to apply the changes. Next steps Start using Kobiton CLI.