A simple, fast, and concurrent command-line tool for generating secure, URL-friendly unique string IDs using the NanoID Go implementation.
- Customizable Length: Specify the length of the generated Nano ID.
- Custom Alphabet: Define your own set of characters for ID generation.
- Multiple ID Generation: Generate multiple IDs in a single command.
- Verbose Mode: Enable detailed logs during ID generation.
git clone https://github.com/sixafter/nanoid-cli.git
cd nanoid-cli
make build
This command compiles the main.go file and produces an executable named nanoid
in the ./out
directory.
brew tap sixafter/tap
brew install nanoid
Run the CLI to Generate a Default Nano ID:
nanoid generate
Output:
V1StGXR8_Z5jdHi6B-myT
Generate a Nano ID with a Custom Length:
nanoid generate --length 30
Output:
mJzY8fK3Lq7B9sR2dT4hV5nG1aC0eX
Generate a Nano ID with a Custom Alphabet:
nanoid generate --alphabet "abcdef123456"
Output:
1a2b3c4d5e6f1a2b3c4d5e6f1a2b3c4
Generate Multiple Nano IDs:
nanoid generate --count 5
Output:
V1StGXR8_Z5jdHi6B-myT
mJzY8fK3Lq7B9sR2dT4hV
aB3cD4E5f6G7hI8jK9lMn
O1pQ2rS3tU4vW5xY6zA7b
D8eF9gH0iJ1kL2mN3oP4q
Contributions are welcome. See CONTRIBUTING
This project is licensed under the Apache 2.0 License. See LICENSE file.