Resources · For developers
How to Name a CLI Tool
A command name is a word in every PATH on every machine. Choose it like a shared resource, because that is what it is.
To name a CLI tool, choose a length that matches how often people will type it, check the word against shell builtins, common aliases, the Debian package contents and Homebrew, and keep descriptive words for subcommands instead of the binary. The reason to be this careful is that a command name lives in a flat, shared namespace, and when two programs want the same word, a distribution packager decides which one gets renamed, not you.
One honest note. Namoly’s four checks were built for brand names, not binaries. It does not search PATHs, distro package indexes, Homebrew, package registries, trademarks, or social handles: every collision check here stays manual. Its domain check is still useful for the project’s site, and any domain result is a snapshot worth checking at a registrar.
Test your project name for freeFree, with a result in seconds. Your first name needs no signup.
A command name lives in a flat, shared namespace
A command name competes with every other executable on the same machine, and there is no category and no registration office: there is only the PATH. POSIX defines the lookup plainly. The directories in PATH are searched from beginning to end, and the first executable with the right name wins. Before that search even starts, the shell resolves special builtins, functions and its own intrinsic utilities, so an alias or a builtin with your name beats your binary without ever looking at the disk.
The loser of that race gets no error message. It simply never runs, and the bug report lands on you.
Package managers settle clashes without asking the author. Debian Policy section 10.1 says two packages must not install different programs under the same file name; maintainers try to agree on debian-devel which one is renamed, and if they cannot, both must be. Ubuntu inherits the result, and so does any container image that installs your tool with apt, which is a lot of the machines it will run on.
Why is it called fdfind? The documented renames
None of these names was renamed for being confusing or hard to spell. Each arrived after another program had already taken the word, and the packager’s rule did the rest.
- fd became fdfindDebian and Ubuntu ship the package fd-find with the binary fdfind. The fd README says the binary name fd “is already used by another package”, and the Debian description says the executable and its man page were renamed because of a file name clash. Debian’s file list for fdclone, a console file manager, includes /usr/bin/fd; the fd docs do not name the partner.
- bat became batcatA Debian bug filed on 24 August 2019 reported that bat could not install: bacula-console-qt, the console of the Bacula backup system, already shipped a program called bat and the man page bat.1.gz. Debian now installs batcat.
- node became nodejs, then node againDebian already had a package called node, an amateur radio program (an AX.25 node). On 12 July 2012 Debian’s Technical Committee ruled that Node.js must use /usr/bin/nodejs and that the radio package be renamed ax25-node in /usr/sbin. The same ruling set up transition and legacy packages for scripts that expected the old name. On 31 July 2017 the committee repealed the ruling and let Node.js provide /usr/bin/node.
- ack was ack-grep for yearsDebian shipped the Perl search tool ack as ack-grep because ack already named a Kanji code converter. The Debian changelog for version 2.12-2, dated 17 February 2014, records the end of it: the converter had been removed from Debian, so the tool could be ack again.
- convert met WindowsWindows has its own convert command, which converts FAT and FAT32 volumes to NTFS. ImageMagick 7 made magick its primary command, replacing convert, and its porting guide tells Windows users to call tools through magick. The guide does not cite the Windows clash as the reason.
In each case the clash partner was an older program in another field entirely, and popularity did not decide the outcome: the newcomer was usually the one renamed, and in the node case Debian’s committee renamed both programs. bat also collided on its man page, even though the two programs installed into different directories. A name is checked everywhere a file with that name lands, not only in /usr/bin.
Clashes over the project’s own name, rather than its binary, tend to be trademark disputes and are a different story: Hudson to Jenkins, Ethereal to Wireshark and the rest are in how to name an open source project.
How short should a command name be?
As short as the typing frequency earns, and no shorter. No study puts a number on it, so treat what follows as a working rule, visible in the tools developers type most: git, gh (the GitHub CLI), rg and fd.
- Many times an hourTwo or three letters can be justified: git, gh, rg, fd. A name this short claims a tiny space (only 676 two-letter lowercase pairs exist), so expect a clash and keep a longer fallback.
- A few times a dayOne short word or a clear abbreviation, roughly four to eight letters: quick to type, distinct enough to search for.
- Weekly or in scriptsSpell it out. It is read far more often than typed, in scripts, CI files and runbooks, where a full word documents itself.
Ripgrep gets both. The project is ripgrep, a word you can search for, and its README states that the binary name is rg (its FAQ says “rip” was chosen to mean fast). The long name is the brand, the short one is the keystroke.
Short names also catch typo traffic, and not only from you. Debian packages a program called sl whose description says it exists to correct you if you type sl by mistake, one swapped letter away from ls. If your short name sits one keystroke from a command people type all day, expect to run by accident, and make sure running by accident is harmless.
Length for brand names in general, where the trade-offs are different, is covered in how long a brand name should be.
The package name and the binary name are two names
Most tools have three names: the project name people say, the package name a package manager installs, and the binary name a shell runs. They live in different namespaces and do not have to match. npm makes the split explicit: a package’s bin field is a map from command name to file, so the package and the command can be called different things. Debian does the same thing when it has to, which is how the package fd-find comes to install fdfind.
Homebrew leans the other way. Its Formula Cookbook asks for the formula to be named the way the project markets itself, and treats conflicts_with as a blunt, last-resort tool. For a clash on a binary that is not essential, the cookbook’s preference is to remove or rename that one file on install, and prefixing a binary is one of its documented options. So a packager may rename your binary on one platform and not another.
The useful decision is to make the split on purpose. Give the package a distinctive, searchable name you can claim on the registry, give the binary the length its frequency earns, and write down the fallback binary name you would accept if a distro asked. If the fallback is the package name, you have already chosen it. The registry rules themselves (npm disputes, PyPI’s PEP 541, crates.io squatting policy) are in the open source naming guide, and the one-line version for a company shipping a CLI is in how to name a tech startup.
Subcommands: a tool verb or a git-style host
The second decision is how many names the tool has inside it. Once the meaning moves into subcommands, the binary no longer has to carry it.
- A tool that does one verbrg PATTERN, fd PATTERN: the binary is the verb and the arguments are the object. The name carries the whole interface, so it can be short and still unambiguous in context.
- A host with subcommandsgit commit, kubectl apply, cargo build: the binary is a short, stable noun and every action lives one level down, where the namespace is yours alone. That is where the long, descriptive words belong, because nobody else can claim them.
- A plugin for somebody else’s hostGit looks for git-* programs on your PATH, Cargo turns “cargo foo” into a cargo-foo binary, and kubectl runs any kubectl-foo it finds. Kubectl’s rules are explicit: dashes separate subcommands, underscores in the file name produce a dash, and a plugin can never override a built-in command. Your binary name is decided by the host’s convention, not by you.
The subcommand namespace is the only one you own outright, so spend your descriptive words there: deploy and init are useless as binaries and perfect as subcommands. If you expect plugins, fix the convention early and decide what happens when a plugin’s name matches a built-in.
Completion, man pages and docs follow the name
A command name is not one file. Shell completion scripts are registered against the command’s name, the man page is installed under it, and every README, blog post and Stack Overflow answer quotes it. fd ships completion files for bash, zsh, fish and PowerShell in its release archives and can generate them with fd --gen-completions. When Debian renamed the binaries, its notes for both fd-find and bat record that the man page was renamed with them.
Users can add alias fd=fdfind, but scripts and the instructions online now describe two commands. Generate completions from the program at build time rather than hard-coding the name, so a packager who renames the binary can regenerate them.
How to check if a command name is taken
Run these before the first tagged release, cheapest first. Each covers only its own corner of the namespace, which is why there are eight.
- Ask your own shellRun command -v NAME and type -a NAME in bash or zsh, and Get-Command NAME in PowerShell. type -a lists every match, builtins and aliases included.
- Rule out builtins and keywordsFunctions and shell builtins are resolved before the PATH is searched, so a binary called test loses to the builtin in every bash session. Avoid any word on your shell’s builtin list.
- Check the common alias setsOh My Zsh enables its git plugin in the default zshrc template, and that plugin defines g, ga, gc, gd, gl, gp, gst and gco among many others. A two-letter name inside that set is shadowed for a large share of zsh users.
- Search Debian’s package contentspackages.debian.org can search the contents of every package for a file name, and apt-file does the same locally. Look for /usr/bin/NAME and /usr/sbin/NAME, and for NAME.1 in the man pages: bat collided on its man page as well as its binary.
- Search HomebrewRun brew search NAME or look the name up on formulae.brew.sh. Homebrew names a formula the way the project markets itself, and its cookbook treats conflicts_with as a last resort, so a clash there usually means renaming or prefixing a binary on install.
- Check the Windows built-insIf you ship for Windows, run where NAME in a stock cmd.exe. Generic verbs (convert, find, sort, more) are already taken there.
- Check the registry for the package nameThe package name and the binary name can differ, and the registry only checks the package name. Claim it on the registry you publish to before you announce anything.
- Say it, search it, type it onceRead the name aloud in a sentence (“just run ___ init”), search for it with “cli” after it, and ask somebody who has only heard it to type it.
A quiet result across all eight is not a guarantee: somebody can publish a package next month, and this list does not reach every distribution or machine. Once it passes, claim it everywhere in one sitting, as how to secure a brand name lays out.
What a score settles for a CLI tool, and what it does not
Namoly scores a name on four weighted categories: domain availability (0.30), memorability and distinctiveness (0.25), phonetics and readability (0.25), and cross-language safety (0.20). The overall is the weighted mean, and the bands are 80–100 Strong, 60–79 Good, 40–59 Fair, 0–39 Weak. The analysis is deterministic, so the same name returns the same scores every time.
A two-letter binary will score badly on checks designed for brand names, for reasons that do not matter in a terminal. Run the project name instead. The domain score is built from .com, .io, .app and .co (weighted 0.5, 0.2, 0.15 and 0.15), which tells you where the project’s site could live; the extension choice itself is in tech startup domain names. Phonetics estimates whether somebody can type the name after hearing it once. The language screen checks the spelling against a blocklist in six languages and reports no flags in the languages checked.
What it does not settle is most of this guide: whether the binary name clashes on any PATH, whether Debian or Homebrew already has it, whether the package name is free on your registry, and whether anybody holds a trademark on the word. Those stay manual, and the trademark question has its own primer in trademark basics for startup naming, which is not legal advice and neither is this page.
Frequently asked questions
- How do I name a CLI tool?
- Match the length to how often it will be typed, check the name against shell builtins, common aliases, Debian’s package contents and Homebrew, decide the package and binary names separately, and keep descriptive words for subcommands.
- Why is fd called fdfind and bat called batcat on Ubuntu?
- Debian, which Ubuntu builds on, already had packages installing programs called fd and bat, and Debian Policy forbids two packages installing different programs under one file name. So the newcomers became fdfind and batcat.
- Why was Node.js called nodejs on Debian?
- Debian already had an amateur radio package called node. On 12 July 2012 its Technical Committee ruled that Node.js would use /usr/bin/nodejs and the radio package would become ax25-node. The committee repealed that ruling on 31 July 2017, which let Node.js provide /usr/bin/node again.
- How short should a command name be?
- As short as its typing frequency earns. Two or three letters suit a tool typed many times an hour, one short word suits daily use, and anything run weekly or from scripts should be spelled out. Shorter names collide more.
- How do I check if a command name is already taken?
- Run command -v and type -a locally, search Debian’s package contents for the file name, run brew search, check the Windows built-ins if you ship there, and check your package registry. No single check is complete.
Check the namespace, then ship it
Pick the length the typing earns, split the package name from the binary, keep the long words for subcommands, and search every PATH you can reach before the first release. Then put the project name through Namoly’s four deterministic checks for the site and the talk slides.
Test your project name for freeEvery score comes with its reasons. It’s free, and your first name needs no signup.