{"library":"sade","title":"Sade CLI Framework","description":"Sade is a lightweight and powerful JavaScript library designed for building robust command-line interface (CLI) applications for Node.js. It distinguishes itself by providing a small API surface while offering essential features such as default commands, git-like subcommands, flexible option flags with aliases, type-casting for default option values, and sophisticated handling of required versus optional arguments. Sade also includes built-in command validation and automates the generation of helpful documentation, including version and usage text. The current stable version is 1.8.1, and the package sees regular, feature-driven releases, often including patches and minor enhancements like Deno support and integrated TypeScript definitions. It aims to offer a smooth developer and user experience with minimal overhead, making it a strong alternative to more heavyweight CLI frameworks.","language":"javascript","status":"active","last_verified":"Thu Apr 23","install":{"commands":["npm install sade"],"cli":{"name":"sade","version":null}},"imports":["import sade from 'sade'","import sade, { type Handler } from 'sade';\n// or\nimport type { Handler } from 'sade';","const sade = require('sade');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"#!/usr/bin/env node\n\nconst sade = require('sade');\n\nconst prog = sade('my-cli');\n\nprog\n  .version('1.0.5')\n  .option('--global, -g', 'An example global flag')\n  .option('-c, --config', 'Provide path to custom config', 'foo.config.js');\n\nprog\n  .command('build <src> <dest>')\n  .describe('Build the source directory. Expects an `index.js` entry file.')\n  .option('-o, --output', 'Change the name of the output file', 'bundle.js')\n  .example('build src build --global --config my-conf.js')\n  .example('build app public -o main.js')\n  .action((src, dest, opts) => {\n    console.log(`> building from ${src} to ${dest}`);\n    console.log(`> output file: ${opts.output}`);\n    console.log(`> global flag: ${opts.global}`);\n    console.log(`> config path: ${opts.config}`);\n  });\n\nprog\n  .command('greet <name>')\n  .describe('Greets the specified name.')\n  .option('--loud', 'Say it loudly!')\n  .action((name, opts) => {\n    const greeting = opts.loud ? `HELLO ${name.toUpperCase()}!` : `Hello ${name}!`;\n    console.log(greeting);\n  });\n\nprog.parse(process.argv);","lang":"javascript","description":"This quickstart demonstrates how to define a basic CLI application with Sade, including program-wide options, two distinct commands (`build` and `greet`), command-specific options, and argument parsing with actions.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}