eyaeya

CLI for Xiaomi Central Hub Gateway Geek Edition (小米中枢网关极客版) — drive your gateway with Codex/Claude/other AI agents for vibe-coding automation rules. Unofficial.

12
1
89% credibility
Found Jun 01, 2026 at 12 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
TypeScript
AI Summary

This is an open-source command-line tool that lets you control and automate a Xiaomi Central Hub Geek Edition smart home gateway. It provides commands to view devices, create automation rules (combining triggers like button presses with actions like turning on lights), manage variables for complex logic, and backup/restore your configuration. The tool communicates with your hub over your local network using secure encrypted connections. It's designed for power users who want more control than the official app provides.

How It Works

1
🔍 You hear about automating your smart home hub

You discover there's a way to create custom automations for your Xiaomi gateway that go beyond what the app offers.

2
📦 You install the tool on your computer

The tool comes as a simple program you run in your terminal. You follow easy instructions to get it set up.

3
🔐 You connect to your hub using a special code

Your hub shows a 6-digit code that acts like a key. You enter it once and your computer remembers your hub for future sessions.

4
👀 You see everything connected to your hub

The tool shows you all your devices - lights, sensors, buttons - with clear names and whether they're online.

5
You choose what you want to do
🔧
Create automations

You build rules like 'when this button is pressed, turn on that light' by combining small building blocks

📊
Watch variables

You can see values that your automations use, like whether a light is on or what temperature it is

💾
Backup everything

You save a copy of all your rules and settings so you can restore them later

Your smart home works exactly how you want

Your custom automations run automatically on your hub. You can export them to share with others or recreate on another hub.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 12 to 12 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is xiaomi-central-hub-gateway-cli?

This is a CLI tool for Xiaomi's Central Hub Gateway "Geek Edition" that lets you drive your smart home gateway through code instead of the official mobile app. Written in TypeScript, it exposes the gateway's WebSocket-based RPC protocol as a set of human-readable commands. You can list devices, query their MIoT specs, create automation rules with complex node-and-edge graphs, manage variables, and export rules as shell scripts for backup or replication. The tool is explicitly designed to work alongside AI coding assistants—Codex, Claude, and similar—providing a structured interface that agents can orchestrate for "vibe-coding" automation rules.

Why is it gaining traction?

The standout feature is the agent-hints system. After each command, the CLI emits both machine-readable next steps and human-readable suggestions on stderr. This means an AI agent doesn't just execute commands blindly—it gets guidance on what to do next: validate the graph, enable the rule, check the logs. It turns the gateway from a black-box app into a programmable platform that AI agents can actually reason about. The export-as-shell feature is also clever: `xgg rule export` produces a runnable bash script that recreates an automation, so you can clone rules across gateways or commit them to version control.

Who should use this?

Home automation enthusiasts running the Xiaomi Central Hub Gateway Geek Edition who want more control than the official app offers. Developers building integrations or custom dashboards. Anyone using AI coding assistants to automate their smart home—because the CLI is designed from the ground up for agentic workflows, not just human operators. It's less useful for casual users who just want basic automations; the learning curve is steep and the documentation assumes familiarity with the gateway's internal model.

Verdict

At 12 stars this is a niche, early-stage project, but the credibility score of 0.9% reflects its unofficial status and limited community, not code quality—the architecture is solid with proper error handling, type safety, and comprehensive command coverage. If you own the Geek Edition gateway and want to automate beyond what the app allows, this is worth exploring. Just understand you're relying on reverse-engineered protocols and should verify behavior against the official UI before trusting critical automations.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.