mpr - Wrapper for MicroPython mpremote tool

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
bulletmark
Posts: 59
Joined: Mon Mar 29, 2021 1:36 am
Location: Brisbane Australia

mpr - Wrapper for MicroPython mpremote tool

Post by bulletmark » Sat Jun 25, 2022 5:36 am

The mpremote command line tool works well but personally I am not a big fan of it's user interface. So I have created a wrapper which gives it a more conventional interface and unlike mpremote it also offers full help/usage for every command. Others may be interested so read about and get it from https://github.com/bulletmark/mpr.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: mpr - Wrapper for MicroPython mpremote tool

Post by jimmo » Mon Jun 27, 2022 3:03 am

bulletmark wrote:
Sat Jun 25, 2022 5:36 am
Others may be interested so read about and get it from https://github.com/bulletmark/mpr.
Neat!

It's true that the mpremote UI is very much based on the workflow that Damien (and I) use for developing MicroPython. For example there was some deliberation about whether it should be (for example) "mpremote fs --cp src dest" or "mpremote fs cp src dest". Tools like Docker with the "docker <command> <subcommand>" were kind of the inspiration. The chaining is a bit weird though agreed for sure, and adding an explicit delimiter between commands would be useful in some situations, but I do find myself using it a lot especially when I need to manage whether a soft-reset happens in between.

The : in mpremote is clearly inspired by ssh, that's why there's no explicit put-vs-get commands.

I like what you've done with the help and the recursive directory handling. Both things we plan to add to mpremote.

As far as the connect handing, our intention is that either there's a single board connected, in which case it's automatic (although obviously the rules for that need work, especially on non-Linux), or you're switching between multiple boards, in which case you've made aliases for them in ~/.config/mpremote/config.py.

Either way, nice work! (And PRs always welcome to mpremote of course! One thing I'd love to see if better support for using mpremote as a library for other tools / automation, e.g. recently discussed viewtopic.php?f=15&t=12504&p=67845&#p68116 ).

Post Reply