
Compiler Driven Development (CDD) is a development approach designed to eradicate the disconnect between: API specifications; server implementations; client SDKs; and command-line tooling.
Unlike traditional code generators—that treat outputs as disposable or read-only—CDD provides a complete, standalone compiler for each supported language. These compilers are fully CST-aware (Concreate Syntax Tree is a whitespace+comment aware Abstract Syntax Tree), allowing true bidirectional synchronization between existing hand-edited source code and OpenAPI specifications.
Traditional tools use naïve templating—if you regenerate, your custom code is overwritten.
The CDD ecosystem is fundamentally different. It utilizes language-specific, standalone compilers capable of full AST parsing, semantic diffing, and surgical patching.
The Core Guarantee: Every part of the generated codebase is fully editable. You are encouraged to open the generated routing files, model definitions, and CLI structures, and directly inject your business logic.
- When your specification changes, the CDD compiler reads your code, builds an AST, diffs it against the new spec, and safely patches in new endpoints or fields without touching your custom logic.
- When your codebase changes, the compiler reverse-engineers your structural updates back into a 100% accurate, authoritative OpenAPI specification.
flowchart TD
OAS["📄 OpenAPI v3 Spec"] <--> CDD{"⚙️ CDD Compiler"}
CDD <--> Codebase
subgraph Codebase ["💻 Application Codebase"]
direction TB
subgraph Outputs ["📦 Primary Outputs"]
direction TB
CLI["⌨️ CLI Tooling"]
SDK["📦 Client SDK"]
Server["🖥️ Server"]
%% Force vertical stacking inside the subgraph
CLI ~~~ SDK ~~~ Server
end
subgraph Core ["🔗 Core Architecture"]
direction TB
Models["🔗 Data Models"]
Routes["🔀 API Routes"]
Tests["🧪 Tests"]
%% Force vertical stacking inside the subgraph
Models ~~~ Routes ~~~ Tests
end
Mocks["🎭 API Mocks / Fakes"]
%% Simple dependency flow down the page
Outputs --> Core
Tests --> Mocks
end
style OAS fill:#e3f2fd,stroke:#1e88e5,stroke-width:2px
style CDD fill:#f3e5f5,stroke:#8e24aa,stroke-width:2px
style Codebase fill:#fafafa,stroke:#9e9e9e,stroke-width:2px,stroke-dasharray: 5 5
style Outputs fill:#e8f5e9,stroke:#43a047,stroke-width:2px
style Core fill:#fff3e0,stroke:#f57c00,stroke-width:2px
The CDD lifecycle supports continuous evolution from any starting point:
- Generate: Scaffold servers, SDKs, or CLIs from a central specification.
- Edit: Developers write real, unconstrained code directly in the generated files.
- Extract: Reverse-compile the edited code to produce an updated OpenAPI spec.
- Sync: Apply new specification changes seamlessly into the existing, hand-edited codebase.
Every supported language operates on the same core CDD philosophies but is powered by a dedicated, native compiler tailored to that language's specific AST, idioms, and package management.
All implementations share a standardized CLI interface (cdd [subcommand]), acting as a universal toolchain.
A true ecosystem requires standardized tooling. Once a developer learns the CDD toolchain, they can synchronize architecture across the entire polyglot stack.
--help: Print help information.--version: Print version information.--input, -i(or-f): Target file, directory, or OpenAPI spec.--output, -o: Destination path for generation or sync.
Generate a client SDK and a corresponding command-line interface (CLI) from an OpenAPI specification.
--input, -i <spec>: Path to the OpenAPI specification file.
Generate a client SDK from an OpenAPI specification.
--input, -i <spec>: Path to the OpenAPI specification file.
Generate server boilerplate, models, and routing logic from an OpenAPI specification.
--input, -i <spec>: Path to the OpenAPI specification file.
Parse the existing codebase and extract an authoritative OpenAPI specification.
--input, -i <path>(or-f <path>): Path to the source code directory or file to parse.
Convert an OpenAPI specification into a localized, documentation-optimized JSON format.
--input, -i <spec>: Path to the OpenAPI specification file.--no-imports: Disable import statements in the generated documentation.--no-wrapping: Disable line wrapping in the generated documentation.
Launch a JSON-RPC server for editor and tool integrations.
--port <port>(or-p): Port to listen on (e.g.,8080).--listen <address>(or-l): Address to bind to (e.g.,0.0.0.0).
Run the Model Context Protocol server via stdio.
Generate a client SDK and a corresponding command-line interface (CLI) from a Google Discovery JSON.
--input, -i <discovery.json>: Path to the Google Discovery JSON file.
Generate a client SDK from a Google Discovery JSON.
--input, -i <discovery.json>: Path to the Google Discovery JSON file.
- Google Discovery Support: Uniquely supports parsing and generating code from Google Discovery JSON (
from_google_discovery), enabling integration with older Google APIs. - Batch Processing: The
--input-dir <specs_dir>option enables generation from multiple OpenAPI specification files in a single pass. - Testing Scaffolding:
--testsgenerates integration tests and API mocks using C++ testing frameworks (like GTest). - CI/CD Scaffolding: By default, generates GitHub Actions workflows (
.github/workflows/ci.yml) for the resulting project. This can be suppressed via--no-github-actions. - Installable Packages: Automatically generates
CMakeLists.txtmaking the outputs ready-to-use C++ libraries or binaries. This can be suppressed via--no-installable-package.
With Compiler Driven Development, specifications and code are no longer loosely coupled artifacts. They are strict, isomorphic reflections of one another, maintained by dedicated standalone compilers.
Choose your language ecosystem above and start treating your architecture as a seamlessly compiled, endlessly editable whole.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
