The Twilio CLI Microvisor Plugin
Microvisor Private Beta
Microvisor is in a pre-release phase and the information contained in this document is therefore provisional and subject to change. Some features referenced below may not yet be available in or supported by the current version of the Microvisor system calls or REST API.
Current version: 0.3.0
This utility adds Microvisor-oriented functionality to the Twilio CLI tool.
Installation
Prerequisites
The Microvisor plugin requires Twilio CLI. You can find full instructions for your platform in the Twilio CLI Quickstart guide.
Install the plugin
Run the following command:
twilio plugins:install @twilio/plugin-microvisor
Installing the plugin may result in a number of warnings being output by the installer. We are working to address this.
Update the plugin
After installation, you can keep the plugin up to date by running:
twilio plugins:update
We expect to make a number of improvements to the plugin as Microvisor continues through its pre-release phases and moves toward General Availability. We strongly recommend that you keep your installed plugin updated by running the command shown above regularly.
Usage
The plugin operates with commands and sub-commands, separated by colons, and entered this way:
twilio microvisor:<COMMAND>:<SUB_COMMAND>
The plugin provides the following commands:
logs
The logs
command provides the following sub-commands:
stream
— Initiate log streaming. It takes as its argument a device SID — the Microvisor-enabled device from which you wish to receive log messages:
twilio microvisor:logs:stream $MV_DEVICE_SID
If you specify a device that isn’t associated with your account, anUnknown device SID
error will be thrown.
Your call may also include the--output
flag, which is used to output log messages either in plain text (the default) or in JSON format:
twilio microvisor:logs:stream $MV_DEVICE_SID --output=json
If you select JSON output, you can pipe the output of the command through the JQ utility to present the JSON in a more reader-friendly form:
twilio microvisor:logs:stream $MV_DEVICE_SID --output=json | jq
The contents of the JSON payload are described below. The plain text output is the value of a message object’s
message
property.
debug
The debug
command has no sub-commands. It takes a device SID and a path to a remote debugging private key as its arguments. For more information on why this key is required and how it is generated, please see Microvisor Remote Debugging.
twilio microvisor:debug $MV_DEVICE_SID </path/to/your/private/key.pem>
Your call may also include the --listen-port
flag, which is used to select the port through which debugging data will flow.
twilio microvisor:debug $MV_DEVICE_SID </path/to/your/private/key.pem> \
--listen-port=<PORT_NUMBER>
The default port is 8001
. If you specify an alternative port number, you will need to update your .gdbinit
file or run the command
target remote localhost:<PORT_NUMBER>
within gdb
.
The properties included in the log messages output as JSON is still being defined and is therefore subject to change. You should not build against the following description, which is intended for information purposes only.
You can optionally set the log:stream
command to output log messages in their source form, which is JSON. The default output mode emits the value of one of the JSON’s properties, message
. The other properties can be accessed by adding --output=json
to the command.
Property Name | Value(s) | Notes |
---|---|---|
category |
connection |
Device-cloud connection status |
app_logging |
Application logging messages | |
message |
Text | The exact message depends on the value of category . App logging values are the text issued by the application using mvServerLog() . Connection messages indicate connection status updates |
timestamp |
A Unix timestamp | The date and time at which the message was emitted by Twilio |
Changelog
0.3.0 July 29, 2022
- Support Microvisor application logging system calls.
0.2.0 May 24, 2022
- Support Microvisor remote debugging with
debug
command. - Use end-to-end encryption for remote debugging sessions. BREAKING CHANGE
0.1.0-0.1.2 April 27, 2022
- Initial release and follow-up bug-fixes.
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.