qbee-cli is a client library and a command line tool used to interact with qbee.io IoT/Linux device management platform.
go build -o qbee-cli ./cmd
Currently, the only way to provide credentials is through environmental variables: QBEE_EMAIL
& QBEE_PASSWORD
.
If your account is configured with two-factor authentication, you will either be prompted for which of your configured
2FA providers you want to use, or you can set the QBEE_2FA_CODE
environment variable to provide a code for the
Google provider directly.
Please remember to rotate your credentials regularly.
go run go.qbee.io/client/cmd@latest
export QBEE_EMAIL=<email>
export QBEE_PASSWORD=<password>
qbee-cli connect -d <deviceID> -t <target>[,<target> ...]
Where:
deviceID
identifies to which device we want to connect (public key digest)target
defines a singe port forwarding target as<localPort>:<remoteHost>:<remotePort>
localPort
is the local port on which tunnel will listen for connections/packetsremoteHost
must be set to localhostremotePort
is the remote port on which tunnel will connect to on the device
package demo
import (
"context"
"log"
"os"
"go.qbee.io/client"
)
func main() {
cli := client.New()
ctx := context.Background()
email := os.Getenv("QBEE_EMAIL")
password := os.Getenv("QBEE_PASSWORD")
if err := cli.Authenticate(ctx, email, password); err != nil {
log.Fatalf("authentication failed: %v", err)
}
}