with one click
chip-tool-testing
// Guidelines for building Matter examples and chip-tool, and testing examples using chip-tool.
// Guidelines for building Matter examples and chip-tool, and testing examples using chip-tool.
Guidelines and common jq/grep/awk queries for investigating ZAP (.zap) and Matter (.matter) files to understand endpoints, clusters, attributes, and commands.
Guidelines for implementing or migrating Matter server clusters to the code-driven pattern using Test-Driven Development (TDD).
Guidelines for implementing or migrating Matter server clusters (code that resides in `src/app/clusters`) using the DefaultServerCluster base class (code-driven data model approach), as opposed to the legacy ZAP/Ember codegen approach.
Step-by-step procedure for migrating a legacy Ember-based Matter server cluster in src/app/clusters/ to the code-driven pattern. Use this skill when converting an existing cluster. All rules from code-driven-cluster-development still apply; this skill adds the migration-specific workflow on top.
Expert guidance for reviewing Python tests in the Matter (connectedhomeip) repository. Use this skill when reviewing changes to tests, specifically targeting common pitfalls in async execution, mocking cluster interactions, and assertion quality.
Guidelines for accessing and reading the Matter specification and test plans. These resources are private and in-progress, so they must be cloned or requested.
| name | chip-tool-testing |
| description | Guidelines for building Matter examples and chip-tool, and testing examples using chip-tool. |
This skill provides guidelines for building Matter example applications and
chip-tool, and using chip-tool to commission and interact with the examples
in a simulated environment (like Linux POSIX).
[!NOTE] While
chip-tooland examples support multiple platforms, these guidelines focus on the Linux/POSIX environment, which is the standard environment for agent execution.
Always build the chip-tool and the Matter example application from the same
revision of the repository to ensure compatibility.
Use the build script to build chip-tool for Linux:
source scripts/activate.sh
./scripts/build/build_examples.py --target linux-x64-chip-tool-clang build
The binary will be located in out/linux-x64-chip-tool-clang/chip-tool.
Use the build script to build examples (e.g., all-devices-app):
source scripts/activate.sh
./scripts/build/build_examples.py --target linux-x64-all-devices-boringssl build
The binary will be located in
out/linux-x64-all-devices-boringssl/all-devices-app.
Run the example application (usually in a separate terminal or the background):
./out/linux-x64-all-devices-boringssl/all-devices-app
Note: Use a clean KVS file (by specifying a new, non-existent file path with
--KVS) or clear the existing one (by deleting the file) to ensure the
application enters commissioning mode on startup.
Check the application logs on startup to find the setup PIN code and discriminator. Example log:
[DL] Setup Pin Code: 20202021
[DL] Setup Discriminator: 3840 (0xF00)
[!NOTE] The discriminator value
3840(0xF00) is the standard default for many Matter examples when not explicitly configured.
Make sure the device is in commissioning mode. If using a persistent storage
(KVS), you may need to use a clean KVS file or clear it to force commissioning
mode on startup. On Linux, the default KVS file is /tmp/chip_kvs:
rm /tmp/chip_kvs
[!NOTE] > Persistence Testing: If you are performing a persistence test (verifying state across restarts), do NOT delete the KVS file. Reuse the same KVS file to preserve stored attributes.
If the device is already on the same IP network (e.g., running locally on the same host):
With Long Discriminator:
chip-tool pairing onnetwork-long <node_id> <setup_pin> <discriminator>
Without Discriminator (looks for any commissionable device):
chip-tool pairing onnetwork <node_id> <setup_pin>
With Manual Pairing Code or QR Code:
chip-tool pairing code <node_id> <pairing_code_or_qrcode>
Direct IP and Port (useful if mDNS resolution fails):
chip-tool pairing already-discovered <node_id> <setup_pin> <device_ip> <device_port>
[!CAUTION] If you encounter attestation failures in simulated environments, you may need to add
--bypass-attestation-verifier trueto the command. Use this flag ONLY for local simulated testing when you explicitly accept the security tradeoff of bypassing device attestation.
After successful commissioning, you can use chip-tool to interact with data
model clusters.
Read Attribute:
chip-tool <cluster_name> read <attribute_name> <node_id> <endpoint_id>
Example: chip-tool basicinformation read vendor-id 0x8016 0
Invoke Command:
chip-tool <cluster_name> <command_name> [arguments] <node_id> <endpoint_id>
Example: chip-tool onoff toggle 0x8016 1
chip-tool has a built-in help system that allows you to discover available
clusters and commands. Running any command without all required parameters will
show a help screen.
chip-tool
chip-tool basicinformation
chip-tool basicinformation read
This will show what attributes can be read from the basicinformation
cluster.This interactive help is useful for exploring the data model and finding the exact syntax needed.
--timeout <seconds>.chip-tool caches state in chip_tool_config.ini
(often in the current directory or /tmp). Deleting this file can resolve
stale configuration issues. You can also specify a custom directory with
--storage-directory <path>.When completing a test task using this skill, you should output a structured report to the user. Since every test may verify different features, do not force a fixed sequence of steps. Instead, follow these general guidelines for reporting each item you verified:
For each verified feature, command, or configuration item, provide:
chip-tool or shell command you used.Descriptor reads.