Package: cxcli
cx: Experimental CLI for Citrix CloudNote:Given that this is experimental software, your mileage may vary. The CLI-syntax is not yet finalized and may still change.The CLI works using the REST APIs of Citrix Cloud, as documented onCitrix's Developer Portal.FeaturesProvides a simple and efficient way to interact with Citrix CloudSupports many Citrix Cloud services including:adm,apppersonalization,cvadrestapis,globalappconfiguration,manageddesktops,microapps,notifications,quickdeploy,securebrowser,reportingapi,systemlog,virtualappsessentialls,webhook, andwem.Always up-to-date as it synchronizes the latest publishedOpenAPI-specifications.Responses can be formatted as either JSON, YAML, Table, CSV, or binary.Powerful query and filter syntax powered byJMESPath.Handles authentication and caches tokens transparently.Secrets are stored using the user's OS keyring service.Autocompletion for Bash and Zsh (seebelow)Installationcxcli requires Python 3.x. Find more informationhere.Install cxcli using:python3-mpipinstallcxcliConfigurationOnce installed, configure cxcli interactively:cx--configureFollow the Citrix Cloud Documentation, tocreate an API Clientand obtain theCustomerId,ClientID,ClientSecretrequired as part of the configuration.Note:By default, cxcli will store credentials in the user's system keyring service (Windows Credential Locker, macOS Keychain, KDE KWallet, FreeDesktop Secret Service). Should your environment not have a keyring service, or every keyring access require a keyring password, you can provide the configuration alternatively using environment variablesCXCUSTOMERID,CXCLIENTID, andCXCLIENTSECRET.Usage examplesShow a list of Cloud Services available via CLI:cx -hShow a list of commands available within a Cloud Service:cx systemlogExtract the latest records from Citrix Cloud's systemlog-service:cx systemlog GetRecordsProvide output as YAML:cxcli systemlog GetRecords --output-as yamlFilter for fields using JMESPath:cx systemlog GetRecords --cliquery 'Items[].Message."en-US"'Filter for values using JMESPath:cx systemlog GetRecords --cliquery 'Items[?ActorDisplayName == "a.bad@m.an"]'Show information about the CVAD Site:cx cvadrestapis Me_GetMeCreate an Administrator notification in Citrix Cloud:cxnotificationsNotifications_CreateItems--eventId$(uuidgen)--content'{"languageTag": "en-US","title": "Dinner Time","description": "Fish and Chips!"}'--severity"Information"--destinationAdmin"*"--component"Citrix Cloud"--priorityHigh--createdDate2021-02-13T08:20:17.120808-08:00Export a Microapp integration bundle as a backup:cxmicroappsexport_bundle--geous--bundleExportTypedefault--integrationExportConfig-id1--output-binaryintegration.mappRe-importing the Microapp integration bundle, providing the necessary base configuration:echo'{ "integrationImportConfig": { "type": "GWSC", "baseUrl": "https://mybaseurl/"} }'>config.txt
cxmicroappsimport_bundle--geous--configconfig.txt--bundleintegration.mappAutocomplete for Bash and ZshForBash- add the following snippet to your~/.bashrc-file:eval"$(register-python-argcompletecx)"Forzsh- Add the following snippet to your~/.zshrc-file:autoloadbashcompinit
bashcompiniteval"$(register-python-argcompletecx)"