Skip to content

teknoir/cli

Repository files navigation

tnctl (Teknoir Control)

tnctl is the official command-line interface for managing Teknoir cloud resources and edge devices. It provides a seamless way to handle authentication, context switching, and secure remote access.

Installation

One-liner (macOS & Linux)

Download and install the latest binary automatically:

curl -sSL https://raw.githubusercontent.com/teknoir/cli/main/scripts/install.sh | sh

Manual Download

Download the appropriate package for your system from the GitHub Releases page. We provide:

  • Binaries: .tar.gz (Linux/macOS) and .zip (Windows)
  • Linux Packages: .deb (Debian/Ubuntu), .rpm (RHEL/CentOS), and .apk (Alpine)

From source

Requires Go 1.23+

go install .

Quick Start

1. Authentication

Log in to the Teknoir platform:

tnctl login

This will open your default browser to complete the login sequence. Use --domain if you are targeting a specific environment.

tnctl login --domain teknoir.cloud

2. Context & Device Management

tnctl uses a persistent configuration to store your active domain and namespace.

  • Switch Domain:
    tnctl domain
  • Switch Namespace:
    tnctl ns [namespace]
    If no namespace is provided, an interactive fuzzy-finder will appear.
  • Device Status:
    tnctl device [device]
    Prints detailed status for a device, including resource usage and alerts. If no device is provided, an interactive fuzzy-finder will appear.
  • List Devices:
    tnctl devices [labels...]
    Prints a summary list of all devices in the current namespace. You can filter by metadata labels using key=value pairs.
    tnctl devices env=prod region=us-east

3. Remote Access

Securely connect to your edge devices via Teknoir's proxy infrastructure.

  • SSH into a device:
    tnctl ssh [device-name]
  • Port Forwarding: Forward a local port to the device or its network:
    tnctl port-forward [device] 8080:localhost:80
  • SOCKS5 Proxy: Establish a SOCKS5 proxy to access the device's entire network:
    tnctl socks-proxy [device] 1080

Global Flags

These flags are available to all subcommands:

  • -d, --domain: The Teknoir domain (defaults to teknoir.cloud).
  • -n, --namespace: Target namespace.
  • --device: Target device ID.
  • --config: Path to a specific config file (default ~/.tnctl.yaml).
  • --debug: Enable verbose debug output.

Configuration

The CLI stores its configuration at ~/.tnctl.yaml. You can also use environment variables with the TNCTL_ prefix:

export TNCTL_DOMAIN=teknoir.cloud
export TNCTL_NAMESPACE=my-namespace

License

Apache License 2.0

Upcoming Features

  • helm add
  • helm repo list
  • device
  • devices
  • device(s) add
  • device(s) deploy
  • device(s) apply
  • device tunneling --enable/--disable
  • device vpn (Wireguard tunneling)
  • device top
  • user (management)

device apply

  • device <device name> apply <manifest file>, and if <device name> left out of the command, the CLI will prompt you to select a device, and if <manifest file> is left out of the command, the CLI will prompt you to select a manifest file from local directory.
  • Starting with a simple example:
    • device apply <manifest file>, where <manifest file> is a YAML file containing any set of supported K8s resources / manifests. Ex: device apply deployment.yaml
  • Using devices <metadata labels> apply <manifest file>, apply the manifest file to all devices in the namespace selected by the current context in the CLI and the metadata labels, after the list of devices has been presented to the user and approved.

device deploy

  • device <device name> deploy <app name>, and if <device name> left out of the command, the CLI will prompt you to select a device, and if <app name> is left out of the command, the CLI will prompt you to select an app listed from the Backstage backend.
  • An app is a K3s HelmChart, and you are able to override the default values.yaml file by passing in a custom values.yaml file and a name for the release.
    • device <device name> deploy <app name> --values <values.yaml file> --release <release name>
  • Before releasing the app, the CLI will render the HelmChart in pretty yaml and prompt you to confirm the release.
  • An alternative device <device name> deploy <app name> --values <values.yaml file> --release <release name>
  • Using devices <metadata labels> deploy <app name> --values <values.yaml file> --release <release name>, deploy the app to all devices in the namespace selected by the current context in the CLI and the metadata labels, after the list of devices has been presented to the user and approved.

About

This repo contain a collection of CLI tools for Teknoir.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors