Skip to content

davidroman0O/tpi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turing Pi Control Tools

This repository contains tools for controlling Turing Pi boards, split into two components:

Components

A Go library for programmatically controlling Turing Pi boards via their BMC API.

go get github.com/davidroman0O/tpi/client

Learn more about the client library →

A command-line interface for controlling Turing Pi boards.

# Install pre-built binary (see releases)
# or build from source:
cd cli && go build

Learn more about the CLI tool →

Repository Structure

tpi/
├── client/           # Client library (minimal dependencies)
│   ├── *.go          # Core functionality files
│   └── testdata/     # Test data
├── cli/              # Command-line interface 
│   ├── commands/     # CLI command implementations
│   └── main.go       # CLI entry point
└── .github/          # GitHub workflows and config

Quick Start

Using the CLI

# Power on node 1
./cli/tpi power on 1 --host=192.168.1.91

# Get power status
./cli/tpi power status --host=192.168.1.91

Using the Client Library

package main

import (
	"fmt"
	"os"

	"github.com/davidroman0O/tpi/client"
)

func main() {
	// Create a client
	c, err := client.NewClient(
		client.WithHost("192.168.1.91"),
		client.WithCredentials("root", "turing"),
	)
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error: %v\n", err)
		os.Exit(1)
	}

	// Power on node 1
	if err := c.PowerOn(1); err != nil {
		fmt.Fprintf(os.Stderr, "Error: %v\n", err)
		os.Exit(1)
	}

	fmt.Println("Node 1 powered on!")
}

License

Apache License 2.0

About

Go implementation of the Turing Pi CLI for controlling and managing Turing Pi boards.

Topics

Resources

Stars

Watchers

Forks