getid

Crates.iogetid
lib.rsgetid
version0.4.1
sourcesrc
created_at2022-01-21 13:46:42.756883
updated_at2022-01-25 19:29:32.255321
descriptionA tool to generate a random { cuid, nanoid, uuidv4 }.
homepagehttps://github.com/fspoettel/getid
repositoryhttps://github.com/fspoettel/getid
max_upload_size
id518537
size26,215
Felix Spöttel (fspoettel)

documentation

README

getid

A command-line tool to generate random ids. (uuidv4, nanoid, cuid, hostnames)

Test Status Crate

Install

  • Install a recent version of Rust using rustup or update it with:
# rustup update
  • Install getid with cargo:
# cargo install getid

Usage

# getid --help

getid -- Generate a random id.

Usage:
  getid [--help, --version]
  getid <command> [<flags>...]

Commands:
  cuid           Generate a cuid.
  hostname       Generate a heroku-like hostname. [alias: heroku]
  nanoid         Generate a nanoid. [alias: nano]
  uuidv4         Generate a uuidv4. [alias: uuid]

Options:
  -v, --version  Show program version.
  -h, --help     Show this help again.

Examples:
  getid cuid
  getid hostname
  getid nanoid
  getid uuidv4

Type 'getid <command> --help' for information on a specific command.

Formats

cuid

# getid cuid --help

getid cuid -- Generate a cuid.

Usage:
  getid cuid [--slug]

Options:
  --slug      Generate a smaller id (7-10 characters) intended for short urls.
  -h, --help  Show this help again.

For more information on the 'cuid' format, see: https://github.com/ericelliott/cuid.

hostname

# getid hostname --help 

getid hostname -- Generate a heroku-like hostname.

Usage:
  getid hostname [--token_length <len>]

Options:
  --token_length <len>  Length of the appended token. [default: 4]
  -h, --help            Show this help again.

Aliases:
  getid heroku

nanoid

# getid nanoid --help

getid nanoid -- Generate a nanoid.

Usage:
  getid nanoid [--length <len>]

Options:
  --length <len>  Length of generated id. [default: 21]
  -h, --help      Show this help again.

Aliases:
  getid nano

For more information on the 'nanoid' format, see: https://zelark.github.io/nano-id-cc/.

uuidv4

# getid uuidv4 --help

getid uuidv4 -- Generate a uuidv4.

Usage:
  getid uuidv4 [--urn]

Options:
  --urn       Format the generated id as 'urn'.
  --simple    Format the generated id without hyphens.
  -h, --help  Show this help again.

Aliases:
  getid uuid

For more information on the 'uuidv4' format, see: https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random).
Commit count: 23

cargo fmt