Skip to main content
✨ Run your entire business in one platform — CRM, HR, Accounting, Projects & more. Start Free Trial →

Show HN: Crust – A CLI framework for TypeScript and Bun

Show HN: Crust – A CLI framework for TypeScript and Bun
By: Hacker News Posted On: March 17, 2026 View: 4

We've been building Crust (https://crustjs.com/), a TypeScript-first, Bun-native CLI framework with zero dependencies. It's been powering our core product internally for a while, and we're now open-sourcing it.

The problem we kept running into: existing CLI frameworks in the JS ecosystem are either minimal arg parsers where you wire everything yourself, or heavyweight frameworks with large dependency trees and Node-era assumptions. We wanted something in between.

What Crust does differently:

- Full type inference from definitions — args and flags are inferred automatically. No manual type annotations, no generics to wrangle. You define a flag as type: "string" and it flows through to your handler.

- Compile-time validation — catches flag alias collisions and variadic arg mistakes before your code runs, not at runtime.

- Zero runtime dependencies — @crustjs/core is ~3.6kB gzipped (21kB install). For comparison: yargs is 509kB, oclif is 411kB.

- Composable modules — core, plugins, prompts, styling, validation, and build tooling are all separate packages. Install only what you need.

- Plugin system — middleware-based with lifecycle hooks (preRun/postRun). Official plugins for help, version, and shell autocompletion.

- Built for Bun — no Node compatibility layers, no legacy baggage.

Quick example:

  import  Crust  from "@crustjs/core";
  import  helpPlugin, versionPlugin  from "@crustjs/plugins";

  const main = new Crust("greet")
    .args([ name: "name", type: "string", default: "world" ])
    .flags( shout:  type: "boolean", short: "s"  )
    .use(helpPlugin())
    .use(versionPlugin("1.0.0"))
    .run(( args, flags ) => 
      const msg = `Hello, $args.name!`;
      console.log(flags.shout ? msg.toUpperCase() : msg);
    );

  await main.execute();
Scaffold a new project:

  bun create crust my-cli
Site: https://crustjs.com GitHub: https://github.com/chenxin-yan/crustjs

Happy to answer any questions about the design decisions or internals.


Comments URL: https://news.ycombinator.com/item?id=47408727

Points: 11

# Comments: 2

Share:

Read this on Hacker News Header Banner

Want to run a more efficient business?

Mewayz gives you CRM, HR, Accounting, Projects & eCommerce — all in one workspace. 14-day free trial, no credit card needed.

Try Mewayz Free →

Comments

Power your business with Mewayz ERP

All-in-one platform: CRM, HR, Accounting, Project Management, eCommerce & more. 14-day free trial.

Start Your Free Trial →

No credit card required · Cancel anytime · 131+ modules

Contact Us
  Follow Us
Site Map
Get Site Map
About

Mewayz News brings you the latest breaking news, in-depth analysis, and trending stories from around the world. Covering politics, technology, business, sports, entertainment, and more — updated every hour, 24/7.

Mewayz Network

Mewayz App Stream Watch TV Music Games Tools Calculators Dictionary Books Quotes Recipes Photos Fonts Icons Study Papers Resume Templates Compare Reviews Weather Trading Docs Draw Paste Sign eBooks AI Learn Currency Convert Translate Search QR Code Timer Typing Colors Fitness Invoice Directory Social Seemless