cli

package
v0.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 57 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cli is the reference controller's command line: the module's controller role as a tool that pairs Matter nodes over IP or BLE, reads, writes, invokes and subscribes, creates groups and bindings and serves an OTA image. Its fabric — the CA, the fabric record, the client registry and the DCL trust store — lives in one SQLite database (--db), so every run is the same fabric and every node it paired still trusts it.

Three programs run it: examples/reference-controller (no BLE), ble/bluez/cmd/reference-controller (BLE over BlueZ) and ble/esphome/cmd/reference-controller (BLE through ESPHome Bluetooth proxies), the last two modules of their own, so the main module never imports godbus or a Noise library — ADR 0024 decision 3. They differ only in Options.Central and Options.Proxies.

It is an example, not API (README.md §API stability): copy from it, do not build against it. The README beside the program lists every command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string, stdin io.Reader, stdout io.Writer, o Options) error

Run is the tool: args without the program name. A command that fails returns its error, which the program prints before it exits 1; a usage request returns flag.ErrHelp.

Types

type Options

type Options struct {
	// Central opens the BLE central on an adapter (--ble-adapter) for
	// pair --ble; nil is a build without BLE.
	Central func(adapter string) (ble.Central, error)
	// Proxies opens the BLE central over ESPHome Bluetooth proxies
	// (--bluetooth-proxy host[:port][,key], repeatable;
	// --bluetooth-proxy-discover with --bluetooth-proxy-key name=key,
	// repeatable, and --bluetooth-proxy-allow-plaintext) for pair; nil is
	// a build without them.
	Proxies func(flags ProxyFlags, log *slog.Logger) (ble.Central, error)
}

Options is what the program that runs the command line supplies.

type ProxyFlags

type ProxyFlags struct {
	// Proxies are the --bluetooth-proxy specs, host[:port][,key].
	Proxies []string
	// Discover is --bluetooth-proxy-discover: find the proxies over
	// DNS-SD as well.
	Discover bool
	// Keys are the --bluetooth-proxy-key specs, name=key, the keys of
	// discovered proxies by name or MAC.
	Keys []string
	// AllowPlaintext is --bluetooth-proxy-allow-plaintext: a discovered
	// proxy without a key in Keys is dialled over the plaintext API
	// (esphome.DiscoverOptions.AllowPlaintext). Off by default: such a
	// proxy is skipped, since the plaintext API authenticates neither side
	// (decision 196).
	AllowPlaintext bool
}

ProxyFlags are pair's ESPHome Bluetooth proxy flags.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL