How hammingweight/synkctl works
synkctl is a SunSynk inverter CLI and Go REST client. Its main workflow is command selection, configuration and authentication, then reading inverter or attached-system state, or transforming and submitting inverter settings; results are returned for CLI display. README capabilities also include inverter discovery, credential generation/verification, and separate battery, grid, input, and load queries. The tree identifies these command and REST subsystems, but their unsampled implementations are not detailed here, so uncertain call wiring is omitted.
Main entry points: api.go HTTP transport · cmd State queries · client.go Client setup · root.go Command dispatch
Components 24
CLI workflows
- CLI entry
main.go - Command dispatch
cmd/root.go - State queries
cmd - Inverter listing
cmd/inverter_list.go - Settings update
cmd/inverter_update.go - Settings apply
cmd/inverter_apply.go - Config commands
cmd/configuration.go
Configuration and auth
- Configuration
configuration/configuration.go - Client setup
cmd/client.go - Authentication
rest/authentication.go
REST client
- Authenticated client
rest/authentication.go - HTTP transport
rest/api.go
Inverter domains
- Inverter operations
rest/inverter.go - Inverter settings model
rest/inverter_struct.go - Battery state
rest/battery.go - Grid state
rest/grid.go - Input state
rest/input.go - Load statistics
rest/load.go - Plant data
rest/plant.go - User data
rest/user.go - Object details
rest/details.go - CLI value types
types/types.go
Other components
- Operator
- SunSynk API
Connections 36
- Operator → CLI entry: runs
- CLI entry → Command dispatch: dispatches
- Command dispatch → State queries: dispatches
- Command dispatch → Inverter listing: dispatches
- Command dispatch → Settings update: dispatches
- Command dispatch → Settings apply: dispatches
- Command dispatch → Config commands: dispatches
- Config commands → Configuration: reads/writes
- State queries → Client setup: creates client
- Inverter listing → Client setup: creates client
- Settings update → Client setup: creates client
- Settings apply → Client setup: creates client
- Client setup → Configuration: reads
- Client setup → Authentication: authenticates
- Authentication → SunSynk API: requests tokens
- Authentication → Authenticated client: returns
- Client setup → Authenticated client: configures serial
- Settings update → CLI value types: parses flags
- Settings update → Inverter operations: reads and updates
- Settings apply → Inverter operations: updates
- Inverter operations → Inverter settings model: uses model
- Inverter operations → HTTP transport: requests
- State queries → Battery state: queries
- State queries → Grid state: queries
- State queries → Input state: queries
- State queries → Load statistics: queries
- State queries → Inverter operations: queries
- Inverter listing → Inverter operations: lists
- Battery state → HTTP transport: requests
- Grid state → HTTP transport: requests
- Input state → HTTP transport: requests
- Load statistics → HTTP transport: requests
- Plant data → HTTP transport: requests
- User data → HTTP transport: requests
- Object details → HTTP transport: requests
- HTTP transport → SunSynk API: HTTP requests