1. The Modern Microservices Developer Friction
OpenCrawling represents a state-of-the-art, enterprise-grade ingestion and RAG platform. Its decoupled architecture spans an array of specialized microservices—including the crawler engine, ingestion consumer, embedding vectorizer, writer consumer, and secure Model Context Protocol (MCP) server—alongside backing infrastructure such as Apache Kafka, PostgreSQL with pgvector, Redis, Ollama, and OpenTelemetry.
While this architecture provides unmatched enterprise resilience and horizontal scalability, local development iterated under significant friction:
- Verbose Command Syntax: Orchestrating local stacks required typing lengthy, error-prone Docker Compose commands with multiple flags:
docker compose -f docker-compose-decoupled.yml -f docker-compose-decoupled.local.yml up -d --build docker compose -f docker-compose-maven-builder.yml run --rm oc-maven-builder mvn clean package -DskipTests - Sluggish Cold Rebuilds: Without BuildKit cache integration, rebuilding container images downloaded hundreds of megabytes of Maven dependencies over the network on every source iteration (4 to 10+ minutes per build).
- Platform Discrepancies on Windows: While Linux and macOS developers leveraged helper scripts in
scripts/, Windows developers working outside WSL or Git Bash lacked native CMD/batch tooling to easily spin up local stacks.
With Issue #217, we solved this by designing unified root CLI helpers that eliminate friction while preserving complete build hermeticity for continuous integration.
2. Zero CI Impact: Two-Tier Build Architecture
A core architectural principle of OpenCrawling is that CI production Dockerfiles (docker/Dockerfile.* and oc-runtime/Dockerfile) remain completely untouched. CI workflows on GitHub Actions must always execute clean, isolated, reproducible builds from scratch.
To accelerate local development without compromising production Dockerfiles, run.sh and run.bat leverage a dual-mode strategy:
- Local Cache Dockerfiles (
docker/local/Dockerfile.*): Local Dockerfiles include BuildKit cache directives:
Redundant dependency downloads (such asRUN --mount=type=cache,target=/root/.m2,id=opencrawling-m2-cache,sharing=shared \ mvn clean package -DskipTestsmvn dependency:go-offline) are eliminated, and all decoupled services share the same persistent cache volume on the local Docker engine. - Containerized Maven Builder (
oc-maven-builder): Mounts the developer's host~/.m2repository directly into an official Eclipse Temurin JDK 25 builder container:
Developers can compile, package, and execute Maven goals without needing JDK 25 or Maven installed on their host workstations!docker compose -f docker-compose-maven-builder.yml run --rm oc-maven-builder
Warm Rebuild Benchmark: Rebuilding an OpenCrawling microservice container with source modifications dropped from 4 minutes 15 seconds down to just ~3 seconds!
3. Cross-Platform Parity: macOS, Linux, and Windows CMD
Whether you develop on macOS, Ubuntu, or Windows Command Prompt, the experience is identical:
- macOS & Linux (
./run.sh): Implemented in POSIX Bash with strict error handling (set -euo pipefail), ANSI color styling, and automated fallback to unstyled text whenNO_COLOR=1is set or output is piped. - Windows CMD (
run.bat): Native batch script with clean status banners, full argument forwarding (%*), and automatic translation of%USERPROFILE%toHOME:
This ensures that Docker Compose volume mounts (if not defined HOME set "HOME=%USERPROFILE%" if not exist "%HOME%\.m2" mkdir "%HOME%\.m2"${HOME}/.m2:/root/.m2) function seamlessly on Windows without requiring manual environment configuration.
4. Complete Developer Command Matrix
run.sh and run.bat group everyday engineering workflows into three intuitive categories:
| Category | Command (./run.sh or run.bat) |
Description & Underlying Action |
|---|---|---|
| Build & Maven | build / mvn:build |
Compile all modules via containerized oc-maven-builder mounting host ~/.m2 (-DskipTests) |
build:offline |
Blazing-fast offline build via oc-maven-builder (-o -DskipTests) |
|
build:host / build:native |
Build directly using host Maven and JDK 25 (for IDE integration) | |
build:clean |
Full clean build with unit test execution inside oc-maven-builder |
|
mvn <args...> |
Pass arbitrary Maven goals into oc-maven-builder (e.g. mvn test -pl oc-core) |
|
| Docker Stacks | decoupled:up / decoupled:local |
Start standalone decoupled stack using local fast Dockerfiles and BuildKit cache mounts |
decoupled:override |
Start decoupled stack using docker-compose-decoupled.local.yml overlay |
|
apps:up / apps:local |
Start standalone monolithic apps stack (backend, embedding, UI) | |
infra:up / infra:down |
Start or stop backing infrastructure only (PostgreSQL/pgvector, Redis, Ollama, Kafka) | |
down / stop |
Gracefully stop and clean up all active local OpenCrawling containers across stacks | |
| Productivity & UI | status / ps |
Inspect running containers, service health, and exposed port bindings |
logs [service...] |
Stream and follow live container logs (e.g. ./run.sh logs oc-crawler) |
|
test:unit / test:it |
Run unit tests or integration tests with automatic local BuildKit cache overlay | |
ui:dev / ui:build |
Launch React Admin UI Vite dev server on :5173 or build production bundle |
|
license:format |
Format Apache 2.0 license headers across all Java and XML files | |
clean [--prune] |
Clean Maven target folders and optionally prune dangling Docker build cache |
5. Pre-Flight Diagnostics & Error Handling
To prevent cryptic container crashes, run.sh and run.bat validate prerequisites before dispatching commands:
- Docker Daemon Verification: Verifies that the Docker CLI exists and that the Docker daemon is responding (
docker info). If Docker Desktop is stopped, the script exits immediately with a helpful troubleshooting message. - Tooling Detection for UI & Host Builds: Checks for
mvnon host builds, and checks fornodeandnpmbefore attempting to start the React Admin UI Vite dev server (ui:dev). - Self-Healing Cache Folders: Automatically ensures
${HOME}/.m2exists before launching Docker Compose, preventing Docker from creating root-owned empty directories on Linux workstations.
6. Automated Verification: 7-Step Test Suite & CI Matrix
Developer convenience scripts must be as rigorously tested as production code. We implemented a dedicated test suite under scripts/test-run-scripts.sh:
Complete Quality Guarantee:
The 7-step test validates script permissions (chmod +x), Apache 2.0 headers, bash -n syntax, help command parity, NO_COLOR=1 ANSI stripping, pre-flight failures, mock command dispatching across all 31 aliases, and Windows run.bat feature parity.
This test suite is automatically executed as part of the GitHub Actions CI matrix in .github/workflows/integration-tests.yml under the job name Root CLI Runner Scripts Test Suite.
7. Quick Start: Try It Today!
Clone the repository and test the new CLI runners immediately:
# macOS or Linux
git clone https://github.com/opencrawling/opencrawling.git
cd opencrawling
./run.sh help # Explore available commands
./run.sh build # Compile via containerized oc-maven-builder
./run.sh decoupled:up # Launch fast local decoupled microservices stack
./run.sh status # Inspect container health and port bindings
./run.sh down # Stop local containers
# Windows Command Prompt
run.bat build
run.bat decoupled:up
run.bat down
Supercharge Your OpenCrawling Workflow
Check out the full command reference on our Wiki, test the CLI helpers in your local environment, or join the discussion on GitHub!