Jan
Jan3mo ago

How do I publish a Rust CLI on JSR

I am currently developing a CLI in Rust and would like to make it available to Typescript devs. There are several packages on NPM that wrap a CLI written in Rust or Go (e.g. Supabase CLI, Turborepo). Can I publish such CLI on JSR instead? How to do that?
3 Replies
Deno AI Helper
Deno AI Helper3mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on your message, it seems like you're looking to make your Rust CLI available to TypeScript developers, potentially through the Deno ecosystem. While I can't provide specific guidance on publishing a Rust CLI on JSR (JavaScript Registry), I can tell you that Deno has its own third-party module registry called Deno.land/x, where you can publish Deno modules. If you want to make your Rust CLI available to Deno users, you would typically compile your Rust code to a WebAssembly module or create a plugin, and then publish it on Deno.land/x. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice. For the most accurate and up-to-date information on publishing modules to Deno.land/x, please refer to the official Deno documentation or the Deno community for further assistance.
javi
javi2mo ago
You'll need to use FFI for that. I have published a zod alternative with all the functionality implemented in c++, here's the repo: https://github.com/Jabolol/blueprint Check out the github actions to build cross platform, and to deploy to jsr.
GitHub
GitHub - Jabolol/blueprint: Fast schema parser using C++ under the ...
Fast schema parser using C++ under the hood for performance - Jabolol/blueprint
Jan
Jan2mo ago
Thanks, I will have a look and see, if it helps me. Does JSR support CLIs? Or is it limited to ESM?