RISHET MEHRA · DTU '27

04 / omx-cmd · short CLI

Small CLI, one job.

A second published npm tool that does one thing from the terminal. npx omx-cmd --help is the whole manual.

What it does

omx-cmd is a small CLI that does one job from the terminal. It is the second npm tool after codex-spend, and it is intentionally narrow. The whole manual is npx omx-cmd --help. No config file, no setup step, installs in seconds.

The point was to practice shipping again with the lessons from the first publish: keep the surface tiny, make help fit on a narrow terminal, and let npx be the install.

  • One command, one job, no subcommands to learn
  • Help output aligns on 80 column terminals
  • Zero config, no dotfile, no env var
  • Published on npm, source on GitHub at Rishet11/OmniCommand

Limitation: narrow scope. That is the point. It does what it says and nothing more.

How it works

The CLI is a single Node bin file. Parse args, print help, do the work, exit. No framework, no extra parsing library beyond what is needed.

bin/omx · the whole CLINode · npm
#!/usr/bin/env node
const args = process.argv.slice(2)

function printHelp() {
  console.log(`Usage: omx-cmd [opts]
  --help     show this
  --version  print version`)
}

if (args.includes('--help') || args.length === 0) {
  printHelp()
  process.exit(0)
}
package.json · bin and publish
{
  "name": "omx-cmd",
  "bin": { "omx-cmd": "./bin/omx" },
  "type": "module",
  "files": ["bin/"]
}
bin/run.js · keep the job single minded
// one function, one side effect, easy to test
export function run(opts) {
  if (opts.help) return { ok: true, out: helpText }
  const result = doOneThing(opts.input)
  return { ok: true, out: result }
}

What shipping twice taught

The first publish teaches you packaging. The second teaches you restraint. Keeping the command tiny means fewer bugs, faster help, and a clearer reason to install.

Back to work → GitHub profile →