Page 1 of 1

mpr - Wrapper for MicroPython mpremote tool

Posted: Sat Jun 25, 2022 5:36 am
by bulletmark
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.

Re: mpr - Wrapper for MicroPython mpremote tool

Posted: Mon Jun 27, 2022 3:03 am
by jimmo
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 ).