See newtmgr.dart for newtmgr converted from Go to Dart.
Newt Manager (newtmgr) is the application tool that enables a user to communicate with and manage remote devices running the Mynewt OS. It uses a connection profile to establish a connection with a device and sends command requests to the device. The newtmgr tool documentation can be found under /docs which are published at http://mynewt.apache.org/latest/os/modules/devmgmt/newtmgr.html
Build and run the newtmgr tool as follows:
sudo apt install graphviz
# Download Newt Manager on Raspberry Pi or Pinebook Pro
cd ~/go
mkdir -p src/mynewt.apache.org
cd src/mynewt.apache.org/
git clone https://github.com/lupyuen/mynewt-newtmgr
mv mynewt-newtmgr newtmgr
# Build Newt Manager on Raspberry Pi or Pinebook Pro
cd ~/go/src/mynewt.apache.org/newtmgr/newtmgr
export GO111MODULE=on
go build
# Run Newt Manager on Raspberry Pi or Pinebook Pro
cd ~/go/src/mynewt.apache.org/newtmgr/newtmgr
sudo ./newtmgr conn add pinetime type=ble connstring="peer_name=pinetime" 2> /dev/null
sudo ./newtmgr image list -c pinetime 2> trace.out
go tool trace trace.out