wyze-scale-cli
v0.1.1
Published
Read-only TypeScript CLI for Wyze Scale cloud measurements
Downloads
298
Readme
wyze-scale-cli
Read-only TypeScript CLI for Wyze Scale cloud measurements. It wraps wyze-node instead of talking to Wyze HTTP endpoints directly.
This is a small personal utility and is not affiliated with Wyze Labs. The underlying API is reverse-engineered and can break.
Why this exists
wyze-node already knows how to list devices and fetch scale records. It is a library, not a scale CLI. This experiment is a thin command layer on top:
wyze-scale doctor
wyze-scale login
wyze-scale status
wyze-scale scale list
wyze-scale scale latest
wyze-scale scale history --since 90d
wyze-scale scale usersSetup
Install the published CLI globally from npm:
npm install --global wyze-scale-cli
wyze-scale --helpTo run from source instead:
git clone https://github.com/crcatala/wyze-scale-cli.git
cd wyze-scale-cli
npm ci
npm test
npm run build
node dist/cli.js --helpDev without building:
npx tsx src/cli.ts doctorAuthentication
The Wyze developer API key is not sufficient. Scale reads need:
- A developer Key ID + API Key from developer-api-console.wyze.com
- A one-time account login (email + password) that produces access/refresh tokens
export WYZE_KEY_ID=...
export WYZE_API_KEY=...
# optional: WYZE_EMAIL / WYZE_PASSWORD for non-interactive login
npx tsx src/cli.ts login
npx tsx src/cli.ts statusNever pass the password or API key as CLI flags (they land in shell history). Prefer env vars or the hidden login prompts.
If you originally sign in with Google or Apple, create a normal Wyze password via Wyze's "Forgot password" flow first.
Tokens are stored at 0600 under the config dir:
| Platform | Default |
|---|---|
| Linux | ~/.config/wyze-scale-cli/tokens.json |
| macOS | ~/Library/Application Support/wyze-scale-cli/tokens.json |
| override | $WYZE_CONFIG_DIR |
wyze-node also creates a scratch/ directory next to that config dir because it initializes LocalStorage('./scratch') at import time. This CLI patches getTokens / setTokens so the real session lives in tokens.json.
Commands
| Command | Description |
|---|---|
| doctor [--strict] | Check Node, API-key env, and cached session |
| login | Prompt/env login and cache tokens |
| logout | Delete cached tokens |
| status / whoami | Show session without calling the API |
| scale list | List scales on the account |
| scale latest | Most recent measurement |
| scale history | History (--since 30d from now or --to; or --from / --to) |
| scale users | Family members on the scale |
Shared scale flags: --name <nickname>, --device <mac>, --user <family_member_id>.
Global output flags: --json --plain --table --csv --quiet --verbose --debug --no-color. Piped/non-TTY output defaults to JSON.
Cloud vs Bluetooth
This CLI reads cloud history. The scale must sync through the Wyze app first (often while the app is open nearby). For local BLE access to a Scale X, see wyze_scale_tool instead.
Publishing
The package name is wyze-scale-cli, while the installed command is wyze-scale.
The first publication requires npm authentication and publish access:
npm login
npm run release:firstFor subsequent releases, use a semver bump (or an explicit version):
npm run release -- patch
npm run release -- minor
npm run release -- 1.0.0The release helper requires a clean main checkout, runs the verification suite, publishes to
npm, creates a vX.Y.Z git tag, and pushes the commit/tag. It intentionally does not manage a
changelog yet.
Development
npm test
npm run typecheck
npm run lint
npm run buildCI runs these checks on Ubicloud's ubicloud-standard-2 GitHub Actions runner. Unit tests inject a fake wyze-node client; they never hit the live Wyze API.
