No description
Find a file
2025-08-30 17:19:30 +02:00
.forgejo/workflows Runner for automatic compiling of releases. 2025-08-30 14:53:49 +02:00
.gitignore initial half-vibe coded commit 2025-08-30 13:17:19 +02:00
go.mod initial half-vibe coded commit 2025-08-30 13:17:19 +02:00
go.sum initial half-vibe coded commit 2025-08-30 13:17:19 +02:00
LICENSE initial half-vibe coded commit 2025-08-30 13:17:19 +02:00
main.go initial half-vibe coded commit 2025-08-30 13:17:19 +02:00
README.md Balance in README hinzugefügt 2025-08-30 17:19:30 +02:00

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 token
    • klog config url <url> set API endpoint
    • klog config insecure <true|false> ignore self-signed SSL certs
    • klog config show show current configuration
    • klog c (aliases: klog k, klog coffee, klog kaffee) log a coffee
    • klog balance shows your balance
    • klog 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.