thunder-cli

command module
v0.0.64 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 1 Imported by: 0

README ΒΆ

Thunder Compute CLI (tnr)

Go Version Release Build macOS Linux Windows

Fast, secure, and developer-friendly command-line interface for managing Thunder Compute GPU instances.

tnr is the official CLI for Thunder Compute, enabling seamless management of cloud GPU instances. Built for speed and ease of use, it handles authentication, instance provisioning, SSH connections, file transfers, and monitoringβ€”all from your terminal.


Features

  • ⚑ Quick Instance Provisioning – Create GPU instances (T4, A100, A100 XL) in seconds with flexible CPU and memory configurations
  • πŸ” Automatic SSH Key Management – Connect securely without manual SSH configuration
  • πŸ“¦ Built-in File Transfer – Copy files between local and remote instances with integrated SCP support
  • πŸ“Š Real-time Monitoring – Track instance status, resource usage, and configuration details
  • 🎨 Pre-configured Templates – Launch instances with Ollama, ComfyUI, or WebUI Forge pre-installed
  • 🌍 Cross-platform Support – Native binaries for macOS, Linux, and Windows
  • πŸ”„ Auto-update – Keep the CLI current with tnr self-update
  • 🎯 Port Forwarding – Easily expose remote services to your local machine

Installation

Package Managers
macOS / Linux (Homebrew)
brew tap Thunder-Compute/tap
brew install tnr
Windows (Scoop)
scoop bucket add tnr https://github.com/Thunder-Compute/scoop-bucket
scoop install tnr
Windows (Winget)
winget install Thunder.tnr
Debian / Ubuntu

Download the latest .deb package from Releases:

sudo dpkg -i tnr_*.deb
RHEL / CentOS / Fedora

Download the latest .rpm package from Releases:

sudo rpm -i tnr_*.rpm
Install Scripts
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/Thunder-Compute/thunder-cli/main/scripts/install.sh | bash
Windows (PowerShell)
irm https://raw.githubusercontent.com/Thunder-Compute/thunder-cli/main/scripts/install.ps1 | iex
Manual Installation
  1. Download the appropriate binary for your platform from Releases
  2. Extract the archive
  3. Move the tnr binary to a directory in your PATH (e.g., /usr/local/bin on Unix systems)
  4. Make it executable (Unix): chmod +x /usr/local/bin/tnr
Build from Source

Requirements: Go 1.25.3 or later

git clone https://github.com/Thunder-Compute/thunder-cli.git
cd thunder-cli
go build -o tnr

Quick Start

# 1. Authenticate with Thunder Compute
tnr login

# 2. Create a new GPU instance (default: A100)
tnr create --gpu a100

# 3. Connect to your instance
tnr connect 0

# 4. Check instance status
tnr status

# 5. Copy files to/from instance
tnr scp ./local-file.txt 0:/remote/path/
tnr scp 0:/remote/file.txt ./local-path/

# 6. Delete instance when done
tnr delete 0

Usage

Authentication
Login

Authenticate with Thunder Compute. Opens your browser to generate an API token:

tnr login

The token is stored in ~/.thunder/token. You can also set the TNR_API_TOKEN environment variable for programmatic access.

Logout

Remove stored credentials:

tnr logout
Instance Management
Create an Instance

Basic creation (default: A100 GPU, 4 vCPUs, 32GB RAM):

tnr create

Specify GPU type:

tnr create --gpu t4       # NVIDIA T4 (16GB VRAM)
tnr create --gpu a100     # NVIDIA A100 (40GB VRAM)
tnr create --gpu a100xl   # NVIDIA A100 (80GB VRAM)

Multiple GPUs:

tnr create --gpu a100 --num-gpus 4

Custom CPU configuration:

tnr create --vcpus 8  # 8 vCPUs = 64GB RAM

Use a template:

tnr create --template ollama      # Ollama LLM server
tnr create --template comfy-ui    # ComfyUI image generation
tnr create --template webui-forge # Stable Diffusion WebUI

Production mode (enhanced stability):

tnr create --mode production
View Instance Status

List all instances with details:

tnr status

Add --no-wait to disable automatic status monitoring.

Delete an Instance
tnr delete <instance_id>

⚠️ Warning: This permanently deletes the instance and all data. Back up important files first.

Connecting to Instances
Basic SSH Connection
tnr connect <instance_id>
Port Forwarding

Forward one or more ports to access remote services locally:

# Forward a single port
tnr connect 0 -t 8000

# Forward multiple ports
tnr connect 0 -t 8000 -t 8080 -t 3000

After forwarding, access services at localhost:<port>.

File Transfer (SCP)

Transfer files between your local machine and instances:

# Upload to instance
tnr scp ./local-file.txt 0:/remote/path/
tnr scp -r ./local-directory/ 0:/remote/path/

# Download from instance
tnr scp 0:/remote/file.txt ./local-path/
tnr scp -r 0:/remote/directory/ ./local-path/

Path formats:

  • Remote: <instance_id>:/path (e.g., 0:/home/user/data)
  • Local: Standard absolute or relative paths
Self-Update

Keep your CLI up-to-date with the latest features and bug fixes.

Check Current Version
tnr --version
Update to Latest Version

For manual installations (install script or direct download):

tnr self-update

This command will:

  • Check for the latest release on GitHub
  • Download the appropriate binary for your OS/architecture
  • Replace the current binary automatically
  • Preserve all your settings and configuration

For package manager installations:

If you installed via Homebrew, Scoop, or Winget, use your package manager's update command instead:

# Homebrew
brew upgrade tnr

# Scoop
scoop update tnr

# Winget
winget upgrade Thunder.tnr

The tnr self-update command will automatically detect package manager installations and direct you to use the appropriate command.

Disable Auto-Update

If you need to prevent self-updates (e.g., in CI/CD environments or for testing), set the TNR_NO_SELFUPDATE environment variable:

export TNR_NO_SELFUPDATE=1
tnr self-update  # Will skip update and show a message
Notes
  • Self-update requires write access to the binary location
  • Development builds (dev version) cannot use self-update
  • The CLI will automatically verify the integrity of downloaded updates
  • After updating, you may need to restart any active sessions to use the new version
Shell Completion

Generate shell completion scripts:

# Bash
tnr completion bash | sudo tee /etc/bash_completion.d/tnr

# Zsh
tnr completion zsh > "${fpath[1]}/_tnr"

# Fish
tnr completion fish > ~/.config/fish/completions/tnr.fish

# PowerShell
tnr completion powershell > tnr.ps1

Documentation

Guides

Development

Prerequisites
  • Go 1.25.3 or later
  • Git
Setup
# Clone the repository
git clone https://github.com/Thunder-Compute/thunder-cli.git
cd thunder-cli

# Install dependencies
go mod download

# Build the CLI
go build -o tnr

# Run tests
go test ./... -v

# Run specific tests
go test ./cmd -v
go test ./api -v
Project Structure
thunder-cli/
β”œβ”€β”€ api/           # Thunder Compute API client
β”œβ”€β”€ cmd/           # Cobra command definitions
β”œβ”€β”€ internal/      # Internal utilities and version info
β”œβ”€β”€ tui/           # Terminal UI components (Bubble Tea)
β”œβ”€β”€ utils/         # SSH, SCP, and helper utilities
└── main.go        # Entry point
Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Write tests for new functionality
  4. Ensure all tests pass (go test ./... -v)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Support


Platform Compatibility

Platform Architecture Status
macOS ARM64 (Apple Silicon) βœ… Supported
macOS AMD64 (Intel) βœ… Supported
Linux AMD64 βœ… Supported
Linux ARM64 βœ… Supported
Windows AMD64 βœ… Supported

Updating

For detailed update instructions, including how to check your current version and disable auto-updates, see the Self-Update section above.

Quick reference:

  • Package managers: Use brew upgrade tnr, scoop update tnr, or winget upgrade Thunder.tnr
  • Manual installations: Use tnr self-update

License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright Β© 2025 Thunder Compute


Acknowledgments

Built with:


Get Started β†’ | View on GitHub β†’ | Report Issue β†’

Documentation ΒΆ

Overview ΒΆ

Copyright Β© 2025 NAME HERE <EMAIL ADDRESS>

Directories ΒΆ

Path Synopsis
internal
tui

Jump to

Keyboard shortcuts

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