Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback


Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Go to Latest
import { Command, ValidationError } from "../../command/mod.ts";
const cmd = new Command() .throwErrors() // <-- throw also validation errors. .option("-p, --pizza-type <type>", "Flavour of pizza.") .action(() => { throw new Error("Some error happened."); });
try { cmd.parse();} catch (error) { if (error instanceof ValidationError) {; console.error("[CUSTOM_VALIDATION_ERROR]", error.message); } else { console.error("[CUSTOM_ERROR]", error); } Deno.exit(1);}