srig-cli

command module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

srig-cli

CLI tool for the SiliconRig Hardware-as-a-Service platform.

Flash firmware, open serial terminals, and run CI/CD tests on real embedded boards, all from your terminal.

Install

curl -fsSL https://siliconrig.dev/install.sh | sh

Or download a binary from Releases, or build from source:

go install github.com/raws-labs/srig-cli@latest

Authentication

export SRIG_API_KEY=key_...

Or pass --api-key to any command.

First run

No toolchain, and no board on your desk:

curl -LO https://github.com/raws-labs/srig-examples/releases/latest/download/demo-shell-esp32-s3.bin
srig run demo-shell-esp32-s3.bin --board esp32-s3 --expect "0 failed"

srig run reserves a board, flashes it, watches the serial output for the pattern, ends the session, and exits 0 on a match. That exit code is the whole CI integration.

Commands

srig status                           Show board availability
srig session create --board TYPE      Start a session
srig session list                     List your sessions
srig session end [ID]                 End a session (auto-detects active)
srig flash <firmware>                 Flash firmware to the board
srig run <firmware> --board TYPE      Flash, watch serial, and assert (one-shot, CI-ready exit code)
srig record <firmware> --board TYPE   Record a run and get a shareable link and badge
srig serial                           Open serial terminal (Ctrl+] to exit)
srig power-cycle                      Power cycle the board
srig whoami                           Show your account info
srig version                          Print CLI version

srig flash accepts a raw .bin (all boards), a .uf2 (rp2350), or, for STM32 boards, an .elf / Intel .hex, auto-converted client-side to a raw image before upload (must be linked at the 0x08000000 flash base).

srig run

Create a session, flash, watch serial output for a pass/fail condition, then end the session, all in one command, with an exit code your CI can act on directly:

srig run firmware.bin --board esp32-s3 --expect "All tests passed"

A serial line ##srig-exit:N## sets the exit code to N directly; otherwise --fail (regex) fails the run immediately, and --expect (regex) must match before --timeout (default 60s). Exit codes: 0 pass, 1 test failed/timeout, 2 infrastructure error, 130 interrupted. Use --retries / --retry-delay to ride out transient infra failures (e.g. no free board). Test failures are never retried. See srig run --help for all flags (--send, --log, --json, etc.).

srig record

Run firmware on a free board, record the flash, the boot and everything the board prints, and publish the recording as a run record. It prints a link anyone can open to play the run back, plus a "Run on SiliconRig" badge for a README:

srig record bench.elf --board stm32-h753 --name "Inference benchmark" --seconds 30

The page shows what the run ran on: the firmware hash, the board, and the platform versions. --send is written to the board once it has booted and gone quiet. The run is a session of yours and uses credits like one. Exit codes: 0 recorded, 1 the recording failed, 2 infrastructure error.

Flags

Flag Env Description
--api-key SRIG_API_KEY API key
--base-url SRIG_BASE_URL API base URL (default: https://api.srig.io)
--json JSON output for scripting/CI

CI/CD Usage

- name: Flash and test
  env:
    SRIG_API_KEY: ${{ secrets.SRIG_API_KEY }}
  run: |
    srig session create --board esp32-s3
    srig flash firmware.bin
    srig serial --timeout 30s --log output.txt
    srig session end

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package firmware converts user-supplied firmware artifacts (ELF, Intel HEX, raw binary) into the flashable bytes the pod expects for a given board.
Package firmware converts user-supplied firmware artifacts (ELF, Intel HEX, raw binary) into the flashable bytes the pod expects for a given board.
Package runner decides pass/fail for `srig run` from streamed serial output.
Package runner decides pass/fail for `srig run` from streamed serial output.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL