04 / omx-cmd · short CLI
A second published npm tool that does one thing from the terminal. npx omx-cmd --help is the whole manual.
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.
Limitation: narrow scope. That is the point. It does what it says and nothing more.
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.
#!/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)
}
{
"name": "omx-cmd",
"bin": { "omx-cmd": "./bin/omx" },
"type": "module",
"files": ["bin/"]
}
// 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 }
}
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.