idt
idt(id tool) — A fast, ergonomic CLI tool for working with various ID formats.
Installation
# Cargo
# Homebrew
# Nix (flakes)
Docker
# From Docker hub
# From GitHub Container Registry
Docker image is published to the registries below:
See installation docs for more.
Usage
# Generate IDs
# Generate multiple IDs
# Inspect any ID
# Convert formats
# Validate IDs
# Compare two IDs
# Sort IDs by timestamp
|
# Show supported types
Supported ID Types
| Type | Sortable | Time | Bits | Description |
|---|---|---|---|---|
| uuidv1 | No | Yes | 128 | Timestamp + MAC address |
| uuidv3 | No | No | 128 | MD5 namespace hash |
| uuidv4 | No | No | 128 | Random |
| uuidv5 | No | No | 128 | SHA-1 namespace hash |
| uuidv6 | Yes | Yes | 128 | Reordered timestamp |
| uuidv7 | Yes | Yes | 128 | Unix timestamp + random |
| uuid-nil | - | - | 128 | All zeros |
| uuid-max | - | - | 128 | All ones |
| ulid | Yes | Yes | 128 | Crockford Base32, lexicographically sortable |
| nanoid | No | No | ~126 | Compact URL-friendly ID |
| ksuid | Yes | Yes | 160 | K-Sortable Unique Identifier |
| snowflake | Yes | Yes | 64 | Twitter/Discord-style distributed ID |
| objectid | Partial | Yes | 96 | MongoDB ObjectId |
| typeid | Yes | Yes | 128 | Type-prefixed sortable ID |
| xid | Yes | Yes | 96 | Globally unique sortable ID |
| cuid | Partial | Yes | 128 | Collision-resistant ID |
| cuid2 | No | No | 128 | Secure collision-resistant ID |
| tsid | Yes | Yes | 64 | Time-sorted unique identifier |
Assigned IDs (validate & inspect only)
| Type | Description | Check Digit |
|---|---|---|
| ean13 | EAN-13 (International Article Number) | Mod 10 |
| isbn13 | ISBN-13 (International Standard Book Number) | Mod 10 |
| isbn10 | ISBN-10 (legacy book identifier) | Mod 11 |
| isin | ISIN (International Securities Identification Number) | Luhn |
| ean8 | EAN-8 (8-digit barcode for small items) | Mod 10 |
| upca | UPC-A (Universal Product Code) | Mod 10 |
| issn | ISSN (International Standard Serial Number) | Mod 11 |
| ismn | ISMN (International Standard Music Number) | Mod 10 |
| isni | ISNI (International Standard Name Identifier) | ISO 7064 MOD 11-2 |
| gtin14 | GTIN-14 (Global Trade Item Number) | Mod 10 |
| asin | ASIN (Amazon Standard Identification Number) | None (format only) |
These IDs are assigned by external registries and standards bodies — idt supports validation, inspection, and auto-detection, but not generation.
Generation Options
# UUID versions
# NanoID customization
# Snowflake customization
Output Formats
# Structured output (JSON, YAML, TOML)
# Shorthand for JSON
# Encoding formats (for convert/gen)
Examples
Generate and inspect UUIDv7:
)
)
Inspect ULID:
)
)
Sort IDs by timestamp:
Pipe support:
|
|
|
|
Options
| Flag | Description |
|---|---|
-n, --count |
Number of IDs to generate |
-f, --format |
Output encoding format |
-r, --reverse |
Sort in descending order |
--show-time |
Show timestamps alongside IDs |
--preset |
Snowflake preset (twitter, discord, instagram, sonyflake, mastodon) |
--field |
Set a Snowflake field value (e.g., --field shard_id=42) |
-T, --template |
Wrap each ID in a format string ({} = placeholder) |
-t, --type |
ID type hint |
-j, --json |
JSON output (shorthand for --output json) |
-o, --output |
Output format (json, yaml, toml) |
-p, --pretty |
Pretty print JSON |
--no-color |
Disable colors |
Call for contributions
This project is still in its infancy, so any contributions are welcome!
Please open an issue or a PR if you have any suggestions.
Security
See SECURITY.md
License
Licensed under either of Apache License Version 2.0 or MIT License at your option.