Skip to content

Euheimr/gtm

Repository files navigation

gtm

Golang Task Manager - text-based UI (TUI) task manager and resource monitor written entirely in Go

Table of Contents

  1. About
    1. Why
    2. Requirements
  2. Development
    1. Building
      1. Prerequisites
      2. Build steps
    2. TODO
    3. Reference
      1. General
      2. GPU
      3. Example Projects
  3. Contributing

About

Why

  • Similar existing tools use Python (requires python interpreter) or C (difficult to work with, when it matters)
  • Similar existing tools are platform-specific (operating system and/or CPU architecture-restrictive) and compiled or written needing external dependencies
  • htop, btop and top are great but don't have everything I need (also platform-specific)
  • And, I really enjoy writing Go

Also, I totally haven't redesigned this whole project 5 times... definitely not... (... I did)

Requirements

  1. I want a task manager and resource monitor with alerts
  2. Must be usable from a terminal via SSH
  3. Must be FULLY cross-platform (Linux, Windows & macOS)
  4. Operate as expected in BASH, zsh, Powershell & wt (new microsoft windows terminal packaged with Win11)
  5. Entirely written in "pure" Go (without using cgo)

Please note: I don't plan on supporting cmd aka conhost.exe as it does not support unicode. Use Powershell or wt instead.


Development

Source Code Structure:

gtm/
 ├── cmd/
 │    └─ main.go
 ├── scripts/
 │    ├─ run.sh
 │    ├─ log.sh
 │    └─ pprof.sh
 ├─ config.go
 ├─ devices.go
 ├─ log.go
 └─ ui.go

This project uses BASH/zsh shell scripts (within scripts/) to run & build the app:

  • For Linux or macOS, you can just use your standard shell
  • On Windows, you can use Cygwin to get those GNU tools (sh, ls, tail, tree, ...)

There is a run & build script run.sh in the root directory of this project and log.sh uses tail to track the latest log file entries in your terminal.

cgo is disabled (CGO_ENABLED=0) in the run.sh script. It is not needed for this project, but is a design requirement (as noted above in Requirements) for specific reasons. This is to ensure I don't accidentally manage to use cgo and then run into weird, complex issues down the road.


Building

Prerequisites:

  1. Go 1.21+
  2. (Windows Only): Requires Cygwin to run the run.sh script. (the script uses cleans up old binaries, etc ... might make a Powershell script later to get around this)

Build Steps:

  1. git clone https://github.com/euheimr/gtm
  2. Open up a shell:
    1. Powershell or wt (Windows)
    2. BASH or zsh (Linux/macOS)
  3. cd <PROJECT DIRECTORY> (ie. cd ~/Downloads/gtm)
  4. sh ./scripts/run.sh

You may force a Build & Run the executable even if a binary exists by running:

sh ./scripts/run.sh build

or sh ./scripts/run.sh -b


You may also ONLY force a Build and NOT run the executable by running:

sh ./scripts/run.sh build-only

or sh ./scripts/run.sh -bo


TODO

  • CPU - gopsutil
    • Device data
    • UI
      • bars
      • graphs
      • alerts (over-temp)
  • Disk - gopsutil
    • Device data
    • UI
      • bars
      • graphs
  • GPU - nvidia-smi & rocm-smi
    • Device data
    • UI
      • bars
      • graphs
      • alerts (over-temp)
  • Memory - gopsutil
    • Device data
    • UI
      • bars
      • graphs
      • alerts (excessive paging / usage >85%)
  • Networking - gopsutil
    • Device data (all interfaces)
    • UI
      • bars
      • graphs (braille like htop ?)
  • Processes - gopsutil
    • Device data
    • UI
      • Table
      • Tree view
    • Control
      • Kill
      • Priority
      • Open file location

Reference

General

GPU

  • nvidia-smi - command line interface (CLI) utility for management and monitoring of NVIDIA GPU devices
  • rocm-smi - CLI tool for telemetry / monitoring AMD devices

Example projects


Contributing

I'm not taking pull requests for now, but will personally take on reported issues.

I will change this in the future (sorry, not ready for this yet).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published