Implementation:MaterializeInc Materialize CLI Run
| Knowledge Sources | |
|---|---|
| Domains | CLI, Development Tools, Build System |
| Last Updated | 2026-02-08 00:00 GMT |
Overview
The CLI Run tool builds and runs Materialize core services (environmentd, clusterd) or tests (sqllogictest) from the local development environment.
Description
This module provides the bin/run CLI entry point for local Materialize development. It compiles Rust binaries with configurable sanitizer support, manages the lifecycle of environmentd and clusterd processes, configures CockroachDB (CRDB) connections, blob storage paths, and system parameters. It also handles SQLite SLT repository management for sqllogictest execution, macOS entitlements for Instruments profiling, and proper signal handling for graceful shutdown.
Usage
Use this tool during local development to build and launch Materialize services or run SQL logic tests against a local instance. It is the primary development runner invoked via bin/run.
Code Reference
Source Location
- Repository: MaterializeInc_Materialize
- File: misc/python/materialize/cli/run.py
Signature
KNOWN_PROGRAMS = ["environmentd", "sqllogictest"]
REQUIRED_SERVICES = ["clusterd"]
DEFAULT_POSTGRES = "postgres://root@localhost:26257/materialize"
MZDATA = MZ_ROOT / "mzdata"
def update_sqlite_repo() -> None: ...
def main() -> None: ...
Import
from materialize.cli.run import main
I/O Contract
| Input | Type | Description |
|---|---|---|
| program | str |
One of "environmentd" or "sqllogictest" |
| --postgres | str |
CockroachDB connection URL (default: localhost:26257) |
| --blob | str |
Persist blob storage path (default: file://mzdata/persist/blob) |
| Output | Type | Description |
|---|---|---|
| process | subprocess | Running environmentd/clusterd processes managed with signal handlers |
| exit code | int |
Process exit code propagated to caller |
Usage Examples
# Build and run environmentd locally
bin/run environmentd
# Run sqllogictest
bin/run sqllogictest -- test/sqllogictest/test.slt