The Meadow Command-Line-Interface (Meadow.CLI
) provides a way to interact with the board and perform functions via a terminal/command-line window.
The Meadow.CLI tool supports deployment workflows as well as device and file management including file transfers, and MCU reset.
In addition to being able to be used from a terminal window, the Meadow.CLI.Core
library can also be used programmatically, within a .NET application. In fact, the IDE extensions use that directly. You can find the source here.
Installation and Updating
Meadow.CLI
can be installed via the dotnet
tool from a nuget package at the terminal:
dotnet tool install WildernessLabs.Meadow.CLI --global
To update, simply change the install
keyword to update
:
dotnet tool update Wildernesslabs.Meadow.CLI --global
Executing Commands
Once installed, Meadow.CLI is accessible from a terminal prompt via the meadow
command, and command arguments are passed via a fluent syntax, for instance, the following command will download the latest Meadow.OS:
meadow download os
Enumerating Commands & Help
This guide covers a few of the most common commands, but there are many more to explore. For a complete list of commands, execute the following from a terminal window:
meadow -h
Additionally, you can get additional help information for any given command by passing -h
as option to that command. For instance, the following will provide guidance on the listen
command:
meadow listen -h
Working with Ports
When a Meadow device is hooked up to a host computer, it exposes it communicates via a serial port (e.g. COM3
on Windows or UART3
on macOS/Linux) over USB. If you only have one Meadow device plugged in, Meadow.CLI will attempt to locate the port and send commands via that. However, if you have multiple devices, you may need to manually specify the port.
To list serial ports, execute the following:
meadow list ports
You can then specify the port via the -s
option when executing commands. For example, the following command will print application output on a specific port to the terminal:
meadow listen -s /dev/tty.usbmodem336F336D30361
You only need to specify the port once; all subsequent commands will remember the specified port.
Common Tasks
Download the Latest Meadow.OS and Flash to the Device
To download the latest Meadow.OS, execute the following:
meadow download os
Once it’s downloaded, it can be deployed to the device by executing the following:
meadow flash os
Deploy a Meadow App
To deploy an app to the device, execute the following, replacing [Path] with the path to your app.exe
:
meadow app deploy -f [Path]/app.exe
Working with Files
Listing Files on the Device
To get a list of all the files on the device, execute the following:
meadow file list
Writing a File to the Device
To write a file, or files, to the device execute the following, replacing [Filename] with the full path of the file to write:
meadow file write -f [Filename]
Multiple files can be specified with multiple -f
parameters:
meadow file write -f [Filename1] -f [Filename2]
Delete a File from the Device
Files can also be deleted:
meadow file delete -f [Filename]
As with file uploading, multiple files can be specified with multiple -f
parameters:
meadow file delete -f [Filename1] -f [Filename2]
All of the files on the file system can be deleted without reformatting the flash:
meadow file delete all
Get Meadow’s device information
To get information about the device, including OS version, execute the following:
meadow device info