Install
$ npm install -g @tru_id/cli
Usage
Every run of the CLI will check to see if all required configuration is in place.
$ npm install -g @tru_id/cli$ tru COMMANDrunning command...$ tru (-v|--version|version)@tru_id/cli/1.2.0 linux-x64 node-v16.13$ tru --help [COMMAND]USAGE$ tru COMMAND...
Commands
tru analytics:[PRODUCT_ID]:daily
tru analytics:[PRODUCT_ID]:hourly
tru analytics:[PRODUCT_ID]:monthly
tru coverage:country CODE
tru coverage:reach DEVICE-IP
tru help [COMMAND]
tru oauth2:token
tru phonechecks:create [PHONE_NUMBER]
tru phonechecks:list [CHECK_ID]
tru phonechecks:traces CHECK_ID
tru projects:create [NAME]
tru projects:list [PROJECT_ID]
tru projects:update [PROJECT-ID]
tru setup:credentials CLIENT-ID CLIENT-SECRET DATA-RESIDENCY
tru simchecks:create [PHONE_NUMBER]
tru simchecks:list [CHECK_ID]
tru simchecks:traces CHECK_ID
tru subscriberchecks:create [PHONE_NUMBER]
tru subscriberchecks:list [CHECK_ID]
tru subscriberchecks:traces CHECK_ID
tru usage:daily
tru usage:hourly
tru usage:monthly
tru workspaces
tru analytics:[PRODUCT_ID]:daily
Get Daily Analytics by Product ID. The date range defaults to current date.
USAGE$ tru analytics:[PRODUCT_ID]:dailyARGUMENTSPRODUCT_ID two letter Product ID. pck (PhoneCheck), suk (SubscriberCheck), sck (SIMCheck)OPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--group-by=group-by Group results by one or more fields e.g network_id or project_id or network_id,project_id--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--page_number=page_number [default: 1] The page number to return in the list resource.--page_size=page_size [default: 10] The page size to return in list resource request.--search=search The RSQL query for analytics. date is required e.g --search='date>=2021-03-29'--sort=sort property to sort by (prepend '-' for descending)
tru analytics:[PRODUCT_ID]:hourly
Get Hourly Analytics by Product ID. The date range defaults to current date.
USAGE$ tru analytics:[PRODUCT_ID]:hourlyOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--group-by=group-by Group results by one or more fields e.g network_id or project_id or network_id,project_id--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--page_number=page_number [default: 1] The page number to return in the list resource.--page_size=page_size [default: 10] The page size to return in list resource request.--search=search The RSQL query for analytics. date is required e.g --search='date>=2021-03-29'--sort=sort property to sort by (prepend '-' for descending)
tru analytics:[PRODUCT_ID]:monthly
Get Monthly Analytics by Product ID. The date range defaults to the current calendar month.
USAGE$ tru analytics:[PRODUCT_ID]:monthlyOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--group-by=group-by Group results by one or more fields e.g network_id or project_id or network_id,project_id--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--page_number=page_number [default: 1] The page number to return in the list resource.--page_size=page_size [default: 10] The page size to return in list resource request.--search=search The RSQL query for analytics. date is required e.g --search='date>=2021-03-29'--sort=sort property to sort by (prepend '-' for descending)
tru coverage:country CODE
Retrieve country based coverage and prices
USAGE$ tru coverage:country CODEARGUMENTSCODE two letter code ISO 3166-1 alpha-2 or country dialing codeOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--project-dir=project-dir The directory that contains the tru.json Project configuration file--sort=sort property to sort by (prepend '-' for descending)
tru coverage:reach DEVICE-IP
Find if a certain device ip is reachable
USAGE$ tru coverage:reach DEVICE-IPARGUMENTSDEVICE-IP The device ip in ipv4 or ipv6 formatOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--project-dir=project-dir The directory that contains the tru.json Project configuration file--sort=sort property to sort by (prepend '-' for descending)
tru help [COMMAND]
display help for tru
USAGE$ tru help [COMMAND]ARGUMENTSCOMMAND command to show help forOPTIONS--all see all commands in CLI
tru oauth2:token
Creates an OAuth2 token
USAGE$ tru oauth2:tokenOPTIONS-h, --help show CLI help-x, --extended show extra columns--debug Enables debug logging for the CLI--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--project-dir=project-dir The directory that contains the tru.json Project configuration fileEXAMPLES# use workspace credentials to create token$ tru oauth2:token# use project credentials to create token$ tru oauth2:token --project-dir path/to/project# assign a token to a variable in shell$ TOKEN=$(tru oauth2:token --project-dir path/to/project --no-header)$ echo $TOKENEmesua0F7gj3qOaav7UaKaBwefaaefaAxlrdGom_mb3U.78Od2d9XpvTQbd44eM1Uf7nzz9e9nezs5TRjPmpDnMc
tru phonechecks:create [PHONE_NUMBER]
Creates a PhoneCheck within a project
USAGE$ tru phonechecks:create [PHONE_NUMBER]ARGUMENTSPHONE_NUMBER The phone number to perform the Check onOPTIONS-h, --help show CLI help--debug Enables debug logging for the CLI--project-dir=project-dir The directory that contains the tru.json Project configuration file--skip-qrcode-handler Skips using the tru hosted QR code handler with the `check_url`--workflow Execute the Check Workflow from the CLI
tru phonechecks:list [CHECK_ID]
Lists details for all PhoneChecks or a specific PhoneCheck if the a check-id argument is passed
USAGE$ tru phonechecks:list [CHECK_ID]ARGUMENTSCHECK_ID The check_id for the PhoneCheck to listOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--page_number=page_number [default: 1] The page number to return in the list resource. Ignored if the "check_id"argument is used.--page_size=page_size [default: 10] The page size to return in list resource request. Ignored if the "check_id"argument is used.--project-dir=project-dir The directory that contains the tru.json Project configuration file--search=search A RSQL search query. To ensure correct parsing put your query in quotes. For example"--search 'status==COMPLETED'". Ignored if the "check_id" argument is used.--sort=sort Sort query in the form "{parameter_name},{direction}". For example, "created_at,asc" or"created_at,desc". Ignored if the "check_id" argument is used.
tru phonechecks:traces CHECK_ID
Get the traces of a PhoneCheck
USAGE$ tru phonechecks:traces CHECK_IDARGUMENTSCHECK_ID The check_id for which we want to get the tracesOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--project-dir=project-dir The directory that contains the tru.json Project configuration file--sort=sort property to sort by (prepend '-' for descending)--trace-id=trace-id The trace-id for which we want to get the logs
tru projects:create [NAME]
Creates a new Project
USAGE$ tru projects:create [NAME]ARGUMENTSNAME the name of the project to createOPTIONS-h, --help show CLI help--debug Enables debug logging for the CLI--mode=live|sandbox Set the project mode to "live" or "sandbox"--phonecheck-callback=phonecheck-callback set a callback to be invoked when a PhoneCheck reaches an end state--project-dir=project-dir The directory that contains the tru.json Project configuration file--quickstart Create a Project and also create a PhoneCheck in workflow mode.EXAMPLES$ tru projects:createWhat is the name of the project?: My first projectCreating Project "My first project"$ tru projects:create --phonecheck-callback https://example.com/callback$ tru projects:create --mode sandbox$ tru projects:create --mode live
tru projects:list [PROJECT_ID]
Lists details for all Projects or a Projects that match a given criteria
USAGE$ tru projects:list [PROJECT_ID]ARGUMENTSPROJECT_ID The project_id for the Project to retrieveOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--page_number=page_number [default: 1] The page number to return in the list resource. Ignored if the "project_id"argument is used.--page_size=page_size [default: 10] The page size to return in list resource request. Ignored if the "project_id"argument is used.--search=search A RSQL search query. To ensure correct parsing put your query in quotes. For example"--search 'name=p*'". Ignored if the "check_id" argument is used.--sort=sort Sort query in the form "{parameter_name},{direction}". For example, "created_at,asc" or"created_at,desc". Ignored if the "check_id" argument is used.
tru projects:update [PROJECT-ID]
Update an existing Project
USAGE$ tru projects:update [PROJECT-ID]ARGUMENTSPROJECT-ID the ID of the project to updateOPTIONS-h, --help show CLI help--debug Enables debug logging for the CLI--mode=live|sandbox Set the project mode to "live" or "sandbox"--phonecheck-callback=phonecheck-callback set a callback to be invoked when a PhoneCheck reaches an end state--project-dir=project-dir The directory that contains the tru.json Project configuration file--remove-phonecheck-callback remove the PhoneCheck callback configuration from the ProjectEXAMPLES$ tru projects:update --phonecheck-callback https://example.com/callback$ tru projects:update --remove-phonecheck-callback$ tru projects:update --mode sandbox$ tru projects:update --mode live
tru setup:credentials CLIENT-ID CLIENT-SECRET DATA-RESIDENCY
Setup the CLI with workspace credentials
USAGE$ tru setup:credentials CLIENT-ID CLIENT-SECRET DATA-RESIDENCYARGUMENTSCLIENT-ID the workspace credentials idCLIENT-SECRET the workspace credentials secretDATA-RESIDENCY the data residency of this workspace e.g. EU
tru simchecks:create [PHONE_NUMBER]
Create SIMChecks within a Project
USAGE$ tru simchecks:create [PHONE_NUMBER]ARGUMENTSPHONE_NUMBER The phone number to perform the SIMCheck onOPTIONS-h, --help show CLI help--debug Enables debug logging for the CLI--project-dir=project-dir The directory that contains the tru.json Project configuration file
tru simchecks:list [CHECK_ID]
Lists details for all SIMChecks or a specific SIMCheck if the a check-id argument is passed
USAGE$ tru simchecks:list [CHECK_ID]ARGUMENTSCHECK_ID The check_id for the SIMCheck to listOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--page_number=page_number [default: 1] The page number to return in the list resource. Ignored if the "check_id"argument is used.--page_size=page_size [default: 10] The page size to return in list resource request. Ignored if the "check_id"argument is used.--project-dir=project-dir The directory that contains the tru.json Project configuration file--search=search A RSQL search query. To ensure correct parsing put your query in quotes. For example"--search 'status==COMPLETED'". Ignored if the "check_id" argument is used.--sort=sort Sort query in the form "{parameter_name},{direction}". For example, "created_at,asc" or"created_at,desc". Ignored if the "check_id" argument is used.
tru simchecks:traces CHECK_ID
Get the traces of a SIMCheck
USAGE$ tru simchecks:traces CHECK_IDARGUMENTSCHECK_ID The check_id for which we want to get the tracesOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--project-dir=project-dir The directory that contains the tru.json Project configuration file--sort=sort property to sort by (prepend '-' for descending)--trace-id=trace-id The trace-id for which we want to get the logs
tru subscriberchecks:create [PHONE_NUMBER]
Creates SubscriberChecks within a project
USAGE$ tru subscriberchecks:create [PHONE_NUMBER]ARGUMENTSPHONE_NUMBER The phone number to perform the Check onOPTIONS-h, --help show CLI help--debug Enables debug logging for the CLI--project-dir=project-dir The directory that contains the tru.json Project configuration file--skip-qrcode-handler Skips using the tru hosted QR code handler with the `check_url`--workflow Execute the Check Workflow from the CLI
tru subscriberchecks:list [CHECK_ID]
Lists details for all SubscriberChecks or a specific SubscriberCheck if the a check-id argument is passed
USAGE$ tru subscriberchecks:list [CHECK_ID]ARGUMENTSCHECK_ID The check_id for the SubscriberCheck to listOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--page_number=page_number [default: 1] The page number to return in the list resource. Ignored if the "check_id"argument is used.--page_size=page_size [default: 10] The page size to return in list resource request. Ignored if the "check_id"argument is used.--project-dir=project-dir The directory that contains the tru.json Project configuration file--search=search A RSQL search query. To ensure correct parsing put your query in quotes. For example"--search 'status==COMPLETED'". Ignored if the "check_id" argument is used.--sort=sort Sort query in the form "{parameter_name},{direction}". For example, "created_at,asc" or"created_at,desc". Ignored if the "check_id" argument is used.
tru subscriberchecks:traces CHECK_ID
Get the traces of a SubscriberCheck
USAGE$ tru subscriberchecks:traces CHECK_IDARGUMENTSCHECK_ID The check_id for which we want to get the tracesOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--project-dir=project-dir The directory that contains the tru.json Project configuration file--sort=sort property to sort by (prepend '-' for descending)--trace-id=trace-id The trace-id for which we want to get the logs
tru usage:daily
Get Daily Usage. The date range defaults to current date.
USAGE$ tru usage:dailyOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--group-by=group-by Group results by one or more fields e.g product_id or project_id or product_id,project_id--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--page_number=page_number [default: 1] The page number to return in the list resource.--page_size=page_size [default: 10] The page size to return in list resource request.--search=search The RSQL query for usage. date is required e.g --search='date>=2021-03-29'--sort=sort property to sort by (prepend '-' for descending)
tru usage:hourly
Get Hourly Usage. The date range defaults to current date.
USAGE$ tru usage:hourlyOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--group-by=group-by Group results by one or more fields e.g product_id or project_id or product_id,project_id--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--page_number=page_number [default: 1] The page number to return in the list resource.--page_size=page_size [default: 10] The page size to return in list resource request.--search=search The RSQL query for usage. date is required e.g --search='date>=2021-03-29'--sort=sort property to sort by (prepend '-' for descending)
tru usage:monthly
Get Monthly Usage. The date range defaults to the current calendar month.
USAGE$ tru usage:monthlyOPTIONS-h, --help show CLI help-x, --extended show extra columns--columns=columns only show provided columns (comma-separated)--csv output is csv format [alias: --output=csv]--debug Enables debug logging for the CLI--filter=filter filter property by partial string matching, ex: name=foo--group-by=group-by Group results by one or more fields e.g product_id or project_id or product_id,project_id--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format--page_number=page_number [default: 1] The page number to return in the list resource.--page_size=page_size [default: 10] The page size to return in list resource request.--search=search The RSQL query for usage. date is required e.g --search='date>=2021-03-29'--sort=sort property to sort by (prepend '-' for descending)
tru workspaces
Displays default workspace information
USAGE$ tru workspacesOPTIONS-h, --help show CLI help--debug Enables debug logging for the CLI--no-header hide table header from output--no-truncate do not truncate output to fit screen--output=csv|json|yaml output in a more machine friendly format