Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fspoettel/getid
A command-line tool to generate random ids. (uuidv4, nanoid, cuid, hostnames)
https://github.com/fspoettel/getid
cli id-generator uuid
Last synced: about 1 month ago
JSON representation
A command-line tool to generate random ids. (uuidv4, nanoid, cuid, hostnames)
- Host: GitHub
- URL: https://github.com/fspoettel/getid
- Owner: fspoettel
- License: mit
- Created: 2022-01-21T13:43:20.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-25T19:30:45.000Z (almost 3 years ago)
- Last Synced: 2024-11-13T08:57:14.528Z (about 2 months ago)
- Topics: cli, id-generator, uuid
- Language: Rust
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# getid
> A command-line tool to generate random ids. ([uuidv4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)), [nanoid](https://zelark.github.io/nano-id-cc/), [cuid](https://github.com/ericelliott/cuid), hostnames)
[![Test Status](https://github.com/fspoettel/getid/actions/workflows/ci.yaml/badge.svg)](https://github.com/fspoettel/getid/actions/workflows/ci.yaml)
[![Crate](https://img.shields.io/crates/v/getid.svg)](https://crates.io/crates/getid)## Install
- Install a recent version of Rust using [rustup](https://rustup.rs/) or update
it with:
```
# rustup update
```- Install `getid` with cargo:
```
# cargo install getid
```## Usage
```sh
# getid --helpgetid -- Generate a random id.
Usage:
getid [--help, --version]
getid [...]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 uuidv4Type 'getid --help' for information on a specific command.
```## Formats
### cuid
```sh
# getid cuid --helpgetid 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
```sh
# getid hostname --helpgetid hostname -- Generate a heroku-like hostname.
Usage:
getid hostname [--token_length ]Options:
--token_length Length of the appended token. [default: 4]
-h, --help Show this help again.Aliases:
getid heroku
```### nanoid
```sh
# getid nanoid --helpgetid nanoid -- Generate a nanoid.
Usage:
getid nanoid [--length ]Options:
--length Length of generated id. [default: 21]
-h, --help Show this help again.Aliases:
getid nanoFor more information on the 'nanoid' format, see: https://zelark.github.io/nano-id-cc/.
```### uuidv4
```sh
# getid uuidv4 --helpgetid 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 uuidFor more information on the 'uuidv4' format, see: https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random).
```