Skip to main content

govee-cli

Agent-first CLI that controls a Govee lamp at home: discover it, switch it on and off, set brightness, color, color temperature and scenes, and fade between them, over the local LAN API with Govee's cloud Developer API as a fallback. It also runs a web console with usage stats and an MCP server for agents. Writes are dry runs unless --apply, and every command has --json.

Built for a Govee H6076 floor lamp and tested against it; other Govee lights that offer LAN Control should work the same way.

Quickstart

uv sync
uv run govee devices                   # find lamps (LAN first, cloud fallback)
uv run govee light on                  # dry run: prints what it would send
uv run govee light on --apply          # actually turn it on (fades in over 5 s)
uv run govee light color FF6A2B --fade 5 --apply
uv run govee light temp 2700 --apply
uv run govee stats                     # usage tiles and recent events

The installed command is govee; python -m govee_cli works too.

Before the first run, open the lamp in the Govee Home app, go to its settings and turn on LAN Control. That is all the LAN path needs.

Three ways in

Entry point For Command
CLI you and scripts govee light ..., govee devices, govee stats
Web console phones and browsers on the LAN or Tailscale govee serve, then open the pairing link
MCP server AI agents (Claude Code, the AgentCulture mesh) govee mcp serve (see docs/mcp.md)

Culture-rules can drive the lamp too, through a runner actor; see docs/culture-rules/README.md. Schedules live in culture-rules, not here: govee-cli has no timers of its own.

Safety rules

  • Every write is a dry run unless you say otherwise: --apply on the CLI, apply: true over MCP, "Send to lamp" (or Live mode) in the console. A dry run prints the exact command that would go on the wire.
  • Every command is logged with its source (cli, mcp, web, rules) and the actor. Web console previews are the one exception: they are not logged.
  • The API key never leaves the environment. It is read from GOVEE_API_KEY (or from $XDG_CONFIG_HOME/govee-cli/env (default $HOME/.config) by the systemd unit) and never printed or committed.

Commands

Verb What it does
devices [--refresh] List lamps found on the LAN and in the Govee account.
light on, light off Power. Fades by default (GOVEE_FADE_DEFAULT, 5 s); --fade 0 snaps.
light brightness N Brightness 1-100.
light color HEX RGB color, e.g. FF6A2B.
light temp K White color temperature, 2000-9000 K.
light scene NAME A Govee scene (cloud only; needs GOVEE_API_KEY).
light state, light scenes Read the lamp and its scene list.
light fade-status, light fade-stop Watch or stop a running fade.
stats On-time today and this week, commands, recent events.
token new --name N [--save], token list, token revoke N Pair browsers, apps and MCP clients with govee serve.
serve [--host H] [--port P] [--rotate-token] [--trust NET] Run the web console and API (default 0.0.0.0:8742).
mcp serve Run the MCP server on stdio.
rules actor Print the culture-rules runner actor for this machine (read-only).
doctor [--no-scan] Health checks, including LAN interface, lamp discovery, API key presence and the stats database.
whoami, learn, explain <path>, overview, cli overview Identity and self-description for agents.

Light verbs take --device NAME|ID, --fade SECONDS (0-3600) and --json. Every command supports --json. Results go to stdout, errors and diagnostics to stderr (never mixed). Exit codes: 0 success, 1 user error, 2 environment error (lamp unreachable, missing key, rate limited), 3+ reserved.

How it reaches the lamp

  • LAN first. Discovery tries the lamp's last known address, Govee's multicast scan, and, if nothing answers, a quick unicast sweep of the local /24 (multicast does not reach every lamp on every Wi-Fi). Pin the interface with GOVEE_LAN_INTERFACE or the addresses with GOVEE_LAN_HOSTS. LAN writes are checked against the lamp's reported state and logged as confirmed or unconfirmed.
  • Cloud as fallback (GOVEE_API_KEY), and always for scenes. Fades need LAN; over the cloud a change applies instantly with a warning.
  • After a fade-out the lamp rests at brightness 1. A brightness command would switch it back on, so govee cannot restore the level while it is off. govee light on (and the console) bring back the earlier level; turning it on from the Govee app or the lamp's button lights it at 1 %.
  • govee serve owns the lamp while it runs. The CLI and the MCP server then send everything through it, using a token from GOVEE_TOKEN or the file govee token new --name me --save writes. Only serve needs the key.

The web console

govee serve                              # listens on 0.0.0.0:8742
govee token new --name phone             # prints a one-time pairing link

Open the link on the phone. The token travels in the URL fragment, so it never reaches the server's logs. Every API call, reads included, needs a paired device. The console shows the lamp, a dry-run "What will be sent" panel, fades, recent activity and usage charts. govee serve --rotate-token revokes every paired device.

To share control with everyone at home without handing out tokens, trust the networks you consider safe:

govee serve --trust lan --trust tailscale   # or GOVEE_TRUSTED_NETWORKS=lan,tailscale

A device on a trusted network opens http://<host>:8742/ and needs no token (it is logged as trusted <ip>). lan is the /24 of the default route, tailscale is 100.64.0.0/10 and its IPv6 range, and any CIDR works. Anyone on those networks (guests on the Wi-Fi, every device in the tailnet) can then control the lamp. Writes still need a same-origin request, and other networks still need a paired token.

To keep it running, install the user unit in docs/systemd/govee-serve.service. Put GOVEE_API_KEY=... in $XDG_CONFIG_HOME/govee-cli/env (default $HOME/.config) (mode 0600) if you use scenes.

Stats live in $XDG_STATE_HOME/govee-cli/stats.db (default $HOME/.local/state). Gaps in the charts mean govee serve was not sampling, never that the lamp was off.

The CLI is cited from teken (afi-cli), and the runtime package has no third-party dependencies.

Prompt files by harness

Four harnesses, four root files, no shared base. Each file is read by exactly one harness:

Harness File(s)
Claude Code CLAUDE.md
Pi / associate AGENTS.override.md + .pi/SYSTEM.md
colleague AGENTS.colleague.md
Qwen Code QWEN.md

Claude Code: CLAUDE.md is the fullest write-up of the repo's conventions and the mesh resident's prompt, so read it first.

Pi / associate: AGENTS.override.md replaces this directory's AGENTS.md/CLAUDE.md in Pi's context layer, so Pi does not inherit CLAUDE.md. .pi/SYSTEM.md replaces Pi's default system prompt with the non-coding associate identity (read/find/summarize only).

colleague: colleague's prompt cascade is AGENTS.md → AGENTS.colleague.md → AGENTS.colleague.<model>.md. This repo ships only the middle layer. There is no AGENTS.md (a shared base across harnesses was considered and rejected) and no per-model override file.

Qwen Code: Qwen Code reads QWEN.md and AGENTS.md. Since there is no AGENTS.md, QWEN.md is its only source of guidance.

There is intentionally no AGENTS.md at the root. Each harness gets its own file rather than cascading from a shared base, and the CI harness smoke check fails if one appears.

Two selections, not one

It is tempting to read "switch harness" as one decision. It is actually two:

  1. The interactive harness: which binary you run (claude, pi, colleague, qwen). cd into the clone and run any of them. All four are live at the same time, and none needs a file edit or a switch. A harness can be force-selected for one invocation (e.g. a CI smoke check) without ever touching culture.yaml. See docs/automation-contract.md.
  2. The mesh resident: the single backend that culture.yaml declares (claude here). The Culture daemon starts this resident, and steward doctor checks it. guild harness use <name> changes only this selection.

culture.yaml's backend affects (2) only. It never affects which harness you can invoke interactively in (1). See docs/harness-selection.md for the full writeup.

The gate section

culture.yaml carries a top-level gate section that declares how to set up and test this repo, so tooling (for example a PR-fixer that re-runs the checks before pushing) needs no per-repo knowledge:

gate:
  setup:
  - [uv, sync]
  test:
  - [uv, run, pytest, -n, auto]

setup and test are each a list of commands, and each command is an argv list (never a shell string), run in order from the repo root. The values are configuration only; no tool supplies a default. Culture's loader ignores unknown top-level keys, so the section is safe alongside agents.

Development

See CLAUDE.md for the full conventions: the lint commands CI runs, the CLI's error/output contract, version-bump-every-PR, the cicd PR lane, and deploy setup. In short:

  • Every PR bumps the version (version-bump skill); CI's version-check job blocks merge otherwise.
  • Deploy: a push to main publishes to PyPI via Trusted Publishing. PRs publish a dev build to TestPyPI.
  • Skills: .claude/skills/ vendors the guildmaster skill kit (cite-don't-import). See docs/skill-sources.md.

License

Apache 2.0 — see LICENSE.

Metadata

Release files for govee-cli 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for govee-cli 0.11.0
File Size Uploaded Provenance Actions
govee_cli-0.11.0.tar.gz 459.8 kB Without provenance Details for govee_cli-0.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for govee-cli 0.11.0
File Interpreter ABI Platform Actions
govee_cli-0.11.0-py3-none-any.whl Python 3 none any Details for govee_cli-0.11.0-py3-none-any.whl

Total release size: 592.5 kB

Release files / govee_cli-0.11.0.tar.gz

Download URL govee_cli-0.11.0.tar.gz
Size 459.8 kB
Tags Source
SHA-256 checksum
How to use checksums
484e183aeb6a2cdcc885cc9f55e8b505828f705e56db029aa8942ecddd2a4f15
BLAKE2b-256 checksum
How to use checksums
39441a5ed75d9c0e7281a5678ea7b214265a51abc391cf213623f6feab1ac6d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / govee_cli-0.11.0-py3-none-any.whl

Download URL govee_cli-0.11.0-py3-none-any.whl
Size 132.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
acb6ecfbace29935eb0e41249a91b2073e791d70600d1ef1ac84487dc58a0cb1
BLAKE2b-256 checksum
How to use checksums
95d28e7f084c6963a6c26bfb9559246032fcca851598f54b24fa37b0d7d4e36e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for govee-cli 0.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page