Skip to content

A simple, fast, and concurrent command-line tool for generating secure, URL-friendly unique string IDs using the NanoID Go implementation.

License

Notifications You must be signed in to change notification settings

sixafter/nanoid-cli

NanoID CLI

A simple, fast, and concurrent command-line tool for generating secure, URL-friendly unique string IDs using the NanoID Go implementation.

CI Go Quality Gate Status GitHub issues Go Reference Go Report Card License: Apache 2.0 CodeQL

Features

  • 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.

Installation

Clone the repository and build the executable:

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.

Homebrew

brew tap sixafter/tap
brew install nanoid

Usage

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

Contributing

Contributions are welcome. See CONTRIBUTING


License

This project is licensed under the Apache 2.0 License. See LICENSE file.

About

A simple, fast, and concurrent command-line tool for generating secure, URL-friendly unique string IDs using the NanoID Go implementation.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published