Mini CLI calculator with REPL
  • Go 96.5%
  • Shell 3.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-05-25 10:03:12 +03:00
cmd/gt fix(rpn): change variadic NewRPN/NewOperations to single optional MetricReader (task ok) 2026-05-24 18:50:00 +03:00
completions fix(fish): prevent file completions and glob expansion in gt.fish 2026-05-25 09:44:55 +03:00
docs docs: de-LLM all .md files - remove corporate language, over-explanation, and LLM patterns 2026-05-24 23:10:22 +03:00
integrationtests chore: bump go.mod from go 1.25.0 to go 1.26.0 2026-05-23 23:24:42 +03:00
internal bump version to v0.5.1 2026-05-25 10:03:12 +03:00
.gitignore cleanup 2026-03-25 23:54:30 +02:00
.golangci.yml.bak docs: Add comprehensive Go documentation for REPL functions 2026-03-25 16:37:15 +02:00
.goreleaser.yml ci: Create .goreleaser.yml for automated releases 2026-03-25 17:08:48 +02:00
go.mod chore: bump go.mod from go 1.25.0 to go 1.26.0 2026-05-23 23:24:42 +03:00
go.sum chore: bump go.mod from go 1.25.0 to go 1.26.0 2026-05-23 23:24:42 +03:00
LICENSE LICENSE: Add MIT license file 2026-03-20 22:56:49 +02:00
logo.svg docs: de-LLM all .md files - remove corporate language, over-explanation, and LLM patterns 2026-05-24 23:10:22 +03:00
Magefile.go fix(Magefile): update stale comments referencing old 'perc' binary name 2026-05-24 00:46:47 +03:00
README.md fix(fish): prevent file completions and glob expansion in gt.fish 2026-05-25 09:44:55 +03:00

gt

A command-line calculator with percentage calculations and RPN (Reverse Polish Notation) stack arithmetic, written in Go.

gt Logo

This is a toy project to experiment with local LLMs (Qwen, Gemma, Nemotron, GPT OSS) as pair programmers.

Installation

go install codeberg.org/snonux/gt/cmd/gt@latest

Or using mage:

mage install

Quick Start

gt '20% of 150'         # → 30
gt '3 4 +'              # RPN: 3 + 4 → 7
gt 'pi 2 *'             # 2π → 6.283185307
gt '100Mbps 1hr *'      # rate × time → 3.6e+11 bits
gt                      # interactive REPL

Shell Completions

Fish completions are available in completions/. To install:

cp completions/gt.fish ~/.config/fish/completions/

Or system-wide:

sudo cp completions/gt.fish /usr/local/share/fish/vendor_completions.d/

Feature Guide

All features are documented in docs/:

Topic Doc
CLI modes, piping, REPL cli-usage
Percentage calculations percentage-calculations
RPN basics basic-arithmetic
Fast integer power (**) fast-power
Logarithm operators log-operators
Hyper (n-ary) operators hyper-operators
Comparisons and booleans comparisons
Variables and assignment variables
Symbols (:x syntax) symbols
Built-in constants constants
Stack manipulation stack-operations
Metrics and units metrics
Unit conversion unit-conversion
Metric commands metric-commands
Custom metrics custom-metrics
REPL mode repl-mode
Rational number mode rational-mode
Fish shell completions completions

Building and Testing

mage build      # Build the binary
mage test       # Run all tests

License

See LICENSE for details.