Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
powerctl
22 changes: 11 additions & 11 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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/
Expand All @@ -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:

Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
```

Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
```

Expand Down
2 changes: 1 addition & 1 deletion internal/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Loading