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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 17 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
changes:
runs-on: ubuntu-latest
outputs:
gohome: ${{ steps.filter.outputs.gohome }}
switchyard: ${{ steps.filter.outputs.switchyard }}
driverkit: ${{ steps.filter.outputs.driverkit }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
gohome:
switchyard:
- 'cmd/**'
- 'gen/**'
- 'internal/**'
Expand All @@ -36,15 +36,15 @@ jobs:
- 'buf.gen.yaml'
- 'Taskfile.yml'
driverkit:
- 'gohome-driverkit/**'
- 'switchyard-driverkit/**'
- 'go.work'
- 'go.work.sum'

# ── gohome ──────────────────────────────────────────────────────────────────
# ── switchyard ──────────────────────────────────────────────────────────────────

gohome-build-and-test:
switchyard-build-and-test:
needs: changes
if: github.event_name != 'pull_request' || needs.changes.outputs.gohome == 'true'
if: github.event_name != 'pull_request' || needs.changes.outputs.switchyard == 'true'
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Expand Down Expand Up @@ -109,9 +109,9 @@ jobs:
- name: Integration
run: task test:integration

gohome-lint:
switchyard-lint:
needs: changes
if: github.event_name != 'pull_request' || needs.changes.outputs.gohome == 'true'
if: github.event_name != 'pull_request' || needs.changes.outputs.switchyard == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -129,9 +129,9 @@ jobs:
with:
version: v2.11.4

gohome-coverage:
switchyard-coverage:
needs: changes
if: github.event_name != 'pull_request' || needs.changes.outputs.gohome == 'true'
if: github.event_name != 'pull_request' || needs.changes.outputs.switchyard == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -152,9 +152,9 @@ jobs:
}
echo "carport coverage ${pct}% — passes ≥70% gate"

gohome-proto:
switchyard-proto:
needs: changes
if: github.event_name != 'pull_request' || needs.changes.outputs.gohome == 'true'
if: github.event_name != 'pull_request' || needs.changes.outputs.switchyard == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -177,7 +177,7 @@ jobs:
- name: Buf lint
run: buf lint

gohome-fuzz-scheduled:
switchyard-fuzz-scheduled:
needs: changes
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
Expand All @@ -190,7 +190,7 @@ jobs:
- run: go test -fuzz=FuzzFilterMatch -fuzztime=5m ./internal/eventstore
- run: go test -fuzz=FuzzEnvelopeDecode -fuzztime=5m ./internal/carport

# ── gohome-driverkit ────────────────────────────────────────────────────────
# ── switchyard-driverkit ────────────────────────────────────────────────────────

driverkit-build-and-test:
needs: changes
Expand All @@ -201,14 +201,14 @@ jobs:
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: gohome-driverkit
working-directory: switchyard-driverkit
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25'
cache: true
cache-dependency-path: gohome-driverkit/go.sum
cache-dependency-path: switchyard-driverkit/go.sum

- name: Tidy
run: go mod tidy && git diff --exit-code go.mod go.sum
Expand All @@ -234,4 +234,4 @@ jobs:
- uses: golangci/golangci-lint-action@v7
with:
version: v2.11.4
working-directory: gohome-driverkit
working-directory: switchyard-driverkit
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ formatters:
settings:
goimports:
local-prefixes:
- github.com/fdatoo/gohome
- github.com/fdatoo/switchyard
10 changes: 5 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# GoHome — Monorepo
# Switchyard — Monorepo

## Directory map

| Path | Module | Purpose |
|------|--------|---------|
| `.` | `github.com/fdatoo/gohome` | `gohomed` daemon + `gohome` CLI |
| `gohome-driverkit/` | `github.com/fdatoo/gohome-driverkit` | Driver development kit |
| `.` | `github.com/fdatoo/switchyard` | `switchyardd` daemon + `switchyard` CLI |
| `switchyard-driverkit/` | `github.com/fdatoo/switchyard-driverkit` | Driver development kit |
| `docs/` | — | Documentation site (Zensical) |
| `docs/design/` | — | Design specs and implementation plans |
| `dev/` | — | Internal developer notes (proto hygiene, setup guides) |

## Go workspace

`go.work` at the repo root links `.` and `./gohome-driverkit`. Use standard `go` commands from anywhere in the tree; the workspace resolves both modules locally.
`go.work` at the repo root links `.` and `./switchyard-driverkit`. Use standard `go` commands from anywhere in the tree; the workspace resolves both modules locally.

## Rules

- **Documentation and design specs live in `docs/design/`**, not scattered in the source tree.
- **Never create a new top-level directory** without checking with the user first.
- The `github.com/fdatoo/gohome` module root is the repo root (`.`), not a subdirectory.
- The `github.com/fdatoo/switchyard` module root is the repo root (`.`), not a subdirectory.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
<img src="media/banner-light.png" alt="FBI" width="460" />
</picture>

GoHome is a self-hosted home automation platform. `gohomed` runs on your local network and connects to devices via a driver model; `gohome` is the CLI for managing it.
Switchyard is a self-hosted home automation platform. `switchyardd` runs on your local network and connects to devices via a driver model; `switchyard` is the CLI for managing it.

> **Warning**: This project is in early development. It's definitely not ready for production use, and the API is likely to change.

## Modules

| Module | Path | Description |
|--------|------|-------------|
| `github.com/fdatoo/gohome` | `.` | Daemon (`gohomed`) + CLI (`gohome`) |
| `github.com/fdatoo/gohome-driverkit` | `./gohome-driverkit` | SDK for building device drivers |
| `github.com/fdatoo/switchyard` | `.` | Daemon (`switchyardd`) + CLI (`switchyard`) |
| `github.com/fdatoo/switchyard-driverkit` | `./switchyard-driverkit` | SDK for building device drivers |

Both modules are linked by a Go workspace (`go.work`), so `go build ./...` and `go test ./...` work across the full tree from the repo root.

Expand All @@ -25,7 +27,7 @@ Both modules are linked by a Go workspace (`go.work`), so `go build ./...` and `
## Building

```bash
task build # builds gohomed + gohome binaries into dist/
task build # builds switchyardd + switchyard binaries into dist/
task web:build # builds the web UI (required before task build)
```

Expand All @@ -39,10 +41,10 @@ task test:integration # integration tests (real disk I/O)

## Drivers

Drivers are out-of-process binaries that implement the driver gRPC protocol. Use the [gohome-driverkit](./gohome-driverkit) to build one:
Drivers are out-of-process binaries that implement the driver gRPC protocol. Use the [switchyard-driverkit](./switchyard-driverkit) to build one:

```bash
cd gohome-driverkit
cd switchyard-driverkit
go build ./...
```

Expand Down
6 changes: 3 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tasks:
- npm test

ui:dev:
desc: Start Vite dev server (proxies to gohomed)
desc: Start Vite dev server (proxies to switchyardd)
dir: web
deps: [web:install]
cmds:
Expand All @@ -50,8 +50,8 @@ tasks:
desc: Build both binaries
deps: [web:build]
cmds:
- go build -o {{.BIN_DIR}}/gohomed ./cmd/gohomed
- go build -o {{.BIN_DIR}}/gohome ./cmd/gohome
- go build -o {{.BIN_DIR}}/switchyardd ./cmd/switchyardd
- go build -o {{.BIN_DIR}}/switchyard ./cmd/switchyard

test:
desc: Run unit tests
Expand Down
2 changes: 1 addition & 1 deletion buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ managed:
enabled: true
override:
- file_option: go_package_prefix
value: github.com/fdatoo/gohome/gen
value: github.com/fdatoo/switchyard/gen
plugins:
- remote: buf.build/protocolbuffers/go
out: gen
Expand Down
2 changes: 1 addition & 1 deletion cmd/gohome/main.go → cmd/switchyard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"os"

"github.com/fdatoo/gohome/internal/cli"
"github.com/fdatoo/switchyard/internal/cli"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions cmd/gohomed/main.go → cmd/switchyardd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"syscall"
"time"

"github.com/fdatoo/gohome/internal/daemon"
"github.com/fdatoo/gohome/internal/observability"
"github.com/fdatoo/switchyard/internal/daemon"
"github.com/fdatoo/switchyard/internal/observability"
)

func main() {
Expand All @@ -21,7 +21,7 @@ func main() {

func run() int {
var (
dataDir = flag.String("data-dir", "", "data directory (default ~/.local/share/gohome)")
dataDir = flag.String("data-dir", "", "data directory (default ~/.local/share/switchyard)")
logLevel = flag.String("log-level", "info", "error|warn|info|debug")
logFormat = flag.String("log-format", "auto", "auto|tty|json")
adminPort = flag.Int("admin-port", 9190, "HTTP admin port for /metrics and /health")
Expand Down
18 changes: 9 additions & 9 deletions cmd/testdriver/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package main is a minimal scenario-driven driver binary used by integration
// tests. Behavior is selected by TESTDRIVER_MODE, encoded in
// GOHOME_CARPORT_INSTANCE_CONFIG as JSON: {"TESTDRIVER_MODE":"<mode>"}.
// SWITCHYARD_CARPORT_INSTANCE_CONFIG as JSON: {"TESTDRIVER_MODE":"<mode>"}.
package main

import (
Expand All @@ -15,26 +15,26 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

carportpb "github.com/fdatoo/gohome/gen/gohome/carport/v1alpha1"
entitypb "github.com/fdatoo/gohome/gen/gohome/entity/v1"
eventpb "github.com/fdatoo/gohome/gen/gohome/event/v1"
carportpb "github.com/fdatoo/switchyard/gen/switchyard/carport/v1alpha1"
entitypb "github.com/fdatoo/switchyard/gen/switchyard/entity/v1"
eventpb "github.com/fdatoo/switchyard/gen/switchyard/event/v1"
)

type cfg struct {
Mode string `json:"TESTDRIVER_MODE"`
}

func main() {
sock := os.Getenv("GOHOME_CARPORT_SOCKET")
secret := os.Getenv("GOHOME_CARPORT_SECRET")
instanceID := os.Getenv("GOHOME_CARPORT_INSTANCE_ID")
raw := os.Getenv("GOHOME_CARPORT_INSTANCE_CONFIG")
sock := os.Getenv("SWITCHYARD_CARPORT_SOCKET")
secret := os.Getenv("SWITCHYARD_CARPORT_SECRET")
instanceID := os.Getenv("SWITCHYARD_CARPORT_INSTANCE_ID")
raw := os.Getenv("SWITCHYARD_CARPORT_INSTANCE_CONFIG")
var c cfg
if raw != "" {
_ = json.Unmarshal([]byte(raw), &c)
}
if sock == "" {
log.Fatal("GOHOME_CARPORT_SOCKET unset")
log.Fatal("SWITCHYARD_CARPORT_SOCKET unset")
}

ln, err := net.Listen("unix", sock)
Expand Down
Loading
Loading