Description
The core workflow needs some simplification of its commands with some config additions. I apologize if these are already in the pipeline.
The core workflow for most sketches is something like this:
- create sketch
- edit sketch
- choose board
- choose port
- verify and upload sketch to board
1, 2, and 4 are generally once-per-sketch tasks, while 2 and 5 are generally done repeatedly.
Right now, it looks like this:
$ arduino-cli sketch new cliSketch
$ open ~/Documents/Arduino/cliSketch/cliSketch.ino # open is a placeholder for your favorite editor
$ arduino-cli board list
$ arduino-cli board attach /dev/cu.usbmodem14121 cliSketch/cliSketch.ino
$arduino-cli compile --fqbn arduino:avr:uno ~/Documents/Arduino/cliSketch/
$ arduino-cli upload --fqbn arduino:avr:uno -p /dev/cu.usbmodem14121 ~/Documents/Arduino/cliSketch2/
This can get shorter if you use the menus from the GUI as a guide (loosely), and use some shortcut names. For example:
$ arduino-cli sketch new cliSketch
should set the current working directory for the cli, so that cliSketch is auto-expanded in any command that uses it. shortcut: s -n
$ arduino-cli sketch
with no parameters could list the current sketch and CWD
$ arduino-cli port set /dev/cu.usbmodem14121
could set the working port for the cli, or for this sketch Follows the tools --> port menu behavior shortcut p -s
$ arduino-cli port
with no parameters could list the current port
$ arduino-cli board set arduino:avr:uno
could set the working board for the cli or for this sketch. Follows the tools --> board menu behavior. Shortcut: b -s.
$ arduino-cli board
with no parameters could list the current board
$ arduino-cli verify
, with the current working directory set, could mirror the action of the current sketch --> verify/Compile, and be an alias for compile
$ arduino-cli upload
, with the current working directory, board, and port set could mirror the action of the current sketch --> verify and upload
If either verify
or upload
are called without board or port set, the cli should generate an appropriate error of course.