Command line interface to creating new Mechanoid projects, flashing boards, and more.
You need to have TinyGo installed to use the mecha
command.
See https://tinygo.org/getting-started/
In addition you need to install the gonew
command:
go install golang.org/x/tools/cmd/gonew@latest
You can then install mecha
:
go install github.com/hybridgroup/mechanoid/cmd/mecha@latest
$ mecha
NAME:
mecha - Mechanoid CLI
USAGE:
mecha [global options] command [command options]
VERSION:
0.2.0-dev
COMMANDS:
new Create new Mechanoid project or module
build Build binary files for Mechanoid project and/or modules
flash Flash Mechanoid project to hardware
run Run code for Mechanoid project
test Run tests for Mechanoid project
monitor Monitor connection to hardware using the serial port
about About Mechanoid
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
mecha new project example.com/myproject
mecha new project -t=blink example.com/myproject
mecha new module mymodule
mecha new module -t=blink mymodule
mecha new module -t=pingrs -type=rust pingrs
mecha new module -t=pingzig -type=zig pingzig
mecha build
or
mecha build modules
mecha build project
If you want to use the mecha
command with Rust, you will need to install Rust as follows.
-
First install Rust by using the instructions here: https://www.rust-lang.org/tools/install
-
Then, install the Rust
wasm32-unknown-unknown
target.
rustup target add wasm32-unknown-unknown
Any Rust modules in your project's modules
directory should be automatically built when you run the mecha build
command.
If you want to use the mecha
command with Zig, you will need to install Zig 0.11.0 by using the instructions here: https://ziglang.org/learn/getting-started/#installing-zig
Any Zig modules in your project's modules
directory should be automatically built when you run the mecha build
command.