No description
| .forgejo/workflows | ||
| .gitignore | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
klog
klog is a small command-line tool to log coffee brewing events to the Kaffeelogger-API via HTTP POST requests.
I have half-vibe-coded it with the help of ChatGPT.
It is built with Go and uses a simple configuration file to store your API settings and token.
Features
-
Commands
klog config token <token>– store the access tokenklog config url <url>– set API endpointklog config insecure <true|false>– ignore self-signed SSL certsklog config show– show current configurationklog c(aliases:klog k,klog coffee,klog kaffee) – log a coffeeklog balance– shows your balanceklog brew <waterIn> [--notify=<true|false>] [--plan=<true|false>] [--planTime=<minutes>]– log a brew with options
-
Formatted output
Responses from the server (usually JSON) are displayed as a table for easier reading.
Installation
Build from source
Make sure you have Go installed.
git clone https://dev.hflabs.de/henner/kaffeecli.git
cd klog
go build -o bin/klog main.go
Prebuilt binaries
On tagged releases, prebuilt binaries for Linux and Windows are available under the Releases section.
Usage
Configure the tool
# Set API token
klog config token my-secret-token
# Set Kaffeelogger URL
klog config url https://example.com/
# Show current configuration
klog config show
Show your balance
klog balance
Log events
# Quick coffee log
klog c
# Brew with parameters
klog brew 1250 # plans a brew with 1250mL and notifies in 8 min.
klog brew 250 --notify=true --plan=true --planTime=5 # plans a brew with 250mL and notifies in 5 min.
Development
Run locally:
go run main.go
Compile for Linux:
GOOS=linux GOARCH=amd64 go build -o bin/klog main.go
Compile for Windows:
GOOS=windows GOARCH=amd64 go build -o bin/klog.exe main.go
License
MIT License. See LICENSE for details.