{"id":50203536,"url":"https://github.com/sphireinc/namegen","last_synced_at":"2026-05-26T00:03:29.891Z","repository":{"id":331673318,"uuid":"1131780169","full_name":"sphireinc/namegen","owner":"sphireinc","description":"A fast, deterministic name generator written in Go","archived":false,"fork":false,"pushed_at":"2026-02-17T21:07:34.000Z","size":9945,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-04T18:43:19.593Z","etag":null,"topics":["generator","generators","go","golang","name","namegen","namegeneration","namegenerator"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sphireinc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-10T17:21:18.000Z","updated_at":"2026-03-31T09:26:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sphireinc/namegen","commit_stats":null,"previous_names":["nsa-yoda/namegen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sphireinc/namegen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphireinc%2Fnamegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphireinc%2Fnamegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphireinc%2Fnamegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphireinc%2Fnamegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sphireinc","download_url":"https://codeload.github.com/sphireinc/namegen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphireinc%2Fnamegen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33497930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"ssl_error","status_checked_at":"2026-05-25T14:31:02.878Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generator","generators","go","golang","name","namegen","namegeneration","namegenerator"],"created_at":"2026-05-26T00:03:25.904Z","updated_at":"2026-05-26T00:03:29.886Z","avatar_url":"https://github.com/sphireinc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Makefile CI](https://github.com/nsa-yoda/namegen/actions/workflows/makefile.yml/badge.svg)](https://github.com/nsa-yoda/namegen/actions/workflows/makefile.yml)\n[![Build and Test](https://github.com/nsa-yoda/namegen/actions/workflows/go.yml/badge.svg)](https://github.com/nsa-yoda/namegen/actions/workflows/go.yml)\n[![Codacy Security](https://github.com/nsa-yoda/namegen/actions/workflows/codacy.yml/badge.svg)](https://github.com/nsa-yoda/namegen/actions/workflows/codacy.yml)\n[![CodeQL Advanced](https://github.com/nsa-yoda/namegen/actions/workflows/codeql.yml/badge.svg)](https://github.com/nsa-yoda/namegen/actions/workflows/codeql.yml)\n\n# namegen\n\nA fast, deterministic name generator written in Go.  \n\n`namegen` generates realistic-looking or fictional names across many language \nfamilies using **compiled-in profiles** (no runtime plugins). Output can be \nmade fully reproducible via seeds, making it suitable for games, testing, \nworld-building, and data generation.\n\n---\n\n## Features\n\n- Many language profiles (English, Japanese, Spanish, Nordic, Slavic, Tamil, Nahuatl, and more)\n- Deterministic randomness via seed (`-s`)\n- Realism control (`-realism 0..100`)\n- Gender hints (`male`, `female`, `neutral`)\n- Optional surnames by default ( turn them on with `-l`)\n- Reverse order (last name first)\n- Batch generation (`-c`)\n- Dev mode whih prints resolved config (`-d`)\n- Single static binary - no CGO, no `.so` plugins\n\n---\n\n## Project layout\n\n- `cmd/namegen/` – CLI entrypoint (imports all compiled-in profiles)\n- `api/` – profile interface, deterministic RNG helpers, shared utilities\n- `plugins/\u003cname\u003e/` – profiles (each registers itself via `init()`)\n\n---\n\n## Build\n\nFrom repo root:\n\n```bash\nmake build\n```\n\nOutput:\n\n```bash\n$ ls .\nbin/namegen\n```\n\n## Run\n\nShow help:\n```bash\n$ ./bin/namegen -h\n```\n\nExamples:\n\n```bash\n# default (english):\n./bin/namegen\n\n# choose a profile:\n./bin/namegen -mode japanese\n\n# include last name:\n./bin/namegen -mode spanish -l\n\n# reverse (last first):\n./bin/namegen -mode spanish -l -r\n\n# generate 10 names:\n./bin/namegen -mode english -l -c 10\n\n# deterministic (repeatable):\n./bin/namegen -mode english -l -s 42 -realism 80\n\n# gender:\n./bin/namegen -mode english -gender female -l -realism 90\n\n# prints a list of all available profiles\n./bin/namegen -p \n\n# dev mode prints the config JSON used:\n./bin/namegen -mode japanese -l -c 10 -d\n```\n\n\n## Flags\n\n| Flag                              | Meaning                                                            |\n|-----------------------------------|--------------------------------------------------------------------|\n| `-mode \u003cname\u003e`                    | Profile/mode name (compiled-in). Defaults to english.              |\n| `-l`                              | Include last name                                                  |\n| `-r`                              | Reverse output order (last first)                                  |\n| `-gender \u003cmale, female, neutral\u003e` | Gender hint passed to profile                                      |\n| `-family \u003ckey\u003e`                   | Optional “family override” (profiles may interpret it differently) |\n| `-realism 0...100`                | 0 = fictional phonotactics, 100 = curated/real-looking             |\n| `-s \u003cseed\u003e`                       | Seed (0 / omit = random each run)                                  |\n| `-c \u003ccount\u003e`                      | Number of names to generate                                        |\n| `-d`                              | Dev mode: prints config JSON                                       |\n| `-p`                              | List all avilable profiles                                         | \n\n## Available profiles\n\nThese are compiled into the binary via blank imports in `cmd/namegen/main.go`\n\n- amharic\n- arabic\n- aramaic\n- baltic\n- celtic\n- chinese\n- english\n- farsi\n- filipino\n- french\n- germanic\n- greek\n- hawaiian\n- hebrew\n- hindi\n- igbo\n- indonesian\n- italian\n- japanese\n- kazakh\n- korean\n- malay\n- maori\n- nahuatl\n- nordic\n- portuguese\n- samoan\n- slavic\n- spanish\n- swahili\n- tamil\n- thai\n- turkish\n- uzbek\n- vietnamese\n- yoruba\n\nIf you run a mode that doesn't exist, the CLI falls back to english.\n\n## How it works\n\nThe CLI passes `api.ProfileConfig` to the selected profile.\n- Profiles call `api.NewRand(cfg)` which:\n  - returns a deterministic RNG when `cfg.Seed != 0`\n  - returns a time-seeded RNG when `cfg.Seed == 0`\n- Profiles should use `api.PickRand(slice, r)` to select items.\n\nRule of thumb: If you want reproducibility, always pass `-s \u003cseed\u003e`\n\n## Writing a new profile (compiled-in)\n\n1. Create a folder:\n\n```bash\n$ mkdir -p plugins/myprofile\n```\n\n2. Add `plugins/myprofile/myprofile.go` and paste this minimal skeleton:\n\n```go \npackage myprofile\n\nimport (\n\t\"github.com/nsa-yoda/namegen/api\"\n)\n\ntype myProfile struct{}\n\nconst PROFILE = \"myprofile\"\n\nfunc init() {\n\tapi.RegisterProfile(PROFILE, Profile)\n}\n\nfunc (p myProfile) Info() map[string]string {\n\treturn map[string]string{\n\t\t\"name\":  PROFILE,\n\t\t\"notes\": \"What this profile does\",\n\t}\n}\n\nfunc (p myProfile) Generate(cfg api.ProfileConfig) (api.NameResult, error) {\n\tr := api.NewRand(cfg)\n\n\tfirst := api.PickRand([]string{\"Ada\", \"Grace\", \"Linus\"}, r)\n\tlast := \"\"\n\tif cfg.IncludeLast {\n\t\tlast = api.PickRand([]string{\"Lovelace\", \"Hopper\", \"Torvalds\"}, r)\n\t}\n\n\treturn api.NameResult{First: first, Last: last}, nil\n}\n\nvar Profile myProfile\n```\n\n3. Compile it into the binary by adding a blank import to `cmd/namegen/main.go`:\n\n```go \n_ \"github.com/nsa-yoda/namegen/plugins/myprofile\"\n```\n\n4. Build and run:\n\n```bash\n$ make build\n$ ./bin/namegen -mode myprofile -l -s 123 -c 5\n```\n\n## Library usage (import in your own Go project)\n\nIf you want to use NameGen as a library, you import the API package and \nthen load plugins. The easiest way is to import all built-in plugins at once:\n\n```go \npackage main\n\nimport (\n\t\"fmt\"\n\n\t_ \"github.com/nsa-yoda/namegen/all\"\n\t\"github.com/nsa-yoda/namegen/api\"\n)\n\nfunc main() {\n\t// List available profiles (registered by imports)\n\tfmt.Println(\"profiles:\", api.ListProfiles())\n\n\t// Grab a profile and generate a name\n\tp, err := api.GetProfile(\"english\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tout, err := p.Generate(api.ProfileConfig{\n\t\tSeed:        123,\n\t\tRealism:     90,\n\t\tGender:      \"neutral\",\n\t\tIncludeLast: true,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%s %s\\n\", out.First, out.Last)\n}\n```\n\n### Loading only one plugin (smaller binaries)\n\nIf you don't want every built-in profile, import only the plugin(s) you need:\n\n```go\npackage main\n\nimport (\n\t_ \"github.com/nsa-yoda/namegen/plugins/english\" // registers “english” plugin/porfile\n\t\"github.com/nsa-yoda/namegen/api\"\n)\n\np, _ := api.GetProfile(\"english\")\nres, _ := p.Generate(api.ProfileConfig{Seed: 123, IncludeLast: true})\n```\n\n### Notes\n\n`github.com/nsa-yoda/namegen/all` is a convenience package that blank-imports \nevery built-in plugin so their init() functions run and registers the profiles.\n\nIf you care about binary size / compile time, prefer importing only \nthe specific plugin packages you need\n\n## Notes / gotchas\n\n- realism is profile-specific behavior. Every profile implements its own \n  blend between curated names and procedural phonotactics.\n- ASCII output by design is the defualt. Some languages normally use\n  diacritics or special punctuation; these profiles intentionally keep output ASCII-friendly.\n- Profile not found fallback. If -mode isn't registered, the CLI logs a \n  warning and uses english.\n\n\n## License\n\nThis project is licensed under the MIT license, see LICENSE file\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsphireinc%2Fnamegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsphireinc%2Fnamegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsphireinc%2Fnamegen/lists"}