• Stars
    star
    120
  • Rank 289,130 (Top 6 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Random name generator for Rust


names

Random name generator for Rust

CI CI Status
Bors enabled
Latest Version Latest version
Documentation Documentation
Crate Downloads Crate downloads
GitHub Downloads Github downloads
Docker Pulls Docker pulls
License Crate license
Table of Contents

CLI

Usage

Simple! Run without any parameters, you get a name:

> names
selfish-change

Need more? Tell it how many:

> names 10
rustic-flag
nondescript-crayon
picayune-map
elderly-cough
skinny-jeans
neat-rock
aware-sponge
psychotic-coast
brawny-event
tender-oatmeal

Not random enough? How about adding a 4-number pad:

> names --number 5
imported-rod-9680
thin-position-2344
hysterical-women-5647
volatile-pen-9210
diligent-grip-4520

If you're ever confused, at least there's help:

> names --help
names 0.11.0
Fletcher Nichol <[email protected]>

A random name generator with results like "delirious-pail"

USAGE:
    names [FLAGS] [AMOUNT]

ARGS:
    <AMOUNT>    Number of names to generate [default: 1]

FLAGS:
    -h, --help       Prints help information
    -n, --number     Adds a random number to the name(s)
    -V, --version    Prints version information

Installation

install.sh (Pre-Built Binaries)

An installer is provided at https://fnichol.github.io/names/install.sh which installs a suitable pre-built binary for common systems such as Linux, macOS, Windows, and FreeBSD. It can be downloaded and run locally or piped into a shell interpreter in the "curl-bash" style as shown below. Note that if you're opposed to this idea, feel free to check some of the alternatives below.

To install the latest release for your system into $HOME/bin:

curl -sSf https://fnichol.github.io/names/install.sh | sh

When the installer is run as root the installation directory defaults to /usr/local/bin:

curl -sSf https://fnichol.github.io/names/install.sh | sudo sh

A nightly release built from HEAD of the main branch is available which can also be installed:

curl -sSf https://fnichol.github.io/names/install.sh \
    | sh -s -- --release=nightly

For a full set of options, check out the help usage with:

curl -sSf https://fnichol.github.io/names/install.sh | sh -s -- --help

GitHub Releasees (Pre-Built Binaries)

Each release comes with binary artifacts published in GitHub Releases. The install.sh program downloads its artifacts from this location so this serves as a manual alternative. Each artifact ships with MD5 and SHA256 checksums to help verify the artifact on a target system.

Docker Image

A minimal image ships with each release (including a nightly built version from HEAD of the main branch) published to Docker Hub. The entrypoint invokes the binary directly, so any arguments to docker run will be passed to the program. For example, to display the full help usage:

docker run fnichol/names --help

Cargo Install

If Rust is installed on your system, then installing with Cargo is straight forward with:

cargo install names

From Source

To install from source, you can clone the Git repository, build with Cargo and copy the binary into a destination directory. This will build the project from the latest commit on the main branch, which may not correspond to the latest stable release:

> git clone https://github.com/fnichol/names.git
> cd names
> cargo build --release
> cp ./target/release/names /dest/path/

Library

This crate provides a generate that constructs random name strings suitable for use in container instances, project names, application instances, etc.

The name Generator implements the Iterator trait so it can be used with adapters, consumers, and in loops.

Usage

This crate is on crates.io and can be used by adding names to your dependencies in your project's Cargo.toml file:

[dependencies]
names = { version = "0.14.0", default-features = false }

Examples

Example: painless defaults

The easiest way to get started is to use the default Generator to return a name:

use names::Generator;

let mut generator = Generator::default();
println!("Your project is: {}", generator.next().unwrap());
// #=> "Your project is: rusty-nail"

If more randomness is required, you can generate a name with a trailing 4-digit number:

use names::{Generator, Name};

let mut generator = Generator::with_naming(Name::Numbered);
println!("Your project is: {}", generator.next().unwrap());
// #=> "Your project is: pushy-pencil-5602"

Example: with custom dictionaries

If you would rather supply your own custom adjective and noun word lists, you can provide your own by supplying 2 string slices. For example, this returns only one result:

use names::{Generator, Name};

let adjectives = &["imaginary"];
let nouns = &["roll"];
let mut generator = Generator::new(adjectives, nouns, Name::default());

assert_eq!("imaginary-roll", generator.next().unwrap());

CI Status

Build (main branch)

Operating System Target Stable Rust
FreeBSD x86_64-unknown-freebsd FreeBSD Build Status
Linux arm-unknown-linux-gnueabihf Linux Build Status
Linux aarch64-unknown-linux-gnu Linux Build Status
Linux i686-unknown-linux-gnu Linux Build Status
Linux i686-unknown-linux-musl Linux Build Status
Linux x86_64-unknown-linux-gnu Linux Build Status
Linux x86_64-unknown-linux-musl Linux Build Status
macOS x86_64-apple-darwin macOS Build Status
Windows x86_64-pc-windows-msvc Windows Build Status

Test (main branch)

Operating System Stable Rust Nightly Rust
FreeBSD FreeBSD Stable Test Status FreeBSD Nightly Test Status
Linux Linux Stable Test Status Linux Nightly Test Status
macOS macOS Stable Test Status macOS Nightly Test Status
Windows Windows Stable Test Status Windows Nightly Test Status

Note: The Minimum Supported Rust Version (MSRV) is also tested and can be viewed in the CI dashboard.

Check (main branch)

Status
Lint Lint Status
Format Format Status

Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

Issues

If you have any problems with or questions about this project, please contact us through a GitHub issue.

Contributing

You are invited to contribute to new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.

Release History

See the changelog for a full release history.

Authors

Created and maintained by Fletcher Nichol ([email protected]).

License

Licensed under the MIT license (LICENSE.txt).

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the MIT license, shall be licensed as above, without any additional terms or conditions.

More Repositories

1

dvm

An on demand Docker virtual machine, thanks to Vagrant and boot2docker. Works great on Macs and other platforms that don't natively support the Docker daemon. Support VirtualBox, VMware, and Parallels.
Shell
458
star
2

chef-user

A convenient Chef LWRP to manage user accounts and SSH keys
Ruby
222
star
3

chef-jenkins

Former location for Jenkins Chef cookbook, now maintained by Chef Software Inc at https://github.com/chef-cookbooks/jenkins
Ruby
175
star
4

knife-server

A Chef Knife plugin to manage Chef Servers. Bootstrap a new Chef Server on Amazon's EC2, Digital Ocean, Linode, OpenStack or a standalone server. Backup and restore your Chef Server or Hosted Chef's node, role, data bag, and environment JSON data.
Ruby
158
star
5

macosx-iterm2-settings

A project to save the settings and preferences for iTerm2 to a Git repository in XML format which is easier for humans to reason about.
Shell
74
star
6

bashrc

cross platform bash configuration for system deployments
Shell
50
star
7

docker-uhttpd

A Docker micro image for uhttpd, a tiny, lightweight web server
Shell
44
star
8

chef-rvm_passenger

Chef cookbook which installs the Passenger gem via RVM and configures Apache or nginx.
Ruby
32
star
9

docker-ngrok

A Docker image for ngrok, introspected tunnels to localhost
Shell
29
star
10

wiki-notes

28
star
11

chef-bootstrap-repo

Shell
28
star
12

searchef

Stub Chef Search!
Ruby
28
star
13

chef-homesick

Chef library cookbook to manage Homesick castle repositories.
Ruby
28
star
14

emeril

Emeril: Tag And Release Chef Cookbooks As A Library
Ruby
28
star
15

chef-gitorious

Gitorious cookbook for Chef
Ruby
25
star
16

features-rs

features - A Rust library for runtime feature toggles
Rust
22
star
17

capistrano-fanfare

Ruby
21
star
18

libsh

A library of common, reusable, and portable POSIX shell functions.
Shell
20
star
19

devstack-vagrant-basebox

Vagrant Box Generator for OpenStack's DevStack
Shell
18
star
20

limitation

Rate limiting using a fixed window counter for arbitrary keys, backed by Redis.
Rust
16
star
21

docker-rust

Rust Programming Language Docker Images!
Shell
16
star
22

veewee-definitions

Some custom/modified VeeWee definitions for Vagrant base boxes
Ruby
16
star
23

omnibus-puppet

Experimental Puppet Omnibus packages
Ruby
15
star
24

packer-templates

Shell
15
star
25

dotfiles

A personal set of Unix "dotfiles" to configure various programs.
Perl
15
star
26

chef-alfresco

Chef cookbook to install Alfresco Community Edition.
Ruby
15
star
27

guard-webrick

Guard::WEBrick automatically starts and restarts WEBrick when needed.
Ruby
14
star
28

chef-webapp

Ruby
11
star
29

finstyle

Finstyle: Version Pinning RuboCop and Configuration for CI
Ruby
11
star
30

chef-vagrant_extras

Chef cookbook with extra fixes and shims for running your recipes in a Vagrant virtual machine.
Ruby
10
star
31

arch-linux-installer

Arch Linux with ZFS installer
Shell
10
star
32

minitest-capistrano

MiniTest assertions and expectations for testing Capistrano recipes
Ruby
10
star
33

chefdk-update-app

A little help when you want to update an appbundled project inside ChefDK
Ruby
9
star
34

chef-openssh

Former location for a fork of the OpenSSH Chef cookbook, now maintained by Chef Software Inc at https://github.com/chef-cookbooks/openssh
HTML
9
star
35

chef-zip_app

Chef LWRP to install Mac OS X applications from zip archives
Ruby
9
star
36

dotvim

A personal editor setup for vi, Vim, MacVim, and Neovim
Vim Script
9
star
37

workstation

Shell
9
star
38

chef-rbenv_system_pkgs

Chef cookbook which installs pre-built rbenv Ruby version tarballs in a system install. Works with chef-ruby_build and chef-rbenv.
Ruby
9
star
39

rails-template-recipes

Ruby
8
star
40

campy

Tiny Campfire Ruby client so you can get on with it.
Ruby
7
star
41

libarchive-rust

A Rust crate for interacting with archives using libarchive
Rust
7
star
42

docker-check-shell

A Docker image with linters (such as ShellCheck and hadolint) and formatters (such as shfmt) for POSIX, Bash, and mksh shell code.
Shell
7
star
43

nameit

Nameit is a small zero-dependency library and tool that helps you generate a random name for a project, database, session--you decide. You get glorious adjective-noun style names such as "pushy-clock" and "lovely-ducks" or ask for a random number on the end to give you names like "numberless-cactus-123" and "superb-shoes-915".
Ruby
7
star
44

homebrew-dvm

A Homebrew formula for dvm, effortless Docker-in-a-box for unsupported Docker platforms, like the Mac.
Ruby
6
star
45

chef-fanfare

Ruby
6
star
46

iocage-provision

Creates an iocage based FreeBSD jail
Rust
6
star
47

chef-platform_packages

Chef cookbook which installs individual packages via attribute or data bag metadata.
Ruby
6
star
48

iocage-plugin-gitea

An iocage plugin for Gitea, a painless self-hosted Git service.
Shell
5
star
49

opscode

Opscode - An Infrastructure Code Workflow Tool
Ruby
4
star
50

chef-hostname

Ruby
4
star
51

fnichol-cime

A demonstration of a Rust CI build/test/release workflow supporting multi-platform testing, binary builds, Docker image building, and Crates.io publishing.
Shell
4
star
52

vagrant-butter

Smooth out Vagrantfiles with some common helpers and shims
Ruby
4
star
53

chef-mysql

Former location for a fork of the MySQL Chef cookbook, now maintained by Chef Software Inc at https://github.com/chef-cookbooks/mysql
Ruby
4
star
54

rbenvinator

Building Ruby version tarballs for rbenv. Because your time is valuable.
Ruby
4
star
55

chef-puppet

Chef cookbook to install and manage a Puppet Master service. No, really.
Ruby
3
star
56

chef-dmg

Opscode DMG Chef Cookbook fork which fixes copying of symlinks, like in Dropbox.dmg
Ruby
3
star
57

iterative_chef

Ruby
3
star
58

chef-xbmc

Ruby
3
star
59

tapasd

tapasd - a concurrent Ruby Tapas episode downloader
Go
3
star
60

docker-stylua

A small Docker image for StyLua, an opinionated Lua code formatter.
Shell
3
star
61

renv

renv: A Ruby Environment Context Switcher
Shell
3
star
62

docker-vint

A small Docker image for Vint, a fast and highly extensible Vim script language linter implemented in Python
Shell
3
star
63

chef-github_repo_mirror

Ruby
3
star
64

capstrap

Bootstrapping Ubuntu with chef-solo using Capistrano.
Ruby
3
star
65

opif

OpenBSD Post-Installation Framework (opif). A treat from the Nichol Code Archives.
Perl
2
star
66

mtoc

Generates and writes a table of contents into any Markdown document
Rust
2
star
67

iocage-plugin-nginx

An iocage plugin for nginx, a Robust and small WWW server.
Shell
2
star
68

obpf

OpenBSD Binary Patching Framework (obpf). A treat from the Nichol Code Archives.
Perl
2
star
69

docker-acme-truenas

A Docker image with acme.sh and deploy-freenas which can be used to continually renew and deploy Let's Encrypt SSL certificates.
Shell
2
star
70

mysql_backup

Shell
2
star
71

chef-searchef

Chef cookbook to use Searchef (Stub Chef Search!).
Ruby
2
star
72

libarchive3-sys

Rust
2
star
73

chef-transmission

Ruby
2
star
74

chef-ubuntu_nvidia_gpu

Chef cookbook to install the NVIDIA binary Xorg driver.
Ruby
2
star
75

capistrano-lastmile

Take Capistrano the last mile to deployment bliss.
Ruby
2
star
76

chef-solo_data_bags

Adds data bag support for older versions of Chef in solo mode
Ruby
2
star
77

chef-mythtv

Ruby
2
star
78

chef-openoffice

Chef cookbook to install the OpenOffice productivity suite.
Ruby
2
star
79

guard_boilerplate

A simple script that allows you to run Guard to refresh your web browser and optionally recompile Sass/Haml files
Ruby
2
star
80

chef-oracle_instantclient

Ruby
1
star
81

openbsd-builder

Builds an OpenBSD release of -stable for on-site usage.
Shell
1
star
82

dotx

A personal set of X Windows/Wayland configuration for various programs
SCSS
1
star
83

pry_me_out

Ruby
1
star
84

fnichol.com

HTML
1
star
85

chef-inspec_example

Chef cookbook example using Test Kitchen & InSpec Verifier
Ruby
1
star
86

versio

Rust
1
star
87

piawg

Rust
1
star
88

charts

Applications and services, provided by fnichol, ready to launch on Kubernetes using the Helm package manager
Smarty
1
star
89

testr

Shell
1
star
90

bento_box_server

Ruby
1
star
91

chef-platform_ubuntu

Ruby
1
star
92

obpf-makefiles

Working examples of OpenBSD release obpf Makefiles
1
star
93

rack_deploy_me

Ruby
1
star
94

yegrb-groovy-talk

Ruby
1
star
95

iocage-plugin-transmission-pia

Shell
1
star
96

docker-nginx-tcp-lb

A small Docker image for running an nginx TCP load balancer.
Shell
1
star
97

chef-platform_suse

Ruby
1
star
98

php_deploy_me

PHP
1
star
99

chef-dna-spike

Ruby
1
star
100

foreman-export-fanfare

Ruby
1
star