docs/local-cre/environment/index.md
The Local CRE CLI lives in core/scripts/cre/environment. The default invocation style is:
cd core/scripts/cre/environment
go run . <command> [subcommand]
You can also install the binary:
make install
That produces local_cre, including the interactive shell (local_cre sh).
Start:
go run . env start [--auto-setup]
Current env start flags from source code include:
--auto-setup--wait-on-error-timeout--cleanup-on-error--extra-allowed-gateway-ports--with-example--example-workflow-timeout--with-beholder--with-dashboards--with-observability--with-billing--with-contracts-version--setup-config--grpc-portStop:
go run . env stop
go run . env stop --all
Restart:
go run . env restart
go run . env restart --with-beholder
Purge environment state:
go run . env state purge
Use purge when the saved state or cached environment artifacts look inconsistent.
By default Local CRE builds the Chainlink image from the local branch. To use a pre-built image instead, set image in each node definition in the topology TOML and omit docker_ctx and docker_file.
The deprecated -p/--with-plugins-docker-image flag still exists, but contributors should use TOML-based image selection instead.
env setup ensures required managed images are present, including Job Distributor, Chip Router, Chip Ingress, and Chip Config.
When pulling managed images from ECR, configure both registries:
MAIN_AWS_ECR for core managed CRE imagesSDLC_AWS_ECR for Chip Router imagesChip Router image resolution during startup is:
CTF_CHIP_ROUTER_IMAGE (if set)chip_router.image from the active topology TOMLIf the resolved router image is missing locally, startup follows the same build-or-pull fallback path as the Beholder images.
Use --with-beholder when you need the ChIP ingress stack and Red Panda. Use --with-observability or --with-dashboards when you need the Grafana-based observability stack.
Important related flags:
--grpc-port for ChIP ingress--with-dashboards to provision the dashboards on top of observabilityWhen dashboards are enabled, the CLI waits for Grafana at http://localhost:3000.
Chip Router is the ingress owner on 50051. Nodes emit workflow telemetry to the router, and the router fans out to downstream subscribers.
Current local ports:
50050: Chip Router admin API50051: Chip Router ingress gRPC50052: chip-config50053: real ChIP / Beholder ingress gRPCIn tests, sink-backed scenarios register a test sink with Chip Router. Beholder-backed scenarios register real ChIP / Beholder with Chip Router.
To override the router image without changing committed TOMLs:
export CTF_CHIP_ROUTER_IMAGE=chip-router:<commit-sha>
This override takes precedence over chip_router.image.
Local CRE persists state to the repo-local state file that the system tests later reuse. This is why the smoke-test helpers can detect an existing environment and avoid recreating it.
If you need to reset the environment completely, use state purge and then re-run setup/start.
For day-to-day debugging, the main patterns remain:
Hot-swapping guidance and workflow-specific commands are covered in:
The Local CRE stack supports:
If you need the full tracing stack for debugging or demos, enable observability during startup and follow the environment-specific tracing configuration described in the advanced page.
The most common failures in this area are:
gh is missing or unauthenticatedWhen startup problems happen:
go run . env setupFor topology-specific issues, continue with Topologies and Capabilities.