• Transforms raw command-line arguments into a structured object.

    Parameters

    • args: string[]

      Array of command-line argument strings to parse

    Returns ParsedArgs

    A ParsedArgs object containing the parsed arguments

    // Basic usage
    const args = parseCliArgs(['--name', 'gandalf', '--power', '9000', 'spell']);
    console.log(args);
    // Output: { name: 'gandalf', power: 9000, _: ['spell'] }

    // Boolean flags
    const args2 = parseCliArgs(['--verbose', '--force']);
    console.log(args2);
    // Output: { verbose: true, force: true, _: [] }