yeelight-home 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CONFIG.md CHANGED
@@ -1,63 +1,225 @@
1
1
  # Configuration
2
2
 
3
+ `yeelight-home` separates secret credentials from ordinary profile metadata.
4
+
5
+ - Tokens are stored in the system credential store when available, or in a protected local fallback.
6
+ - Profile metadata stores non-secret values: profile name, region, selected home, and QR device identity.
7
+ - User-facing commands do not require a client id. When QR login returns a service client id, the Runtime may keep it internally for API compatibility.
8
+
3
9
  ## Precedence
4
10
 
5
11
  Runtime configuration is resolved in this order:
6
12
 
7
- 1. Command flags: `--profile`, `--region`, `--client-id`, `--house-id`
8
- 2. Environment variables: `YEELIGHT_HOME_PROFILE`, `YEELIGHT_CLOUD_REGION`, `YEELIGHT_HOME_CLIENT_ID`, `YEELIGHT_HOME_HOUSE_ID`, `YEELIGHT_HOME_ACCESS_TOKEN`
9
- 3. Active profile, profile metadata, and credential store
10
- 4. Defaults: profile `default`, region `dev`
13
+ 1. Command flags.
14
+ 2. Environment variables.
15
+ 3. Active profile metadata and credential store.
16
+ 4. Defaults.
17
+
18
+ Defaults:
19
+
20
+ | Setting | Default |
21
+ | --- | --- |
22
+ | Profile | `default` |
23
+ | Region | `cn` |
24
+ | Home | unset; optional until a house-scoped operation needs a default home |
25
+
26
+ ## Regions
11
27
 
12
- `YEELIGHT_API_BASE_URL` is a developer override for local testing. Do not expose it in Skill responses or user-facing automation.
28
+ Supported region values:
29
+
30
+ | Region | Meaning |
31
+ | --- | --- |
32
+ | `cn` | China cloud, default. |
33
+ | `sg` | Singapore cloud. |
34
+ | `us` | United States cloud. |
35
+ | `eu` | Europe cloud. |
36
+ | `dev` | Development cloud. Use only for internal validation. |
37
+
38
+ Examples:
39
+
40
+ ```sh
41
+ yeelight-home doctor --json
42
+ yeelight-home doctor --json --region sg
43
+ YEELIGHT_CLOUD_REGION=eu yeelight-home home list --json
44
+ ```
13
45
 
14
46
  ## Profiles
15
47
 
48
+ Profiles let one machine keep separate local metadata for different accounts, homes, or regions.
49
+
16
50
  ```sh
17
51
  yeelight-home profile list --json
18
52
  yeelight-home profile show --profile default --json
19
- yeelight-home profile use --profile family --region cn --client-id <client-id> --house-id <house-id>
53
+ yeelight-home profile use --profile family --region cn
54
+ yeelight-home profile use --profile family --region cn --house-id <house-id>
20
55
  yeelight-home profile delete --profile family
21
56
  ```
22
57
 
23
- `profile use` saves metadata and sets the active local profile. Profile metadata is stored in `~/.yeelight-home/config/profiles.json` by default. It contains active profile, region, client id, house id, and QR device metadata. It must not contain access tokens.
58
+ Selection rules:
59
+
60
+ - `--profile <name>` applies to one command.
61
+ - `YEELIGHT_HOME_PROFILE=<name>` applies to one process and overrides the active profile.
62
+ - `profile use --profile <name>` persists the active profile for later commands.
63
+ - Without any of the above, `default` is used.
24
64
 
25
- ## Credentials
65
+ ## Authentication
26
66
 
27
- Preferred login:
67
+ ### QR Login
28
68
 
29
69
  ```sh
30
- yeelight-home auth login --qr --region cn --profile default
70
+ yeelight-home auth login --qr --profile default
71
+ yeelight-home auth login --qr --profile default --region sg
72
+ yeelight-home auth login --qr --profile default --qr-png /tmp/yeelight-login.png
31
73
  ```
32
74
 
33
- Manual token import:
75
+ `--region` defaults to `cn`. `--house-id` is optional and can be passed when a specific home should be carried into the QR login payload.
76
+
77
+ ### Manual Token Import
34
78
 
35
79
  ```sh
36
- yeelight-home auth token set --profile default --token <access-token> --region cn --client-id <client-id> --house-id <house-id>
80
+ yeelight-home auth token set --profile default --token <access-token> --region cn
81
+ yeelight-home auth token set --profile default --token <access-token> --region cn --house-id <house-id>
82
+ yeelight-home auth token delete --profile default
37
83
  ```
38
84
 
39
- Status:
85
+ Use token import only outside AI chat. Tokens are redacted from normal output and are not written to profile metadata.
86
+ Token-only setup is valid. Omit `--house-id` when you only need account-level commands or will choose a default home later.
87
+
88
+ ### Status
40
89
 
41
90
  ```sh
42
91
  yeelight-home auth status --json
92
+ yeelight-home auth status --json --profile family
43
93
  ```
44
94
 
45
- Tokens are loaded from `YEELIGHT_HOME_ACCESS_TOKEN` first, then from the local credential store. Status and doctor output only report whether a token is present.
95
+ The status output includes token presence and source, not token values.
46
96
 
47
97
  ## Home Selection
48
98
 
49
99
  ```sh
50
100
  yeelight-home home list --json
51
- yeelight-home home select --house-id <house-id> --profile default
101
+ yeelight-home home list --json --region eu
102
+ yeelight-home home select --house-id <house-id>
103
+ yeelight-home home select --profile family --house-id <house-id> --region cn
104
+ ```
105
+
106
+ `home select` writes the selected home id into profile metadata. A process can temporarily override it with `--house-id` or `YEELIGHT_HOME_HOUSE_ID`.
107
+ The selected home is a default context, not an authentication requirement. Account-level commands such as `auth status`, `doctor`, `api smoke`, `home list`, home summary/search, and account info work with token-only profiles. Device, room, area, group, scene, automation, gateway, favorite, lighting, and other house-scoped operations require `houseId` at the request, environment, or profile layer.
108
+
109
+ ## Config Commands
110
+
111
+ ```sh
112
+ yeelight-home config get --json
113
+ yeelight-home config set --profile family --region cn --house-id <house-id> --json
114
+ yeelight-home config unset --profile family --house-id --json
115
+ ```
116
+
117
+ `config set` and `config unset` update non-secret profile metadata only.
118
+
119
+ Supported metadata flags:
120
+
121
+ | Flag | Purpose |
122
+ | --- | --- |
123
+ | `--profile <name>` | Selects profile. |
124
+ | `--region <region>` | Stores region for the profile. |
125
+ | `--house-id <id>` | Stores selected home for the profile; optional until house-scoped operations need it. |
126
+ | `--qr-device <mac>` | Advanced: stores a stable QR device identity for QR login. |
127
+
128
+ ## Environment Variables
129
+
130
+ | Variable | Scope | Notes |
131
+ | --- | --- | --- |
132
+ | `YEELIGHT_HOME_BIN` | Skill wrapper lookup | Absolute CLI path used by Skills. |
133
+ | `YEELIGHT_HOME_PROFILE` | Profile | Overrides active profile for this process. |
134
+ | `YEELIGHT_CLOUD_REGION` | Region | Overrides profile region for this process. |
135
+ | `YEELIGHT_HOME_HOUSE_ID` | Home | Overrides selected home for this process. |
136
+ | `YEELIGHT_HOME_ACCESS_TOKEN` | Credential | Temporary token for local smoke tests or CI. |
137
+ | `YEELIGHT_HOME_DIR` | Storage | Overrides Runtime home directory. |
138
+ | `YEELIGHT_API_BASE_URL` | Development | Overrides API base URL; do not expose in Skills. |
139
+
140
+ `YEELIGHT_HOME_ACCESS_TOKEN` has higher priority than the credential store, but it is never persisted by `config` commands.
141
+
142
+ ## Storage Paths
143
+
144
+ Default paths are platform-specific:
145
+
146
+ | OS | Runtime home |
147
+ | --- | --- |
148
+ | macOS | `~/Library/Application Support/yeelight-home` plus cache/data under standard user directories |
149
+ | Linux | `~/.yeelight-home` or XDG-compatible directories depending on environment |
150
+ | Windows | `%LOCALAPPDATA%\YeelightHome` |
151
+
152
+ Run `yeelight-home doctor --json` to see the exact paths on the current machine.
153
+
154
+ ## Skill Integration
155
+
156
+ Skill packages call:
157
+
158
+ ```sh
159
+ yeelight-home invoke --stdin
160
+ ```
161
+
162
+ Skill wrappers find the CLI in this order:
163
+
164
+ 1. `YEELIGHT_HOME_BIN`
165
+ 2. Development-only source checkout binary
166
+ 3. `yeelight-home` on `PATH`
167
+
168
+ After installation:
169
+
170
+ ```sh
171
+ yeelight-home auth status --json
172
+ yeelight-home auth login --qr
173
+ yeelight-home home list --json
174
+ # Optional default home for house-scoped operations:
175
+ yeelight-home home select --house-id <house-id>
176
+ ```
177
+
178
+ ## Troubleshooting
179
+
180
+ ### Runtime missing
181
+
182
+ Install the CLI from GitHub Releases or a package manager, then restart the host application if it inherited an old `PATH`.
183
+
184
+ ### Auth required
185
+
186
+ Run:
187
+
188
+ ```sh
189
+ yeelight-home auth status --json
190
+ yeelight-home auth login --qr
191
+ ```
192
+
193
+ ### Wrong region
194
+
195
+ Use a one-time override:
196
+
197
+ ```sh
198
+ yeelight-home home list --json --region sg
199
+ ```
200
+
201
+ Or persist it:
202
+
203
+ ```sh
204
+ yeelight-home profile use --profile default --region sg
205
+ ```
206
+
207
+ ### Wrong home
208
+
209
+ List homes and select the correct one:
210
+ Only do this when the failed operation is house-scoped or when you want to change the default home.
211
+
212
+ ```sh
213
+ yeelight-home home list --json
214
+ yeelight-home home select --house-id <house-id>
52
215
  ```
53
216
 
54
- `home select` changes only local profile metadata. It does not modify Yeelight cloud home data.
217
+ ### Need a diagnostic bundle
55
218
 
56
- ## Diagnostics
219
+ Run:
57
220
 
58
221
  ```sh
59
222
  yeelight-home doctor --json
60
- yeelight-home api smoke --json --region cn --profile default
61
223
  ```
62
224
 
63
- `doctor` checks local installation, paths, profile, region, token presence, and Runtime storage status. `api smoke` performs read-only cloud checks when credentials are configured.
225
+ Share only redacted diagnostic output. Do not share token files or credential store exports.
package/DISTRIBUTION.md CHANGED
@@ -1,25 +1,145 @@
1
1
  # Distribution
2
2
 
3
- `yeelight-home` is distributed as a standalone CLI. The public source and release repository is `Yeelight/yeelight-home`; Skill packages should depend on the installed CLI through `YEELIGHT_HOME_BIN` or `PATH`.
3
+ `yeelight-home` is distributed as a standalone CLI. Skill packages should not carry Runtime binaries. They depend on `YEELIGHT_HOME_BIN` or `yeelight-home` on `PATH`.
4
4
 
5
- ## Channels
5
+ ## Channel Model
6
6
 
7
- | Channel | Status | User install path |
7
+ | Channel | GoReleaser role | User install path |
8
8
  | --- | --- | --- |
9
- | GitHub Releases | Published | `curl -fsSL https://github.com/yeelight/yeelight-home/releases/latest/download/install.sh \| sh` |
10
- | Homebrew | Published | `brew install Yeelight/tap/yeelight-home` |
11
- | Scoop | Published | `scoop bucket add yeelight https://github.com/Yeelight/scoop-bucket && scoop install yeelight-home` |
12
- | Debian package | Published | Download `yeelight-home_0.1.0_amd64.deb` or `yeelight-home_0.1.0_arm64.deb` from GitHub Releases |
13
- | Winget | Submitted | `winget install Yeelight.yeelight-home` after microsoft/winget-pkgs PR 392555 is merged |
14
- | npm | Published | `npm install -g yeelight-home` |
9
+ | GitHub Releases | Primary release target for archives, installers, checksums, SBOMs, packages, and metadata. | `curl -fsSL https://github.com/Yeelight/yeelight-home/releases/latest/download/install.sh \| sh` |
10
+ | Homebrew tap | Updates cask metadata in `Yeelight/homebrew-tap`. | `brew install Yeelight/tap/yeelight-home` |
11
+ | Scoop bucket | Updates manifest metadata in `Yeelight/scoop-bucket`. | `scoop bucket add yeelight https://github.com/Yeelight/scoop-bucket && scoop install yeelight-home` |
12
+ | npm wrapper | Publishes the launcher package after GoReleaser assets exist. | `npm install -g yeelight-home` |
13
+ | Linux packages | Builds `.deb`, `.rpm`, `.apk`, and Arch package artifacts through nFPM. | Download package assets from GitHub Releases. |
14
+ | Winget | Generates or supports the Microsoft registry submission path. | `winget install Yeelight.yeelight-home` after registry acceptance. |
15
+ | AUR | Publishes `yeelight-home-bin` only when AUR SSH is configured. | `yay -S yeelight-home-bin` after publication. |
16
+ | Snap | Builds/publishes only when Snapcraft credentials and store review are ready. | `sudo snap install yeelight-home` after store visibility. |
17
+ | Docker GHCR | Publishes multi-arch images when registry credentials are available. | `docker run --rm ghcr.io/yeelight/yeelight-home:latest version` |
18
+ | Docker Hub | Publishes multi-arch images when Docker Hub credentials are available. | `docker run --rm yeelight/yeelight-home:latest version` |
19
+ | pkg.go.dev | Indexes public `v*` module tags. | `https://pkg.go.dev/github.com/yeelight/yeelight-home` |
15
20
 
16
21
  ## Repository Layout Policy
17
22
 
18
- - Keep `Yeelight/yeelight-home` as the public Runtime source and release repository.
19
- - Keep `Yeelight/homebrew-tap` as a shared Homebrew tap for all Yeelight formulas. This is conventional because GitHub taps use the `homebrew-` prefix for the short `brew tap Yeelight/tap` form.
20
- - Scoop does not require a Yeelight organization repository or a dedicated repository. It only needs a Git bucket repository containing JSON manifests. `Yeelight/scoop-bucket` is valid and already published; if repository count becomes a problem, future Scoop manifests can move into a consolidated distribution repository, but the existing bucket should remain as a compatibility pointer.
21
- - Winget does not require a Yeelight repository. Official publication happens through `microsoft/winget-pkgs`; any personal fork is only a PR workspace.
22
- - npm does not require a GitHub repository. It requires an npm account or automation token with permission to publish `yeelight-home` or the chosen scoped package.
23
+ - `Yeelight/yeelight-home` is the public Runtime source and release repository.
24
+ - The monorepo remains the source of truth. Do not put a nested `.git` repository under `yeelight-smart-home/runtime`.
25
+ - Runtime-only source is exported by `scripts/export-runtime-public.sh`.
26
+ - `Yeelight/homebrew-tap` is a conventional shared Homebrew tap. It is not a runtime source repo, should stay small, and should contain only package manager metadata generated or reviewed for release.
27
+ - `Yeelight/scoop-bucket` is a conventional shared Scoop bucket. Scoop can live in one consolidated Yeelight bucket repository; it does not need one repository per app.
28
+ - Winget does not need a Yeelight organization repository. Publication happens through `microsoft/winget-pkgs`; any fork is only a PR workspace.
29
+ - AUR does require an AUR Git repository per package, but that repository is not in the GitHub organization.
30
+ - Snap is managed through Snapcraft, not a GitHub distribution repo.
31
+ - Docker Hub and GHCR are image registries, not source repositories.
32
+
33
+ ## GoReleaser Decision
34
+
35
+ Use GoReleaser for the public runtime release pipeline.
36
+
37
+ Reasoning:
38
+
39
+ - GoReleaser standardizes cross-platform Go builds, archives, checksums, Linux packages, Homebrew, Scoop, Docker images, SBOMs, AUR, Snap, and Winget workflows.
40
+ - It replaces the old monorepo hand-written cross-compile/package/release workflow. The monorepo now mirrors source only; public release builds happen in `Yeelight/yeelight-home`.
41
+ - It aligns with Go CLI user expectations and improves discoverability through package managers.
42
+ - It still does not remove external gates: Winget review, AUR account/SSH, Snapcraft credentials, Docker Hub credentials, and Homebrew/Scoop write tokens are still required.
43
+ - The public workflow automatically skips channels whose secrets are not configured, so optional channels do not block core GitHub Release assets, checksums, install scripts, npm wrapper assets and Linux package assets.
44
+ - GoReleaser v2.16 marks Homebrew formula generation as deprecated. New automation uses Homebrew Casks; the existing Formula entry can remain as a compatibility install path if already published.
45
+
46
+ Scope:
47
+
48
+ - Use GoReleaser in the public `Yeelight/yeelight-home` repository.
49
+ - Keep the monorepo export workflow responsible only for validating and pushing runtime-only public repo content.
50
+ - Use standard public runtime tags such as `v0.1.1` for Go ecosystem compatibility.
51
+ - Keep previous `yeelight-home-v*` release tags installable where they already exist, but do not use that prefix for future public runtime tags.
52
+
53
+ ## Tap And Bucket Retention
54
+
55
+ Keep `Yeelight/homebrew-tap` and `Yeelight/scoop-bucket`.
56
+
57
+ They remain useful and standard even after GoReleaser adoption:
58
+
59
+ - Homebrew and Scoop install flows require a tap or bucket repository unless the package is accepted into broader upstream registries.
60
+ - GoReleaser updates those repositories automatically; maintainers should not hand-edit generated version URLs and checksums except for emergency repair.
61
+ - A shared `homebrew-tap` and `scoop-bucket` is cleaner than one repository per CLI. These repositories should contain only package metadata for Yeelight public tools.
62
+ - They must not contain Runtime source, Skill assets, raw docs, credentials, generated release archives, or development governance material.
63
+
64
+ Do not create extra Yeelight organization repositories for Winget, Snap, Docker, or pkg.go.dev. Those channels use external registries or the existing public Runtime repository.
65
+
66
+ ## Release Automation Targets
67
+
68
+ GoReleaser configuration lives at:
69
+
70
+ ```text
71
+ runtime/.goreleaser.yaml
72
+ ```
73
+
74
+ The exported public repo includes:
75
+
76
+ ```text
77
+ .goreleaser.yaml
78
+ Dockerfile
79
+ README.md
80
+ INSTALL.md
81
+ CONFIG.md
82
+ DISTRIBUTION.md
83
+ RELEASING.md
84
+ cmd/
85
+ internal/
86
+ npm/
87
+ scripts/
88
+ go.mod
89
+ go.sum
90
+ ```
91
+
92
+ Target artifacts:
93
+
94
+ - Archives:
95
+ - `darwin/amd64`
96
+ - `darwin/arm64`
97
+ - `linux/amd64`
98
+ - `linux/arm64`
99
+ - `linux/arm/v7`
100
+ - `windows/amd64`
101
+ - `windows/arm64`
102
+ - Checksums:
103
+ - `checksums.txt`
104
+ - Linux packages:
105
+ - `.deb`
106
+ - `.rpm`
107
+ - `.apk`
108
+ - Arch package artifact
109
+ - Package-manager manifests:
110
+ - Homebrew cask in `Yeelight/homebrew-tap`
111
+ - Scoop manifest in `Yeelight/scoop-bucket`
112
+ - Winget manifest or PR flow once enabled
113
+ - AUR `yeelight-home-bin` once AUR SSH is configured
114
+ - Snap package once Snapcraft is configured
115
+ - Container images:
116
+ - `ghcr.io/yeelight/yeelight-home`
117
+ - `yeelight/yeelight-home`
118
+
119
+ ## Required Release Settings
120
+
121
+ GitHub Actions provides `GITHUB_TOKEN` automatically for GitHub Releases and GHCR publishing. Do not create a repository secret named `GITHUB_TOKEN`.
122
+
123
+ | Secret | Purpose |
124
+ | --- | --- |
125
+ | `HOMEBREW_TAP_GITHUB_TOKEN` | Push Homebrew cask to `Yeelight/homebrew-tap`. |
126
+ | `SCOOP_BUCKET_GITHUB_TOKEN` | Push Scoop manifest to `Yeelight/scoop-bucket`. |
127
+ | `NPM_TOKEN` | Publish npm wrapper package. |
128
+ | `DOCKERHUB_USERNAME` | Docker Hub login. |
129
+ | `DOCKERHUB_TOKEN` | Docker Hub publish token. |
130
+ | `AUR_KEY` | AUR SSH private key for `yeelight-home-bin`. |
131
+ | `SNAPCRAFT_STORE_CREDENTIALS` | Snap store publish credentials. |
132
+ | `WINGET_GITHUB_TOKEN` | Winget manifest PR token. |
133
+
134
+ | Repository Variable | Purpose |
135
+ | --- | --- |
136
+ | `WINGET_REPOSITORY_OWNER` | Winget PR workspace fork owner. |
137
+ | `WINGET_REPOSITORY_NAME` | Winget PR workspace fork name. |
138
+ | `WINGET_REPOSITORY_BRANCH` | Optional Winget PR branch. Defaults to a release-specific branch. |
139
+ | `AUR_GIT_URL` | Optional AUR Git URL override. Defaults to `ssh://aur@aur.archlinux.org/yeelight-home-bin.git`. |
140
+
141
+ Only configure settings for channels that are ready to publish.
142
+ Without Winget token and PR workspace variables, the public release workflow skips Winget and still publishes core GitHub Release artifacts.
23
143
 
24
144
  ## npm Package Model
25
145
 
@@ -33,6 +153,29 @@ The npm package is a thin installer and launcher:
33
153
  Environment overrides:
34
154
 
35
155
  - `YEELIGHT_HOME_REPO=owner/repo`
36
- - `YEELIGHT_HOME_VERSION=yeelight-home-v0.1.0` or `latest`
156
+ - `YEELIGHT_HOME_VERSION=v0.1.1` or `latest`
37
157
  - `YEELIGHT_HOME_NPM_CACHE_DIR=/custom/cache`
38
158
  - `YEELIGHT_HOME_NPM_SKIP_INSTALL=1`
159
+
160
+ ## Skill Distribution Contract
161
+
162
+ Skill packages include only:
163
+
164
+ - Skill instructions.
165
+ - Skill references and schemas.
166
+ - Wrapper scripts that call `yeelight-home invoke --stdin`.
167
+
168
+ Skill packages must not include:
169
+
170
+ - Runtime source.
171
+ - Runtime binaries.
172
+ - Installer scripts.
173
+ - Development docs.
174
+ - Raw API docs or compatibility-service references.
175
+
176
+ When Runtime is missing, the Skill should guide users to install `yeelight-home` from a public channel and then run:
177
+
178
+ ```sh
179
+ yeelight-home auth status --json
180
+ yeelight-home auth login --qr
181
+ ```
package/INSTALL.md CHANGED
@@ -1,80 +1,247 @@
1
1
  # Installation
2
2
 
3
+ This document is for users installing the standalone `yeelight-home` CLI.
4
+
5
+ ## Verify An Existing Install
6
+
7
+ ```sh
8
+ yeelight-home version
9
+ yeelight-home doctor --json
10
+ ```
11
+
12
+ After installing, authenticate locally:
13
+
14
+ ```sh
15
+ yeelight-home auth status --json
16
+ yeelight-home auth login --qr
17
+ ```
18
+
19
+ The default region is `cn`. Use `--region sg`, `--region us`, or `--region eu` when needed.
20
+
3
21
  ## GitHub Releases
4
22
 
23
+ GitHub Releases are the canonical fallback channel for all platforms.
24
+
5
25
  macOS and Linux:
6
26
 
7
27
  ```sh
8
- curl -fsSL https://github.com/yeelight/yeelight-home/releases/latest/download/install.sh | sh
28
+ curl -fsSL https://github.com/Yeelight/yeelight-home/releases/latest/download/install.sh | sh
9
29
  ```
10
30
 
11
31
  Windows PowerShell:
12
32
 
13
33
  ```powershell
14
- iwr https://github.com/yeelight/yeelight-home/releases/latest/download/install.ps1 -UseB | iex
34
+ iwr https://github.com/Yeelight/yeelight-home/releases/latest/download/install.ps1 -UseB | iex
15
35
  ```
16
36
 
17
- Override the install source when testing a fork:
37
+ Installer overrides:
18
38
 
19
39
  ```sh
20
- YEELIGHT_HOME_REPO=owner/repo YEELIGHT_HOME_VERSION=yeelight-home-v1.0.0 sh install.sh
40
+ YEELIGHT_HOME_REPO=Yeelight/yeelight-home \
41
+ YEELIGHT_HOME_VERSION=v0.1.1 \
42
+ YEELIGHT_HOME_INSTALL_DIR="$HOME/.local/bin" \
43
+ sh install.sh
21
44
  ```
22
45
 
23
46
  PowerShell:
24
47
 
25
48
  ```powershell
26
- $env:YEELIGHT_HOME_REPO="owner/repo"
27
- $env:YEELIGHT_HOME_VERSION="yeelight-home-v1.0.0"
49
+ $env:YEELIGHT_HOME_REPO="Yeelight/yeelight-home"
50
+ $env:YEELIGHT_HOME_VERSION="v0.1.1"
51
+ $env:YEELIGHT_HOME_INSTALL_DIR="$env:LOCALAPPDATA\Programs\YeelightHome\bin"
28
52
  .\install.ps1
29
53
  ```
30
54
 
31
- ## Package Managers
55
+ The installers verify `checksums.txt` before copying the binary.
32
56
 
33
- Homebrew:
57
+ ## macOS And Linux: Homebrew
34
58
 
35
59
  ```sh
36
60
  brew install Yeelight/tap/yeelight-home
37
61
  ```
38
62
 
39
- Scoop:
63
+ Upgrade:
64
+
65
+ ```sh
66
+ brew update
67
+ brew upgrade yeelight-home
68
+ ```
69
+
70
+ Uninstall:
71
+
72
+ ```sh
73
+ brew uninstall yeelight-home
74
+ ```
75
+
76
+ ## Windows: Scoop
40
77
 
41
78
  ```powershell
42
79
  scoop bucket add yeelight https://github.com/Yeelight/scoop-bucket
43
80
  scoop install yeelight-home
44
81
  ```
45
82
 
46
- Debian/Ubuntu:
83
+ Upgrade:
47
84
 
48
- ```sh
49
- curl -LO https://github.com/Yeelight/yeelight-home/releases/download/yeelight-home-v0.1.0/yeelight-home_0.1.0_amd64.deb
50
- sudo apt install ./yeelight-home_0.1.0_amd64.deb
85
+ ```powershell
86
+ scoop update yeelight-home
51
87
  ```
52
88
 
53
- Winget:
89
+ Uninstall:
54
90
 
55
- - Submitted for review: https://github.com/microsoft/winget-pkgs/pull/392555
56
- - After merge: `winget install Yeelight.yeelight-home`
91
+ ```powershell
92
+ scoop uninstall yeelight-home
93
+ ```
57
94
 
58
- npm:
95
+ ## Windows: Winget
96
+
97
+ Winget is published through `microsoft/winget-pkgs`.
98
+
99
+ After the Yeelight package is accepted:
100
+
101
+ ```powershell
102
+ winget install Yeelight.yeelight-home
103
+ winget upgrade Yeelight.yeelight-home
104
+ winget uninstall Yeelight.yeelight-home
105
+ ```
106
+
107
+ If Winget cannot find the package yet, use GitHub Releases, Scoop, Homebrew on WSL, or npm.
108
+
109
+ ## npm Wrapper
110
+
111
+ The npm package is a thin launcher. It downloads the matching GitHub Release binary on install or first run and verifies the checksum.
59
112
 
60
113
  ```sh
61
114
  npm install -g yeelight-home
115
+ yeelight-home version
116
+ ```
117
+
118
+ Environment overrides:
119
+
120
+ | Variable | Purpose |
121
+ | --- | --- |
122
+ | `YEELIGHT_HOME_REPO` | Release repository, default `Yeelight/yeelight-home`. |
123
+ | `YEELIGHT_HOME_VERSION` | Release tag or `latest`. |
124
+ | `YEELIGHT_HOME_NPM_CACHE_DIR` | Binary cache directory. |
125
+ | `YEELIGHT_HOME_NPM_SKIP_INSTALL=1` | Skip binary download during npm install. |
126
+
127
+ ## Linux Packages
128
+
129
+ GoReleaser produces Linux packages through nFPM:
130
+
131
+ - Debian/Ubuntu: `.deb`
132
+ - Fedora/RHEL/openSUSE: `.rpm`
133
+ - Alpine: `.apk`
134
+ - Arch package artifact
135
+
136
+ Debian/Ubuntu example:
137
+
138
+ ```sh
139
+ curl -LO https://github.com/Yeelight/yeelight-home/releases/download/v0.1.1/yeelight-home_0.1.1_linux_amd64.deb
140
+ sudo apt install ./yeelight-home_0.1.1_linux_amd64.deb
62
141
  ```
63
142
 
64
- ## Verify
143
+ RPM example:
65
144
 
66
145
  ```sh
67
- yeelight-home version
68
- yeelight-home doctor --json
146
+ curl -LO https://github.com/Yeelight/yeelight-home/releases/download/v0.1.1/yeelight-home_0.1.1_linux_amd64.rpm
147
+ sudo rpm -i ./yeelight-home_0.1.1_linux_amd64.rpm
69
148
  ```
70
149
 
150
+ Package filenames can vary by GoReleaser version. Check the release asset list when installing a pinned version.
151
+
152
+ ## Arch Linux AUR
153
+
154
+ The planned package name is:
155
+
156
+ ```sh
157
+ yay -S yeelight-home-bin
158
+ ```
159
+
160
+ AUR publication requires an AUR package repository and deploy key. Until that is enabled, install from GitHub Releases or use the generated Arch package artifact from the release.
161
+
162
+ ## Snap
163
+
164
+ The planned Snap name is:
165
+
166
+ ```sh
167
+ sudo snap install yeelight-home
168
+ ```
169
+
170
+ Snap publication requires Snapcraft credentials and store review. Until the Snap is visible in the store, install from GitHub Releases, Homebrew, npm, or Linux package assets.
171
+
172
+ ## Docker And Container Images
173
+
174
+ Container images are intended for NAS, server, Raspberry Pi, and scheduled automation environments.
175
+
176
+ GHCR:
177
+
178
+ ```sh
179
+ docker run --rm ghcr.io/yeelight/yeelight-home:latest version
180
+ ```
181
+
182
+ Docker Hub:
183
+
184
+ ```sh
185
+ docker run --rm yeelight/yeelight-home:latest version
186
+ ```
187
+
188
+ Persist local config and credentials:
189
+
190
+ ```sh
191
+ docker run --rm -it \
192
+ -v "$HOME/.yeelight-home:/home/nonroot/.yeelight-home" \
193
+ ghcr.io/yeelight/yeelight-home:latest doctor --json
194
+ ```
195
+
196
+ Supported image platforms:
197
+
198
+ - `linux/amd64`
199
+ - `linux/arm64`
200
+ - `linux/arm/v7`
201
+
202
+ ## Go Ecosystem Discovery
203
+
204
+ For Go tooling and pkg.go.dev discovery, the public repository should use standard semantic tags such as `v0.1.1` and module path `github.com/yeelight/yeelight-home`.
205
+
206
+ Once a tag exists publicly:
207
+
208
+ ```sh
209
+ GOPROXY=https://proxy.golang.org go list -m github.com/yeelight/yeelight-home@v0.1.1
210
+ ```
211
+
212
+ pkg.go.dev indexes the module from the public repository and tag.
213
+
214
+ ## PATH And Skill Hosts
215
+
216
+ Most package managers put `yeelight-home` on `PATH`. If a Skill host cannot find it:
217
+
218
+ ```sh
219
+ export YEELIGHT_HOME_BIN="$(command -v yeelight-home)"
220
+ ```
221
+
222
+ Windows PowerShell:
223
+
224
+ ```powershell
225
+ $env:YEELIGHT_HOME_BIN=(Get-Command yeelight-home).Source
226
+ ```
227
+
228
+ Restart the host application after changing user PATH.
229
+
71
230
  ## Uninstall
72
231
 
73
- Remove the binary from the install directory and delete local Runtime data only when you intend to remove credentials and local preferences:
232
+ Remove the binary through the same installer or package manager that installed it.
233
+
234
+ Manual GitHub installer cleanup:
74
235
 
75
236
  ```sh
76
237
  rm -f /usr/local/bin/yeelight-home
238
+ rm -f "$HOME/.local/bin/yeelight-home"
239
+ ```
240
+
241
+ Local Runtime data and credentials are separate. Delete them only when you intend to remove local preferences and credentials:
242
+
243
+ ```sh
77
244
  rm -rf ~/.yeelight-home
78
245
  ```
79
246
 
80
- On Windows, remove `%LOCALAPPDATA%\Programs\YeelightHome\bin\yeelight-home.exe` and remove that directory from the user `Path` if it was added by the installer.
247
+ On Windows, remove `%LOCALAPPDATA%\YeelightHome` after deleting the package or binary.
package/README.md CHANGED
@@ -1,19 +1,32 @@
1
1
  # yeelight-home
2
2
 
3
- `yeelight-home` is the local Runtime CLI for Yeelight smart-home Skills. It keeps credentials on the user's machine, resolves semantic Skill requests, calls Yeelight cloud APIs directly, and returns redacted structured results.
3
+ `yeelight-home` is the standalone local Runtime CLI for Yeelight smart-home Skills and automation scripts. It runs on the user's machine, keeps credentials local, resolves semantic smart-home requests, calls Yeelight cloud APIs directly, and returns redacted structured results.
4
+
5
+ The Runtime is intentionally not bundled inside Skills. A Skill finds `yeelight-home` through `YEELIGHT_HOME_BIN` or `PATH` and sends one JSON request to `yeelight-home invoke --stdin`.
6
+
7
+ ## Features
8
+
9
+ - Direct Yeelight cloud API access for homes, rooms, areas, devices, groups, gateways, scenes, automations, diagnostics, lighting design, memory, and personalization.
10
+ - Guarded write model for persistent changes: risky changes create a local pending plan first, and `plan.commit` executes only a stored `planId`.
11
+ - Local credential handling: access tokens are stored in the system credential store when available, with a protected local fallback.
12
+ - Multiple profiles for different accounts, regions, or homes.
13
+ - Region-aware cloud endpoints with default region `cn`.
14
+ - Redacted JSON output for Skill hosts and diagnostics.
15
+ - Cross-platform distribution through the GoReleaser-backed GitHub Releases pipeline, with Homebrew, Scoop, npm, Linux packages, and optional container/package-manager channels.
16
+ - Optional Docker/GHCR and Docker Hub images for NAS, server, and scheduled automation use.
4
17
 
5
18
  ## Install
6
19
 
7
- Install from the public runtime release repository:
20
+ macOS and Linux:
8
21
 
9
22
  ```sh
10
- curl -fsSL https://github.com/yeelight/yeelight-home/releases/latest/download/install.sh | sh
23
+ curl -fsSL https://github.com/Yeelight/yeelight-home/releases/latest/download/install.sh | sh
11
24
  ```
12
25
 
13
26
  Windows PowerShell:
14
27
 
15
28
  ```powershell
16
- iwr https://github.com/yeelight/yeelight-home/releases/latest/download/install.ps1 -UseB | iex
29
+ iwr https://github.com/Yeelight/yeelight-home/releases/latest/download/install.ps1 -UseB | iex
17
30
  ```
18
31
 
19
32
  Homebrew:
@@ -29,47 +42,194 @@ scoop bucket add yeelight https://github.com/Yeelight/scoop-bucket
29
42
  scoop install yeelight-home
30
43
  ```
31
44
 
32
- Debian/Ubuntu users can download the `yeelight-home_0.1.0_amd64.deb` or `yeelight-home_0.1.0_arm64.deb` asset from the GitHub Release and install it with `apt` or `dpkg`.
33
-
34
- Npm:
45
+ npm wrapper:
35
46
 
36
47
  ```sh
37
48
  npm install -g yeelight-home
38
49
  ```
39
50
 
40
- Winget publication is submitted for review at https://github.com/microsoft/winget-pkgs/pull/392555. Until it is merged, use GitHub Releases, Homebrew, Scoop, or set `YEELIGHT_HOME_BIN` to an absolute `yeelight-home` executable path.
51
+ Debian, Ubuntu, Fedora, Arch, AUR, Snap, Docker, GHCR, Docker Hub, and Winget channel details are maintained in [INSTALL.md](INSTALL.md) and [DISTRIBUTION.md](DISTRIBUTION.md).
41
52
 
42
53
  ## Quick Start
43
54
 
44
55
  ```sh
45
56
  yeelight-home version
57
+ yeelight-home doctor --json
46
58
  yeelight-home auth status --json
47
- yeelight-home auth login --qr --region dev
59
+ yeelight-home auth login --qr
48
60
  yeelight-home home list --json
61
+ # Optional: choose a default home before house-scoped device, room, scene, or automation operations.
49
62
  yeelight-home home select --house-id <house-id>
50
- yeelight-home doctor --json
51
63
  ```
52
64
 
65
+ The default region is `cn`. Pass `--region sg`, `--region us`, or `--region eu` when your Yeelight account belongs to another cloud region.
66
+
53
67
  For non-interactive local setup, import a token outside chat:
54
68
 
55
69
  ```sh
56
- yeelight-home auth token set --token <access-token> --region cn --client-id <client-id> --house-id <house-id>
70
+ yeelight-home auth token set --token <access-token> --region cn
57
71
  ```
58
72
 
59
- Do not paste tokens into AI chat. The CLI stores tokens in the system credential store when available, and otherwise in a protected local credential fallback under the Runtime config directory.
73
+ Token-only setup is valid. `houseId` is optional profile metadata for the default home. Account-level commands such as `auth status`, `doctor`, `api smoke`, `home list`, `home.summary`, `home.search`, and `account.info` do not require it. House-scoped operations such as device, room, scene, group, gateway, favorite, and automation actions require a `houseId` from the request, `YEELIGHT_HOME_HOUSE_ID`, or the selected profile.
60
74
 
61
- ## Skill Integration
75
+ Do not paste tokens into AI chat. The CLI stores tokens locally and never prints token values in normal status or doctor output.
76
+
77
+ ## Configuration Model
78
+
79
+ Runtime settings are resolved in this order:
80
+
81
+ 1. Command flags.
82
+ 2. Environment variables.
83
+ 3. Active profile metadata and credential store.
84
+ 4. Defaults.
85
+
86
+ Default values:
87
+
88
+ - Profile: `default`
89
+ - Region: `cn`
90
+ - Home: unset until selected, and only required for house-scoped operations
91
+
92
+ Common environment variables:
93
+
94
+ | Variable | Purpose |
95
+ | --- | --- |
96
+ | `YEELIGHT_HOME_BIN` | Absolute path used by Skills to find the CLI. |
97
+ | `YEELIGHT_HOME_PROFILE` | Selects a profile for this process. |
98
+ | `YEELIGHT_CLOUD_REGION` | Overrides region for this process: `cn`, `sg`, `us`, `eu`, or `dev` for development. |
99
+ | `YEELIGHT_HOME_HOUSE_ID` | Temporarily overrides selected home. |
100
+ | `YEELIGHT_HOME_ACCESS_TOKEN` | Temporary token for local smoke tests or CI; not written to profile metadata. |
101
+ | `YEELIGHT_HOME_DIR` | Overrides Runtime home directory. |
102
+ | `YEELIGHT_API_BASE_URL` | Developer-only API base URL override. Do not use in Skill prompts or user automation. |
103
+
104
+ See [CONFIG.md](CONFIG.md) for full command and precedence details.
105
+
106
+ ## Command Reference
107
+
108
+ ### `doctor`
109
+
110
+ ```sh
111
+ yeelight-home doctor --json [--profile <name>] [--region <region>] [--house-id <id>]
112
+ ```
113
+
114
+ Reports installation, config directories, selected profile, selected region, selected home, token presence, and warnings. Token values are never printed.
115
+ The selected home may be empty; that is healthy for token-only account-level use.
116
+
117
+ ### `auth status`
118
+
119
+ ```sh
120
+ yeelight-home auth status --json [--profile <name>]
121
+ ```
122
+
123
+ Reports whether the selected profile has a usable local credential.
62
124
 
63
- Skills should call only:
125
+ ### `auth login`
126
+
127
+ ```sh
128
+ yeelight-home auth login --qr [--profile <name>] [--region <region>] [--house-id <id>] [--json] [--qr-png <path>]
129
+ ```
130
+
131
+ Starts the local QR login flow. If `--region` is omitted, `cn` is used.
132
+ `--house-id` is optional and should be used only when a home context must be carried into the login payload.
133
+
134
+ ### `auth token set`
135
+
136
+ ```sh
137
+ yeelight-home auth token set --token <access-token> [--profile <name>] [--region <region>] [--house-id <id>] [--json]
138
+ ```
139
+
140
+ Imports a token into the local credential store. It never writes the token into the profile metadata file.
141
+ `--house-id` is optional. Omit it when you only need account-level commands or plan to select a home later.
142
+
143
+ ### `profile`
144
+
145
+ ```sh
146
+ yeelight-home profile list [--json]
147
+ yeelight-home profile show [--profile <name>] [--json]
148
+ yeelight-home profile use --profile <name> [--region <region>] [--house-id <id>] [--json]
149
+ yeelight-home profile delete --profile <name> [--json]
150
+ ```
151
+
152
+ Profiles isolate account metadata and selected home. Use `YEELIGHT_HOME_PROFILE` or `--profile` for temporary selection.
153
+ The selected home can be empty in a profile.
154
+
155
+ ### `config`
156
+
157
+ ```sh
158
+ yeelight-home config get [--profile <name>] [--region <region>] [--house-id <id>] [--json]
159
+ yeelight-home config set [--profile <name>] [--region <region>] [--house-id <id>] [--qr-device <mac>] [--json]
160
+ yeelight-home config unset [--profile <name>] [--region] [--house-id] [--qr-device] [--json]
161
+ ```
162
+
163
+ `config` changes non-secret profile metadata only.
164
+
165
+ ### `home`
166
+
167
+ ```sh
168
+ yeelight-home home list [--profile <name>] [--region <region>] [--json]
169
+ yeelight-home home select --house-id <id> [--profile <name>] [--region <region>] [--json]
170
+ ```
171
+
172
+ Lists homes available to the selected credential and stores the default home for later Skill calls.
173
+ Run `home select` only when you want future house-scoped commands to use a default home. You can also pass a one-time `--house-id` or `YEELIGHT_HOME_HOUSE_ID`.
174
+
175
+ ### `invoke`
64
176
 
65
177
  ```sh
66
178
  yeelight-home invoke --stdin
67
179
  ```
68
180
 
69
- The Yeelight Smart Home Skill wrapper resolves the Runtime in this order:
181
+ Reads a SkillRequest JSON object from stdin and writes a SkillResponse JSON object to stdout. This is the only command Skills should call for smart-home operations.
182
+
183
+ ### `api smoke`
184
+
185
+ ```sh
186
+ yeelight-home api smoke --json [--profile <name>] [--region <region>] [--house-id <id>]
187
+ ```
188
+
189
+ Runs a local cloud smoke check using the selected credential. This is intended for installation and support diagnostics.
190
+
191
+ ## Skill Integration
192
+
193
+ Skill wrapper lookup order:
70
194
 
71
195
  1. `YEELIGHT_HOME_BIN`
72
- 2. development-only bundled binary when present in a source checkout
196
+ 2. Development-only source checkout binary
73
197
  3. `yeelight-home` on `PATH`
74
198
 
75
- No Skill should call raw URLs, headers, curl, MCP compatibility services, or token-bearing commands.
199
+ When the Runtime is missing, install it from a published public channel, then run:
200
+
201
+ ```sh
202
+ yeelight-home auth status --json
203
+ yeelight-home auth login --qr
204
+ yeelight-home home list --json
205
+ ```
206
+
207
+ Skills must not call raw URLs, raw headers, curl, compatibility services, or token-bearing commands.
208
+
209
+ ## Release And Packaging
210
+
211
+ `yeelight-home` uses a runtime-only public repository at `Yeelight/yeelight-home`. The source-of-truth code remains under `yeelight-smart-home/runtime` and is exported by automation.
212
+
213
+ The public runtime release pipeline uses GoReleaser from `Yeelight/yeelight-home`. The monorepo mirror workflow only validates and exports runtime source; it no longer builds or publishes CLI binaries.
214
+
215
+ One tagged public `v*` release can produce:
216
+
217
+ - macOS, Linux, Windows archives for `amd64`, `arm64`, and Linux `armv7`.
218
+ - Checksums and release metadata.
219
+ - Homebrew tap cask automation, with existing Formula compatibility where already published.
220
+ - Scoop bucket manifest.
221
+ - Linux packages through nFPM: `.deb`, `.rpm`, `.apk`, and Arch package artifacts.
222
+ - Docker/GHCR and Docker Hub multi-arch images.
223
+ - Snap and AUR artifacts or publication when required credentials are configured.
224
+ - Winget manifest or PR flow when the Windows package route is enabled.
225
+
226
+ `Yeelight/homebrew-tap` and `Yeelight/scoop-bucket` remain standard package-manager metadata repositories. They should be updated by GoReleaser, not used as Runtime source repositories.
227
+
228
+ See [DISTRIBUTION.md](DISTRIBUTION.md) and [RELEASING.md](RELEASING.md).
229
+
230
+ ## Security Notes
231
+
232
+ - Do not paste tokens, passwords, or account secrets into AI chat.
233
+ - `auth status`, `doctor`, and `invoke` responses are redacted.
234
+ - Profile metadata contains non-secret values such as profile name, region, selected home, and QR device identity. Tokens stay in credential storage.
235
+ - Persistent writes use the Runtime pending-plan model; the model cannot execute arbitrary raw API payloads.
@@ -43,7 +43,8 @@ function resolveTarget() {
43
43
  };
44
44
  const archMap = {
45
45
  x64: "amd64",
46
- arm64: "arm64"
46
+ arm64: "arm64",
47
+ arm: "armv7"
47
48
  };
48
49
 
49
50
  const goos = platformMap[process.platform];
@@ -51,9 +52,12 @@ function resolveTarget() {
51
52
  if (!goos || !goarch) {
52
53
  throw new Error(`unsupported platform: ${process.platform}/${process.arch}`);
53
54
  }
55
+ if (goarch === "armv7" && process.platform !== "linux") {
56
+ throw new Error(`unsupported platform: ${process.platform}/${process.arch}`);
57
+ }
54
58
 
55
59
  const repo = process.env.YEELIGHT_HOME_REPO || "Yeelight/yeelight-home";
56
- const version = process.env.YEELIGHT_HOME_VERSION || `yeelight-home-v${packageInfo.version}`;
60
+ const version = process.env.YEELIGHT_HOME_VERSION || `v${packageInfo.version}`;
57
61
  const extension = goos === "windows" ? "zip" : "tar.gz";
58
62
  const assetName = `yeelight-home-${goos}-${goarch}.${extension}`;
59
63
  const releasePath = version === "latest" ? "latest/download" : `download/${version}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yeelight-home",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Local Yeelight Home Runtime CLI installer and launcher.",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://github.com/Yeelight/yeelight-home#readme",
@@ -15,7 +15,9 @@
15
15
  "yeelight-home": "npm/bin/yeelight-home.js"
16
16
  },
17
17
  "files": [
18
- "npm/",
18
+ "npm/bin/",
19
+ "npm/lib/",
20
+ "npm/install.js",
19
21
  "README.md",
20
22
  "INSTALL.md",
21
23
  "CONFIG.md",
@@ -35,7 +37,8 @@
35
37
  ],
36
38
  "cpu": [
37
39
  "x64",
38
- "arm64"
40
+ "arm64",
41
+ "arm"
39
42
  ],
40
43
  "publishConfig": {
41
44
  "access": "public"
@@ -1,24 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- "use strict";
4
-
5
- const { spawnSync } = require("node:child_process");
6
- const { ensureRuntimeBinary } = require("../lib/runtime-installer");
7
-
8
- const result = ensureRuntimeBinary();
9
- if (!result.ok) {
10
- console.error(result.message);
11
- process.exit(result.code || 1);
12
- }
13
-
14
- const child = spawnSync(result.binaryPath, process.argv.slice(2), {
15
- stdio: "inherit",
16
- windowsHide: false
17
- });
18
-
19
- if (child.error) {
20
- console.error(child.error.message);
21
- process.exit(1);
22
- }
23
-
24
- process.exit(child.status === null ? 1 : child.status);