nanoid-cli

command module
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL