qbee-cli is a client library and a command line tool used to interact with qbee.io IoT/Linux device management platform.
Open the releases page, scroll down to Assets and download the latest version for your platform.
NOTE: The binary is not signed, so you might need to allow it to run in your system settings. For Windows, you need to add ".exe" to the binary name.
go build -o qbee-cli ./cmdqbee-cli supports multiple authentication methods to provide flexibility for different use cases:
qbee-cli loginThis will prompt for your email and password interactively. If two-factor authentication is enabled, you'll be prompted to select a 2FA provider and enter the code.
You can provide credentials via environment variables to avoid interactive prompts:
export [email protected]
export QBEE_PASSWORD=secret
qbee-cli loginFor accounts with two-factor authentication enabled, you can also set:
export [email protected]
export QBEE_PASSWORD=secret
export QBEE_2FA_CODE=123456
qbee-cli loginIf you need to authenticate against a different qbee.io instance, you can set the QBEE_BASEURL environment variable:
export [email protected]
export QBEE_PASSWORD=secret
export QBEE_BASEURL=https://www.app.qbee.example.com
qbee-cli loginFor automated workflows and multiple command executions, you can use authentication tokens. First, obtain a token using the --print-token flag:
# Get a token and save it for reuse
QBEE_TOKEN=$([email protected] QBEE_PASSWORD=secret QBEE_2FA_CODE=123456 qbee-cli login --print-token)
export QBEE_TOKENThen use the token for subsequent commands without needing to re-authenticate:
# Use the token for any qbee-cli command
QBEE_TOKEN=your_token_here qbee-cli device list
QBEE_TOKEN=your_token_here qbee-cli files list /Or export it once and use multiple commands:
export QBEE_TOKEN=your_token_here
qbee-cli device list
qbee-cli files list /
qbee-cli connect -d device123 -t 8080:localhost:80Note: The --print-token flag prints the authentication token to stdout instead of writing the configuration file to disk, making it ideal for automation and CI/CD workflows.
Please remember to rotate your credentials regularly and keep tokens secure.
go run go.qbee.io/client/cmd@latestexport QBEE_EMAIL=<email>
export QBEE_PASSWORD=<password>
qbee-cli connect -d <deviceID> -t <target>[,<target> ...]Where:
deviceIDidentifies to which device we want to connect (public key digest)targetdefines a singe port forwarding target as[<localHost>:]<localPort>:<remoteHost>:<remotePort>localHostis optional and defaults to localhost to only listen on the loopback interfacelocalPortis the local port on which tunnel will listen for connections/packetsremoteHostmust be set to localhostremotePortis 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)
}
}We welcome contributions to this project! Please see Contribution License Agreement for more information.