← All Templates

CLI Tool

JavaScriptIntermediatePackages

Command-line tool with argument parsing, colored output, and interactive prompts. Publishable to npm.

Features

Code Preview

#!/usr/bin/env node
import { parseArgs } from 'node:util';

const { values, positionals } = parseArgs({
  options: {
    verbose: { type: 'boolean', short: 'v' },
    output: { type: 'string', short: 'o' },
  },
  allowPositionals: true,
});

console.log('Running with:', values);
console.log('Args:', positionals);
Open in RoadCode

Related Templates

Python Package
Python · Intermediate
npm Package
TypeScript · Intermediate