Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Local Development Guide

This guide covers the practical tools and structure used for day-to-day development in Kroki-rs.

Project Structure

├── dflow             # Professional developer flow orchestrator
├── src-scripts/      # Modular shell scripts (setup, develop, ci-verify, gh-tasks)
├── docs/             # MyST documentation (User & Developer guides)
├── src/
│   ├── main.rs       # Entry point and capability discovery
│   ├── server/       # Axum web server and API handlers
│   ├── cli/          # One-shot conversion logic
│   ├── config/       # kroki.toml schema and loading
│   └── diagrams/     # Diagram processing and Provider trait
│       ├── registry.rs  # Provider mapping
│       └── providers/   # Individual diagram engines (D2, Mermaid, etc.)
├── tests/            # Integration tests and fixtures
└── resources/        # Static assets (browser harness, libraries)

The dflow CLI

dflow is our professional orchestrator for all development tasks.

CommandAliasDescription
./dflow setup-Initialize local environment and base images.
./dflow developdevRapid native-OS iteration (Fast feedback).
./dflow ci-verifyreproContainerized verification (CI Parity).
./dflow ci-shellshellInteractive shell inside the CI container.
./dflow release-Release management (propose branch or tag).
./dflow teardowncleanReclaim build and container disk space.

dflow Options Reference

All commands accept the following options to customize the behavior:

OptionLong FormDescription
-p--purgePurge all caches (dist, target) before running.
-d--debugEnable RUST_LOG=debug for detailed tracing.
-v--verboseEnable verbose tool output (e.g., cargo --verbose).
-n--no-networkRestricted build mode (no downloads).
-t load--test=loadInclude high-concurrency stress tests.
-j <n>--jobs=<n>Limit internal parallelism to <n> threads.
-sp--steps-parallelRun checks concurrently (default: true).
--release <v>-Prepare release v (bump & commit) [dev only].
--dry-run-Verification mode: skip destructive actions.
--lean-Build core only (skips browser engine).

Granular Execution

The ci-verify command supports passing sub-targets directly to the containerized environment:

# Only run format check in the container
./dflow ci-verify fmt

# Only run tests in the container
./dflow repro test-ci

Resource Optimization

Adding a New Provider

  1. Define: Create src/diagrams/providers/your_thing.rs.

  2. Implement: Follow the Coding Standards.

  3. Discovery: Add to Capabilities in src/capabilities.rs.

  4. Register: Add to DiagramRegistry::new in src/diagrams/registry.rs.

Testing