ai / nanoid

A tiny (124 bytes), secure, URL-friendly, unique string ID generator for JavaScript
https://zelark.github.io/nano-id-cc/
MIT License
24.62k stars 790 forks source link

CLI Improvements #275

Closed shellscape closed 2 years ago

shellscape commented 3 years ago

Ahoy 👋 I was curious if the project would be open to a contribution of some CLI improvements. I know that nanoid-cli exists, but it's dang near three years out of date and while I have reached out to the author about updating it, the code behind that package is small enough that I wondered if there's openness now to having that integrated as part of nanoid proper.

ai commented 3 years ago

Sure. What do you want to change in current CLI?

shellscape commented 3 years ago

Specifically, I'd like to add alphabet and length flags. We're using this in a script for using the AWS CDK via bash and need to generate uuids inline. It could be done via a local node script but would be much more convenient to specify on the CLI.

ai commented 3 years ago

Yeap, send PR. And add --help to explain arguments.

TrySound commented 3 years ago

What do you want to use for parsing flags?

ai commented 3 years ago

No dependencies can be added (we have 0 dependencies, and adding dependency for rate feature will be bad for marketing).

Parse them manually.

shellscape commented 3 years ago

No worries, I can handle that.