Basic command line example using golang grpc client tools

This is a basic command line interface that demonstrates using the golang GRPC API.

The API is reused between dishy and the wifi router, however both servers do not implement all the APIs. The basic-cli demonstrates that the status API works on dishy, but not on the router. Conversely, ping works on the router, but not dishy.

$ go get github.com/starlink-community/starlink-cli/cmd/basic-cli
$ basic-cli -h
Usage of basic-cli:
  -addr string
    	grpc addr (dishy is at 192.168.100.1:9200, wifi is at 192.168.1.1:9000 (default "192.168.100.1:9200")
  -req string
    	status or ping (default "status")
$ basic-cli 
dish_get_status: <
  device_info: <
    id: "ut01000000-00000000-00001234"
    hardware_version: "rev1_pre_production"
    software_version: "e68dfc80-fa1a-4fa4-9b21-d7ee2a918496.release"
    country_code: "US"
  >
  device_state: <
    uptime_s: 312929
  >
  state: CONNECTED
  alerts: <
  >
  snr: 9
  downlink_throughput_bps: 5737.808
  uplink_throughput_bps: 1006.63293
  pop_ping_latency_ms: 29.75
  obstruction_stats: <
    last_24h_obstructed_s: 4
    valid_s: 61838.32
    wedge_fraction_obstructed: 0
    wedge_fraction_obstructed: 0
    wedge_fraction_obstructed: 0
    wedge_fraction_obstructed: 0
    wedge_fraction_obstructed: 0
    wedge_fraction_obstructed: 0
    wedge_fraction_obstructed: 0
    wedge_fraction_obstructed: 0
    wedge_fraction_obstructed: 0
    wedge_fraction_obstructed: 0
    wedge_fraction_obstructed: 0
    wedge_fraction_obstructed: 0
    wedge_abs_fraction_obstructed: 0
    wedge_abs_fraction_obstructed: 0
    wedge_abs_fraction_obstructed: 0
    wedge_abs_fraction_obstructed: 0
    wedge_abs_fraction_obstructed: 0
    wedge_abs_fraction_obstructed: 0
    wedge_abs_fraction_obstructed: 0
    wedge_abs_fraction_obstructed: 0
    wedge_abs_fraction_obstructed: 0
    wedge_abs_fraction_obstructed: 0
    wedge_abs_fraction_obstructed: 0
    wedge_abs_fraction_obstructed: 0
  >
>

$ basic-cli -req ping -addr 192.168.1.1:9000
get_ping: <
  results: <
    key: "103.10.124.1"
    value: <
      target: <
        service: "Counter-Strike: GO"
        location: "Singapore"
        address: "103.10.124.1"
      >
      dropRate: 0.4
      latencyMs: 217.1374
    >
  >
  results: <
    key: "103.10.125.1"
    value: <
      target: <
        service: "Counter-Strike: GO"
        location: "Sydney"
        address: "103.10.125.1"
      >
      dropRate: 1
    >
  >
  results: <
    key: "104.160.131.3"
    value: <
      target: <
        service: "League of Legends"
        location: "Chicago"
        address: "104.160.131.3"
      >
      dropRate: 1
    >
  >
  results: <
    key: "104.160.136.3"
    value: <
      target: <
        service: "League of Legends"
        location: "Los Angeles"
        address: "104.160.136.3"
      >
      dropRate: 1
    >
  >
  results: <
    key: "104.160.141.3"
    value: <
      target: <
        service: "League of Legends"
        location: "Amsterdam"
        address: "104.160.141.3"
      >
      dropRate: 1
    >
  >
  results: <
    key: "104.160.142.3"
    value: <
      target: <
        service: "League of Legends"
        location: "Frankfurt"
        address: "104.160.142.3"
      >
      dropRate: 1
    >
  >
  results: <
    key: "104.160.156.1"
    value: <
      target: <
        service: "League of Legends"
        location: "Sydney"
        address: "104.160.156.1"
      >
      dropRate: 1
    >
  >
  results: <
    key: "146.66.152.1"
    value: <
      target: <
        service: "Counter-Strike: GO"
        location: "Luxemborg"
        address: "146.66.152.1"
      >
      dropRate: 1
    >
  >
  results: <
    key: "146.66.155.1"
    value: <
      target: <
        service: "Counter-Strike: GO"
        location: "Vienna"
        address: "146.66.155.1"
      >
      dropRate: 0.4
      latencyMs: 210.87733
    >
  >
  results: <
    key: "146.66.156.1"
    value: <
      target: <
        service: "Counter-Strike: GO"
        location: "Stockholm"
        address: "146.66.156.1"
      >
      dropRate: 1
    >
  >
  results: <
    key: "185.25.183.1"
    value: <
      target: <
        service: "Counter-Strike: GO"
        location: "Dubai"
        address: "185.25.183.1"
      >
      dropRate: 0.6
      latencyMs: 335.9776
    >
  >
  results: <
    key: "192.168.100.1"
    value: <
      target: <
        service: "Your Starlink"
        address: "192.168.100.1"
      >
      latencyMs: 31.793804
    >
  >
  results: <
    key: "192.69.96.1"
    value: <
      target: <
        service: "Counter-Strike: GO"
        location: "Seattle"
        address: "192.69.96.1"
      >
      latencyMs: 61.9395
    >
  >
  results: <
    key: "197.80.200.1"
    value: <
      target: <
        service: "Counter-Strike: GO"
        location: "Johannesburg"
        address: "197.80.200.1"
      >
      dropRate: 0.6
      latencyMs: 371.28906
    >
  >
  results: <
    key: "208.78.164.1"
    value: <
      target: <
        service: "Counter-Strike: GO"
        location: "Virginia"
        address: "208.78.164.1"
      >
      dropRate: 0.2
      latencyMs: 149.59204
    >
  >
  results: <
    key: "209.197.29.1"
    value: <
      target: <
        service: "Counter-Strike: GO"
        location: "S\303\243o Paulo"
        address: "209.197.29.1"
      >
      dropRate: 1
    >
  >
  results: <
    key: "dynamodb.ap-east-1.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Hong Kong"
        address: "dynamodb.ap-east-1.amazonaws.com"
      >
      dropRate: 0.2
      latencyMs: 189.16917
    >
  >
  results: <
    key: "dynamodb.ap-northeast-1.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Tokyo"
        address: "dynamodb.ap-northeast-1.amazonaws.com"
      >
      dropRate: 0.2
      latencyMs: 169.83228
    >
  >
  results: <
    key: "dynamodb.ap-northeast-2.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Seoul"
        address: "dynamodb.ap-northeast-2.amazonaws.com"
      >
      dropRate: 0.4
      latencyMs: 229.78513
    >
  >
  results: <
    key: "dynamodb.ap-northeast-3.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Osaka"
        address: "dynamodb.ap-northeast-3.amazonaws.com"
      >
      dropRate: 0.4
      latencyMs: 171.29086
    >
  >
  results: <
    key: "dynamodb.ap-south-1.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Mumbai"
        address: "dynamodb.ap-south-1.amazonaws.com"
      >
      dropRate: 0.6
      latencyMs: 306.35556
    >
  >
  results: <
    key: "dynamodb.ap-southeast-1.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Singapore"
        address: "dynamodb.ap-southeast-1.amazonaws.com"
      >
      dropRate: 0.4
      latencyMs: 229.85423
    >
  >
  results: <
    key: "dynamodb.ap-southeast-2.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Sydney"
        address: "dynamodb.ap-southeast-2.amazonaws.com"
      >
      dropRate: 0.6
      latencyMs: 248.15205
    >
  >
  results: <
    key: "dynamodb.ca-central-1.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Montreal"
        address: "dynamodb.ca-central-1.amazonaws.com"
      >
      dropRate: 0.2
      latencyMs: 154.19655
    >
  >
  results: <
    key: "dynamodb.cn-north-1.amazonaws.com.cn"
    value: <
      target: <
        service: "Fortnite"
        location: "Beijing"
        address: "dynamodb.cn-north-1.amazonaws.com.cn"
      >
      dropRate: 0.6
      latencyMs: 332.88885
    >
  >
  results: <
    key: "dynamodb.cn-northwest-1.amazonaws.com.cn"
    value: <
      target: <
        service: "Fortnite"
        location: "Ningxia"
        address: "dynamodb.cn-northwest-1.amazonaws.com.cn"
      >
      dropRate: 0.4
      latencyMs: 307.33124
    >
  >
  results: <
    key: "dynamodb.eu-central-1.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Frankfurt"
        address: "dynamodb.eu-central-1.amazonaws.com"
      >
      dropRate: 0.4
      latencyMs: 223.75505
    >
  >
  results: <
    key: "dynamodb.eu-north-1.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Stockholm"
        address: "dynamodb.eu-north-1.amazonaws.com"
      >
      dropRate: 0.4
      latencyMs: 222.32887
    >
  >
  results: <
    key: "dynamodb.eu-west-1.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Ireland"
        address: "dynamodb.eu-west-1.amazonaws.com"
      >
      dropRate: 0.4
      latencyMs: 252.07127
    >
  >
  results: <
    key: "dynamodb.eu-west-2.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "London"
        address: "dynamodb.eu-west-2.amazonaws.com"
      >
      dropRate: 0.2
      latencyMs: 183.14899
    >
  >
  results: <
    key: "dynamodb.eu-west-3.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Paris"
        address: "dynamodb.eu-west-3.amazonaws.com"
      >
      dropRate: 0.4
      latencyMs: 243.78366
    >
  >
  results: <
    key: "dynamodb.me-south-1.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Bahrain"
        address: "dynamodb.me-south-1.amazonaws.com"
      >
      dropRate: 0.4
      latencyMs: 322.5198
    >
  >
  results: <
    key: "dynamodb.sa-east-1.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "S\303\243o Paulo"
        address: "dynamodb.sa-east-1.amazonaws.com"
      >
      dropRate: 0.4
      latencyMs: 262.59018
    >
  >
  results: <
    key: "dynamodb.us-east-1.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Virginia"
        address: "dynamodb.us-east-1.amazonaws.com"
      >
      dropRate: 0.2
      latencyMs: 146.55888
    >
  >
  results: <
    key: "dynamodb.us-east-2.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Ohio"
        address: "dynamodb.us-east-2.amazonaws.com"
      >
      dropRate: 0.2
      latencyMs: 120.64577
    >
  >
  results: <
    key: "dynamodb.us-west-1.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "California"
        address: "dynamodb.us-west-1.amazonaws.com"
      >
      latencyMs: 84.610985
    >
  >
  results: <
    key: "dynamodb.us-west-2.amazonaws.com"
    value: <
      target: <
        service: "Fortnite"
        location: "Oregon"
        address: "dynamodb.us-west-2.amazonaws.com"
      >
      latencyMs: 55.702183
    >
  >
  results: <
    key: "google.com"
    value: <
      target: <
        service: "Google"
        address: "google.com"
      >
      dropRate: 0.2
      latencyMs: 51.706455
    >
  >
>
Owner
Unofficial Starlink tools and community
null
Similar Resources

Go-utils - Multiple tools and example for golang

go-utils Description Multiple tools and example for golang database : example to

Jan 1, 2022

A template and a functioning example for a basic JFrog CLI plugin

hello-frog About this plugin This plugin is a template and a functioning example for a basic JFrog CLI plugin. This README shows the expected structur

Dec 21, 2021

A template and a functioning example for a basic JFrog CLI plugin

hello-frog About this plugin This plugin is a template and a functioning example for a basic JFrog CLI plugin. This README shows the expected structur

Nov 26, 2021

Command -line graphql client written in golang

go-graphql-cli Command -line graphql client written in golang.

Nov 24, 2021

Gowebdav - A golang WebDAV client library and command line tool.

GoWebDAV A golang WebDAV client library. Main features gowebdav library allows to perform following actions on the remote WebDAV server: create path g

Jan 3, 2023

Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.

Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.

asciigraph Go package to make lightweight ASCII line graphs ╭┈╯. Installation go get github.com/guptarohit/asciigraph Usage Basic graph package main

Jan 8, 2023

git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

Table of contents Introduction Reference Contributing Introduction Overview git-xargs is a command-line tool (CLI) for making updates across multiple

Dec 31, 2022

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command. You give git-xargs:

Feb 5, 2022

Package command provide simple API to create modern command-line interface

Package command Package command provide simple API to create modern command-line interface, mainly for lightweight usage, inspired by cobra Usage pack

Jan 16, 2022
Comments
  • WIP: update starlink-grpc-go protos, fix build.

    WIP: update starlink-grpc-go protos, fix build.

    The project fails to build with the current go.mod/go.sum version for the starlink-grpc-go dependency (see https://github.com/starlink-community/starlink-cli/issues/1). This can be side-stepped by pointing at the right commit of starlink-community/starlink-grpc-go, however it introduces a new challenge:

    Running a router w/ 2022.01.0.mr8624-prod and a dish w/ 992cafb5-61c7-46a3-9ef7-5907c8cf90fd.uterm.release the starlink-community/starlink-grpc-go generated protobuf types result in incomplete output with "unknown bytes".

    This PR fixes the build and the incomplete information by temporarily using a fork of starlink-grpc-go with updated generated protos. Once the upstream project has merged the updated protos (see https://github.com/starlink-community/starlink-grpc-go/pull/1) the replace directive to use the fork can be removed and this PR merged.

    In the meantime with this branch and its replace directive in place I was able to fetch complete information for the software versions on my dish/router with the CLI tool.

  • invalid version: unknown revision b37157d46ec6

    invalid version: unknown revision b37157d46ec6

    Compiling the tool using the command line

    go get github.com/starlink-community/starlink-cli/cmd/basic-cli
    

    does work; however, cloning the repository and trying to run it manually via

    go run cmd/basic-cli/main.go
    

    fails with the error message:

    go: github.com/starlink-community/[email protected]: invalid version: unknown revision b37157d46ec6
    
A command line tool that builds and (re)starts your web application everytime you save a Go or template fileA command line tool that builds and (re)starts your web application everytime you save a Go or template file

# Fresh Fresh is a command line tool that builds and (re)starts your web application everytime you save a Go or template file. If the web framework yo

Nov 22, 2021
A command line tool to prompt for a value to be included in another command line.

readval is a command line tool which is designed for one specific purpose—to prompt for a value to be included in another command line. readval prints

Dec 22, 2021
a python command-line tool which draws basic graphs in the terminal
a python command-line tool which draws basic graphs in the terminal

Termgraph A command-line tool that draws basic graphs in the terminal, written in Python. Graph types supported: Bar Graphs Color charts Multi-variabl

Dec 30, 2022
Jan 3, 2023
Simple activity indicator for your command line tools.
Simple activity indicator for your command line tools.

Simple activity indicator for your command line tools.

Oct 22, 2021
Command line tools for creating and compiling JavaScript Minecraft plugins.

@customrealms/cli CustomRealms command-line tools for setting up and compiling JavaScript Minecraft plugins. Installation Install the CLI on your comp

Aug 2, 2022
Command-line tools for the FFS module.

Command-line tools for FFS The blobd tool defines a JSON-RPC service that implements the FFS blob store interface over various underlying key-value st

Dec 14, 2022
Inotify-tools is a C library and a set of command-line programs providing a simple interface to inotify.

inotify-tools This is a package of some commandline utilities relating to inotify. The general purpose of this package is to allow inotify's features

Jan 4, 2023
wy : a set of command-line tools to test your container-based platform

wy wy (Abbreviation of Would You) is a set of command-line tools to test your container-based platform. ToC: Commands Deployment Monitoring Contributi

Apr 30, 2022
A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a proxy.
A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a proxy.

Fake-SMS A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a pr

Dec 31, 2022