Skip to content

Latest commit

 

History

History
128 lines (83 loc) · 2.55 KB

README.md

File metadata and controls

128 lines (83 loc) · 2.55 KB

mecha command line interface tool

What it does

Command line interface to creating new Mechanoid projects, flashing boards, and more.

How to install

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

How to use

$ 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

New project

mecha new project example.com/myproject

New project based on template

mecha new project -t=blink example.com/myproject

New module

mecha new module mymodule

New TinyGo WASM module based on template

mecha new module -t=blink mymodule

New Rust WASM module based on template

mecha new module -t=pingrs -type=rust pingrs

New Zig WASM module based on template

mecha new module -t=pingzig -type=zig pingzig

Build modules in current project

mecha build

or

mecha build modules

Build application for current project

mecha build project

Using mecha with Rust

If you want to use the mecha command with Rust, you will need to install Rust as follows.

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.

Using mecha with Zig

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.