Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
mctl
: Command-line Interface for MicroPython Devicesmctl devices
mctl repl
mctl ls
, mctl rm
, mctl put
, mctl get
, mctl mkdir
mctl sync
(only uploads changed files)mctl edit <filename>
mctl reset
mctl run <script_or_file>
mctl repl
connection to run mctl
commands in another terminal at the same timemctl mount
(experimental!)mctl help
Code: cli/index.ts
mctl
is included in the micropython-ctl
npm package. You can also install it via the mctl
npm package:
npm install -g mctl
$ mctl help
Usage: index [options] [command]
Options:
-t, --tty <device> Connect over serial interface (eg. /dev/tty.SLAB_USBtoUART)
-h, --host <host> Connect over network to hostname or IP of device
-p, --password <password> Password for network device
-s, --silent Hide unnecessary output
--help display help for command
Commands:
devices List serial devices
repl Open a REPL terminal
run <fileOrCommand> Execute a Python file or command
info [options] Get information about the board (versions, unique id, space, memory)
ls [options] [directory] List files on a device
cat <filename> Print content of a file on the device
get <file_or_dirname> [out_file_or_dirname] Download a file or directory from the device. Download everything with 'get /'
put [options] <file_or_dirname> [dest_file_or_dirname] Upload a file or directory onto the device
sync [directory] Sync a local directory onto the device root (upload new/changes files, delete missing)
edit <filename> Edit a file, and if changed upload afterwards
mkdir <name> Create a directory
rm [options] <path> Delete a file or directory
mv <oldPath> <newPath> Rename a file or directory
sha256 <filename> Get the SHA256 hash of a file
reset [options] Reset the MicroPython device
mount [targetPath] Mount a MicroPython device (over serial or network)
run-tests Run micropython-ctl tests on a device
version Print the version of mctl
help [command] display help for command
Device connection logic:
--host
or --tty
optionMCTL_TTY
env var: serial connectionMCTL_HOST
env var: network connectionAMPY_PORT
env var: serial connectionWEBREPL_HOST
env var: network connectionFor network connection passwords, the env vars MCTL_PASSWORD
and WEBREPL_PASSWORD
can be used.
# List serial devices
mctl devices
# By default connect to first serial device
mctl info
# Connect over specific serial device
mctl -t /dev/USB0 info
# Connect over network
mctl -h DEVICE_IP -p WEBREPL_PASSWORD info
# Get information about the board
mctl info
# Enter the REPL
mctl repl
# List files
mctl ls # list all files in /
mctl ls foo/ # list all files in /foo/
mctl ls -r # recursively list all files and directories
mctl ls -r --json # output as json
mctl ls -r --include-hash --json # output as json, include sha256 hash of each file
# Print contents of boot.py
mctl cat boot.py
# Download all files and directories recursively, into the current directory
mctl get /
# Download all files and directories recursively, into /tmp/
mctl get / /tmp/
# Upload a file
mctl put boot.py
# Upload all Python scripts
mctl put "*.py"
# Upload everything recursively
mctl put .
# Synchronize current local directory onto the device (upload only changed files, remove deleted files)
mctl sync
# Synchronize specific current local directory onto the device
mctl sync <directory>
# Edit a file and upload only if changed
mctl edit boot.py
ls -r --json --include-hash
:
[
{
"filename": "/",
"size": 0,
"isDir": true,
"mTime": 0
},
{
"filename": "/boot.py",
"size": 139,
"isDir": false,
"mTime": 0,
"sha256": "16f5b4bcb120e9a032242b47967e649a0cc577b41939e81ef7d4b4da181bd17f"
},
{
"filename": "/main.py",
"size": 1810,
"isDir": false,
"mTime": 14,
"sha256": "936d92994d0b86eb0e60efd053e12d009d718af3894d7f5c16303b1d7c526306"
}
]
# Mount device onto local filesystem (experimental, only works with python files)
mctl mount
mctl mount
FAQs
mctl: MicroPython-Ctl command line utility
The npm package mctl receives a total of 2 weekly downloads. As such, mctl popularity was classified as not popular.
We found that mctl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.