Git Product home page Git Product logo

tinyhelper's Introduction

TinyHelper

A CLI Util for TinyGo

Prerequisites

TinyGo

Requires TinyGo to be installed, see https://tinygo.org/getting-started/install/ for the installation guide.

Direnv

Requires direnv to be installed, see https://direnv.net/docs/installation.html for the installation guide.

Instillation

go install github.com/gordcurrie/tinyhelper@latest

Usage

Tool for helping configure tinygo

Usage:
  tinyhelper [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  env         Configures .envrc
  flash       Flash target device
  help        Help about any command

Flags:
  -h, --help            help for tinyhelper
  -z, --helpz           tinygo help
  -t, --target string   target hardware
  -u, --update          update target

Use "tinyhelper [command] --help" for more information about a command.

env command

tinyhelper env [-t {target}] [-u]

Creates a .envrc file with GOROOT and GOFLAGS configured for your environment and target device.

If target flag is passed with use to set target. If not passed and existing TH_TARGET env var is set will use it as target. Else will prompt for target selection.

Update flag will prompt for selecting new target even if target is already set.

Example generated .envrc

# TinyHelper START
export GOROOT=/home/gord/.cache/tinygo/goroot-d3a5eae46885c758dc170cc3b2ebb723ef9c0181c18efbe4c5dc3ba26d61a5ae
export GOFLAGS=-tags=cortexm,baremetal,linux,arm,rp2040,rp,pico,tinygo,math_big_pure_go,gc.conservative,scheduler.tasks,serial.usb
export TH_TARGET=pico
# TinyHelper END

TinyHelper

flash command

tinyhlelper  flash [-t {target}][args] [-u]

Runs the TinyGo flash command, will accept and any valid arguments for TinyGo flash. Will use preconfigured target if set or prompt for target if not set.

Update flag will prompt for selecting new target even if target is already set.

log command

tinyhelper log

Dumps logs from USB serial connection to standard out. First iteration might be sketchy.

Development

dev mode

If running via cli via go run main.go env TinyHelper will detect it is in dev mode and will output to .envrc.temp to prevent overwriting of Go environment.

Configure .envrc

From the root the project run, add export TH_TARGET=pico to your existing .envrc file or create a new file with the following command from the root of the project.

echo "export TH_TARGET=pico" > .envrc

tinyhelper's People

Contributors

gordcurrie avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.