| Crates.io | namesake |
| lib.rs | namesake |
| version | 0.1.0 |
| created_at | 2025-08-05 17:46:13.04128+00 |
| updated_at | 2025-08-05 17:46:13.04128+00 |
| description | A CLI tool and library to generate names by combining words. |
| homepage | |
| repository | https://github.com/detj/namesake |
| max_upload_size | |
| id | 1782366 |
| size | 72,297 |
A CLI tool and library to generate memorable names by combining words.
Namesake uses the CMU Pronouncing Dictionary to create new words. By default, it combines two random 3-letter, one-syllable words, but is highly configurable.
--choice.--two) words.--count automatically uses longer words after exhausting shorter ones.--all) or include reversed pairs (--reverse).# Clone the repository
git clone https://github.com/detj/namesake.git
cd namesake
# Build the project (this downloads and processes the dictionary on the first run)
cargo build --release
The final executable is available at target/release/namesake.
| Command | Description |
|---|---|
./namesake |
Generates one name from two random 3-letter words. |
./namesake --choice star |
Combines "star" with a random word (e.g., starship). |
./namesake --count 5 |
Generates 5 random names. |
./namesake --reverse |
Includes reversed combinations (e.g., catbat, batcat). |
./namesake --two |
Uses two-syllable words instead of one-syllable words. |
./namesake --all |
Generates all possible combinations of 3-letter words. |
Flags can be combined, for example: namesake --choice bat --count 3 --reverse.
Add namesake to your Cargo.toml:
[dependencies]
namesake = "0.1.0" # Or use the git repository
Then, use the namesake function with a Config struct:
use namesake::{namesake, Config};
fn main() {
// Generate 3 names based on the word "space", with reverses
let config = Config {
choice: Some("space".to_string()),
count: 3,
reverse: true,
..Default::default()
};
if let Ok(names) = namesake(&config) {
println!("Generated names: {:?}", names);
}
}
The namesake crate contains both a library and a binary. A build.rs script downloads and processes the CMU Pronouncing Dictionary during compilation. The resulting word lists are embedded directly into the library using include_str!, ensuring the final binary is self-contained and fast.