Skip to main content

cmdo

A mini Google for your terminal. Ask what a command does, describe a task and get the command for it, or check what is installed on your machine — all offline.

No API keys. No network calls. No dependencies beyond the python3 already on your system.

$ cmdo how "join two commands"

  how to: join two commands

  1. |   strong match
     The pipe. Sends the output of one command straight into the input of the next.
     Use it when you want to filter, sort, count or transform whatever another
     command prints.
       cat file.txt | grep error
       ps aux | grep node | wc -l

Install

pip install cmdo-terminal

The package is cmdo-terminal because cmdo was already taken on PyPI. The command you type is still cmdo.

Or, to keep it isolated from your other Python packages:

pipx install cmdo-terminal

Straight from source, without waiting for a release:

pip install git+https://github.com/LuShadowX/cmdo.git

There is nothing to configure — the command database ships inside the package. To uninstall: pip uninstall cmdo-terminal.

The three things it does

1. Explain a command

$ cmdo grep

  grep  · text
  Search text for lines that match a pattern, and print them.

  Give it a pattern and some input - a file, several files, or a pipe - and it
  prints every line that matches. The pattern is a regular expression, so it
  handles far more than plain words. The flags you will use constantly are -i to
  ignore case, -r to search a whole directory recursively, -n to show line
  numbers, and -v to invert the match and show lines that do not contain the
  pattern.

  EXAMPLES
    grep -rn 'TODO' src/
      find every TODO in a directory, with file and line numbers
    cat app.log | grep -i error
      keep only the error lines, ignoring case

  When to reach for it: you know roughly what the text says but not which file
  or line it is on.

  SEE ALSO  rg · sed · awk · find
  ON THIS SYSTEM  /usr/bin/grep

Operators count as commands, so cmdo '|', cmdo '&&' and cmdo '2>&1' all work. So do multi-word git entries: cmdo git rebase.

2. Search by what you want to do

$ cmdo how "find text in files"

Describe the task in plain words. It ranks the database by weighted keyword scoring and shows the top three, each with why it fits and a concrete example. If nothing scores well enough it says so rather than guessing.

3. Check your machine

$ cmdo have docker

  yes  docker is installed
    path     /opt/homebrew/bin/docker
    real     /opt/homebrew/Cellar/docker/28.4.0/bin/docker
    version  Docker version 28.4.0, build d8eb465f86
    what     Build and run applications in containers.

Exit code is 0 when found and 1 when not, so it works in scripts:

cmdo have jq >/dev/null || brew install jq

And to see what you already have:

$ cmdo search net

  17 installed commands matching net

  netstat                  Show network connections, listening ports and...
  nettop                   Display updated information about the network...
  networksetup             configuration tool for network settings in...

Typos and unknown commands

Misspell something and it suggests the closest real match:

$ cmdo gerp

  Unknown command: gerp

  Did you mean grep or zgrep or gperf?
  Run: cmdo grep

If a command is installed but not in the database, cmdo reads your own man page for it, so coverage is not limited to what ships in the JSON.

What is in the database

177 hand-written entries — not scraped man pages:

Area Covers
Operators | && || > >> 2>&1 & $( ) * ~ !! $? and more
Files ls, cd, cp, mv, rm, find, chmod, chown, du, df, ln, stat
Text grep, sed, awk, cut, sort, uniq, wc, tr, tee, diff, xargs, jq
Networking curl, wget, ssh, scp, rsync, dig, ping, lsof, netstat, nc, openssl
Processes ps, top, kill, pkill, pgrep, jobs, nohup, watch, timeout
Git 26 entries — status, add, commit, push, pull, rebase, stash, reset, blame
System uname, env, export, alias, sudo, crontab, history, date
Archives tar, zip, unzip, gzip, zcat
Packages brew, apt, npm, npx, pip3

Options

cmdo <command>           Explain a command in plain English
cmdo how "<task>"        Find the right command for what you want to do
cmdo have <command>      Check if a command is installed, and where
cmdo search <keyword>    List installed commands matching a keyword

-h, --help       Show help
-v, --version    Show version
    --no-color   Disable colored output

Colour turns itself off when output is piped, and honours NO_COLOR.

How it works

One Python module, one JSON file. cmdo is stdlib-only — json, difflib, shutil, subprocess, textwrap. It has zero package dependencies, so pip install cmdo-terminal downloads nothing but cmdo itself.

how scores every entry against your query: an exact keyword phrase is worth 10 points, a token inside a keyword 4, a token in the summary 3, in the detail 1, and a difflib close match 3 for typos. The total is scaled by how much of your query was matched, so a short precise hit beats a long noisy one. Anything under a floor score is reported as "no confident match" instead of a wrong answer.

Adding a command means adding an object to src/cmdo/data/commands.json — name, category, summary, detail, examples, keywords. No code changes.

src/cmdo/
├── cli.py               everything: parsing, scoring, rendering, system probing
├── __main__.py          so `python3 -m cmdo` works too
└── data/commands.json   the knowledge base

Requirements

  • macOS or Linux
  • Python 3.8 or newer (preinstalled on macOS and every mainstream Linux distribution)

Licence

MIT

Metadata

Release files for cmdo-terminal 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cmdo-terminal 1.0.0
File Size Uploaded Provenance Actions
cmdo_terminal-1.0.0.tar.gz 47.7 kB Without provenance Details for cmdo_terminal-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cmdo-terminal 1.0.0
File Interpreter ABI Platform Actions
cmdo_terminal-1.0.0-py3-none-any.whl Python 3 none any Details for cmdo_terminal-1.0.0-py3-none-any.whl

Total release size: 97.5 kB

Release files / cmdo_terminal-1.0.0.tar.gz

Download URL cmdo_terminal-1.0.0.tar.gz
Size 47.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4b5d89a0e5c95f4d640085ec6e00d3220f240bc0103d7546dc0acb4df37585b6
BLAKE2b-256 checksum
How to use checksums
c0c4b20ee0f569e79e2ced87dddac101892cc1f76d2587114d04c4caaf1bc1da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / cmdo_terminal-1.0.0-py3-none-any.whl

Download URL cmdo_terminal-1.0.0-py3-none-any.whl
Size 49.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a402d23ff6f3d184544df42eb6984a650910e718fd416f5b2e7dc6c58a2b151
BLAKE2b-256 checksum
How to use checksums
a18d93ff19d05b20fffc831e92fee554deb44411df1d88bd38625729d95d7337
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for cmdo-terminal 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page