Reintroducing Stricli
Stricli: Building type-safe, scalable CLIs #


Bloomberg first released the open source Stricli framework back in 2024. It plays a foundational role in command line interfaces (CLIs) that we build internally. Having watched it improve our internal developer experience, we were happy to share it with the broader JavaScript/TypeScript community at large. Stricli can be used in any JavaScript-compatible runtime, whether it's Node.js, Bun, or whatever comes next.
While we think there are a lot of reasons to turn to Stricli when creating your next CLI, we wanted to call out two specific areas we've focused on. This framework was designed from the ground up to be type-safe, and it relies on language standards to dynamically load only the code that is needed to run each command.
First-class type support #
Stricli was designed with TypeScript in mind, and it offers compile-time assurances that the types that flow from the argument parser will match the types expected by each command's implementation. Stricli offers a rich set of types, including string enumerations and variadic arrays, giving you the flexibility to specify exactly what type of input your CLI expects.
Stricli also offers a built-in set of runtime assertions about the configured CLI arguments, making it easy to detect and provide help if, for example, a number was expected for an argument, but the user provided an invalid value. These runtime assertions are configured alongside your compile-time types.
The decisions you make when configuring your types feed directly into Stricli's auto-generated help and error messages, making it clear to the users of your CLI what type of input is expected for each argument. This way, there's a single source of truth about what's accepted that won't get out of sync.
Dynamic runtime execution via import() #
Complex CLIs have many different code paths, but only a subset of them are going to be run for different use cases. Stricli makes it easy to lazy-load only the code that's needed for a given set of arguments via its async loader support. The happy path is to structure your implementation code as ES modules and load it at runtime via dynamic import() statements. Because we're building on top of language standards that TypeScript knows about by default, nothing extra is required to ensure that your dynamically loaded code is type checked, thereby ensuring that you don't have to sacrifice runtime performance in favor of type safety.
Next steps #
AI coding agents perform particularly well when there are type safety guarantees, and we believe that's a strong point in favor of using Stricli to build your next CLI in TypeScript. In fact, we've just published an llms.txt flavor of our documentation that will tell your agents everything they need to know about Stricli in a token-friendly fashion.
For the humans among us, Stricli's Quick Start guide is a perfect starting point, and you'll find interactive Live Playground widgets sprinkled throughout the docs, allowing you to experiment with Stricli's API within your web browser.
If you have any feedback or feature requests, please let us know via the GitHub issue tracker!