From 143e89054780f12e977358102b38530871560990 Mon Sep 17 00:00:00 2001 From: Kristoffer Risa Date: Fri, 30 Jan 2026 22:26:43 +0100 Subject: [PATCH 1/2] fixed cobra command --- internal/commands/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/commands/root.go b/internal/commands/root.go index 97eb4dc..ccedd2f 100644 --- a/internal/commands/root.go +++ b/internal/commands/root.go @@ -19,7 +19,7 @@ var ( // rootCmd represents the base command var rootCmd = &cobra.Command{ - Use: "tibber", + Use: "powerctl", Short: "Tibber CLI - Power consumption and price data", Long: `A command-line interface for Tibber power data. From 158ad820ccfb9d398ecd6fd69ea29dd490c34b71 Mon Sep 17 00:00:00 2001 From: Kristoffer Risa Date: Sat, 31 Jan 2026 07:48:44 +0100 Subject: [PATCH 2/2] Complete rename from tibber to powerctl in CI/CD and docs Updated all remaining references from tibber to powerctl: - CI/CD workflow now builds ./cmd/powerctl correctly - Documentation updated (ARCHITECTURE.md, CLAUDE.md, README.md) - Added .gitignore for powerctl binary This completes the rename started in b065c30, ensuring completion scripts and CI builds work correctly. Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/test.yml | 4 ++-- .gitignore | 1 + ARCHITECTURE.md | 22 +++++++++++----------- CLAUDE.md | 4 ++-- README.md | 4 ++-- 5 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 .gitignore diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 20310b0..bfc9a8b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -92,7 +92,7 @@ jobs: cache: true - name: Build binary - run: go build -v -o tibber ./cmd/tibber + run: go build -v -o powerctl ./cmd/powerctl - name: Test binary - run: ./tibber --help + run: ./powerctl --help diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c3d98e3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +powerctl diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 1e5dfdc..db07de7 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -14,7 +14,7 @@ A cross-platform CLI tool for Tibber power consumption data, built following Uni ``` powerctl-cli/ ├── cmd/ -│ └── tibber/ +│ └── powerctl/ │ └── main.go # Entry point, command registration ├── internal/ │ ├── api/ @@ -23,10 +23,10 @@ powerctl-cli/ │ │ └── websocket.go # WebSocket for live streaming │ ├── commands/ │ │ ├── root.go # Root command, global flags -│ │ ├── config.go # `tibber config` - setup wizard -│ │ ├── home.go # `tibber home` -│ │ ├── prices.go # `tibber prices` -│ │ └── live.go # `tibber live` +│ │ ├── config.go # `powerctl config` - setup wizard +│ │ ├── home.go # `powerctl home` +│ │ ├── prices.go # `powerctl prices` +│ │ └── live.go # `powerctl live` │ ├── config/ │ │ └── config.go # Configuration loading │ ├── models/ @@ -44,7 +44,7 @@ powerctl-cli/ ## Component Overview -### Entry Point (`cmd/tibber/main.go`) +### Entry Point (`cmd/powerctl/main.go`) Minimal entry point following Go conventions: @@ -62,10 +62,10 @@ Configuration resolution order (first wins): 1. Command-line flags 2. `TIBBER_TOKEN` environment variable -3. Config file (`~/.tibber/config.yaml`) +3. Config file (`~/.powerctl/config.yaml`) ```yaml -# ~/.tibber/config.yaml +# ~/.powerctl/config.yaml token: "your-api-token" home_id: "optional-home-id" # Skip home selection format: "markdown" # Default output format @@ -139,8 +139,8 @@ Three implementations: | Type | URL | |------|-----| -| GraphQL | `https://api.tibber.com/v1-beta/gql` | -| WebSocket | `wss://websocket-api.tibber.com/v1-beta/gql/subscriptions` | +| GraphQL | `https://api.powerctl.com/v1-beta/gql` | +| WebSocket | `wss://websocket-api.powerctl.com/v1-beta/gql/subscriptions` | ### Authentication @@ -171,7 +171,7 @@ PLATFORMS := linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64 build-all: @for platform in $(PLATFORMS); do \ GOOS=$${platform%/*} GOARCH=$${platform#*/} \ - go build -o dist/tibber-$${platform%/*}-$${platform#*/} ./cmd/tibber; \ + go build -o dist/powerctl-$${platform%/*}-$${platform#*/} ./cmd/powerctl; \ done ``` diff --git a/CLAUDE.md b/CLAUDE.md index 7895fcb..8a538bd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -5,7 +5,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Build & Test Commands ```bash -make build # Build binary to ./tibber +make build # Build binary to ./powerctl make test # Run all tests make fmt # Format code make lint # Run golangci-lint @@ -25,7 +25,7 @@ This is a Go CLI for Tibber power consumption data using Cobra for commands. **Key flow:** Commands (`internal/commands/`) → API client (`internal/api/`) → Output formatter (`internal/output/`) -**Configuration priority:** CLI flags > `TIBBER_TOKEN` env var > `~/.tibber/config.yaml` +**Configuration priority:** CLI flags > `TIBBER_TOKEN` env var > `~/.powerctl/config.yaml` **Output formats:** `pretty` (default, colored), `json`, `markdown` — selected via `--format` flag diff --git a/README.md b/README.md index 7d4dab8..1a50466 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Download the latest release for your platform from [Releases](https://github.com git clone https://github.com/kristofferrisa/powerctl-cli.git cd powerctl-cli make build -./tibber --help +./powerctl --help ``` ## Quick Start @@ -164,7 +164,7 @@ tibber config set format json ### Build ```bash -make build # Build ./tibber +make build # Build ./powerctl make build-all # Cross-compile all platforms ```