The Codegen Project - 5 Months of Progress
It has been a while since the last update, almost 5 months to be exact, all these improvements have been happening while building the SDK platform, using the CLI as it's pillars.
Since our last update in October 2024, we've evolved the project with new features, expanded protocol support, crucial fixes, and improved documentation. Instead of just listing the changes, we want to share the journey of how we grew The Codegen Project CLI from version 0.23.0 to 0.33.0.
๐ Wrapping Up 2024: Headers & Stabilityโ
When we left off in October, the Codegen CLI was already powerful, but it soon gained an important new ability: TypeScript Headers Generation. This feature allowed us to generate strongly-typed models for message headers defined in AsyncAPI specs, alongside payload models. We introduced a new headers
preset to produce header models for each channel, initially supporting AsyncAPI input and TypeScript output. Some of the next steps is integrating it into the channels
and client
presets for all the protocols like payload
.
export default {
...,
generators: [
{
preset: 'headers',
outputPath: './src/headers',
language: 'typescript',
}
]
};
After adding this big feature, we focused on stability. In early November, we tackled an issue with weird payload generation that led to unexpected behaviors. This bugfix ensured that the CLI generated cleaner, more reliable output. Then, on December 1st, we performed a refactor and cleanup pass, resolving lingering issues and improving maintainability. With header generation in place and a wave of bug fixes, we ended 2024 on a solid foundation.
๐ December: NATS Request-Reply Refactorโ
As the holiday season arrived, we turned our attention to NATS request/reply support. Previously, the CLIโs generation logic focused primarily on pub-sub, but NATSโs request-reply pattern required a more operation-aware approach. To achieve this, we refactored how the generator processes AsyncAPI operations, introducing conditional channel functions and an asyncapiReverseOperations
flag to support flexible and complex scenarios.
The result? The CLI could now generate request sender and response listener code for NATS with correct message handling in both directions. Along the way, we fixed edge cases where response messages werenโt generated correctly, making NATS a much more powerful integration within Codegen. By December 21, these changes landed in version 0.25.0, wrapping up the year with a major protocol enhancement.
๐ New Year, New Protocols: Kafka, MQTT, and AMQPโ
With 2025 underway, we set our sights on broadening protocol support. By mid-January, Kafka, MQTT, and AMQP all became part of the CLIโs repertoire.
export default {
...,
generators: [
{
preset: 'channels',
outputPath: './src/__gen__/',
language: 'typescript',
protocols: ['kafka', 'mqtt', 'amqp']
}
]
};
These messaging protocols each have their own nuancesโKafkaโs consumer groups, MQTTโs lightweight pub-sub model, and AMQPโs queue/exchange semantics. We carefully implemented support for each, ensuring the CLI could correctly generate code for these backends. By version 0.28.0, developers could generate TypeScript code for Kafka, MQTT, or AMQP streams using AsyncAPI, expanding the CLIโs reach across the messaging ecosystem.
๐ก February: Server-Sent Events & Function Typesโ
In the platform we had the need to use Server-Sent Events (SSE) for our frontend live update functionality, which started in early February. The CLI could now generate both Event Source clients (fetch) and servers (express), allowing users to describe real-time HTTP SSE endpoints in AsyncAPI and generate corresponding TypeScript implementations. This filled a key gap, making the CLI not just for brokered messaging, but for real-time web streams as well.
export default {
...,
generators: [
{
preset: 'channels',
outputPath: './src/__gen__/',
language: 'typescript',
protocols: ['event_source']
}
]
};
At the same time, we added custom function type mappings, enabling AsyncAPI operations and functions to influence function signatures. This flexibility was particularly useful for advanced use casesโlike tweaking request-reply functions or applying custom channel configurations.
{
"asyncapi": "3.0.0",
...,
"channels": {
"test-channel": {
"x-the-codegen-project": {
"channelName": "Test",
"functionTypeMapping": ["event_source_express"]
}
}
},
"operation": {
"test-operation": {
"x-the-codegen-project": {
"functionTypeMapping": ["event_source_express"]
}
}
}
}
By the end of February, The Codegen Project CLI had become more versatile than ever, with powerful function mappings, and robust SSE support.
๐ ๏ธ March: Documentation, Queue Subscriptions & a Generator Rewriteโ
With many major features shipped, March was about polishing the experience and tying up loose ends. We gave our documentation a major overhaul, updating guides and examples to ensure new features were easy to understand and use. The refreshed AsyncAPI usage guide, headers guide, and AMQP guide made it easier than ever to adopt the CLIโs latest capabilities.
On the development side, we fine-tuned AMQP queue subscriptions, ensuring seamless consumer binding to durable queues. Finally, we conducted a complete rewrite of the channel generator logic โ not to add a new feature, but to clean up and streamline how each channel is processed. This refactor eliminated redundancies, improved maintainability, and laid the groundwork for future enhancements.
๐ฏ Wrapping Up: A More Powerful Codegen CLIโ
Looking back, the period from October 2024 to March 2025 has been one of remarkable growth. We've transformed the CLI into a multi-protocol powerhouse, supporting Kafka, MQTT, AMQP, NATS (including request/reply), and SSE. Features like typed headers, customizable function types, and detailed documentation have made it more robust and developer-friendly than ever.
These last five months have been about eating your own tool while we have been working on the SDK platform. Whether you're working with pub-sub, request-reply, or real-time streaming, Codegen now has you covered or will in the future. And with our recent generator refactor, we're well-positioned to keep improving and innovating in the months ahead.
Thanks for following along โ weโre excited to see what the next chapter brings! ๐