{"_id":"@alarife/commander","_rev":"7-0287cffdb5fd0edee51c2184ecccb308","name":"@alarife/commander","dist-tags":{"latest":"0.8.0"},"versions":{"0.1.0":{"name":"@alarife/commander","version":"0.1.0","keywords":["alarife"],"author":{"name":"Soria Garcia, Jose Eduardo","email":"alarifeproyect@gmail.com"},"license":"Apache-2.0","_id":"@alarife/commander@0.1.0","maintainers":[{"name":"jesoria","email":"pepesoriagarcia99@gmail.com"}],"homepage":"https://github.com/ALARIFE-PROYECT/alarife-commander#readme","bugs":{"url":"https://github.com/ALARIFE-PROYECT/alarife-commander/issues"},"dist":{"shasum":"25e607f2f6bc147b1be55b237cbcb52c5a89931e","tarball":"https://registry.npmjs.org/@alarife/commander/-/commander-0.1.0.tgz","fileCount":3,"integrity":"sha512-NcBxSEHRDXSoBMgNJ1FgMSv8K5xaG6h3+w6ySazne4QyAZkpZJbN01HoJu49p4lJNyWRlJSGLeYXOKtTYDkmFw==","signatures":[{"sig":"MEQCIH46TJUhBjyUeYE02QxtD5NzJ6PRKWbOcb33EKJpAUQ9AiBcaoYA7z/hgKtTec90R6ZNg9oU+SN4LYlPiH7k0yE1og==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8725},"main":"./lib/index.js","type":"commonjs","types":"./lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/index.js"}},"gitHead":"edf055018cb62078de294dc53cf18c11c5d5043a","private":false,"scripts":{"test":"npx tsc --project tsconfig.test.json && node --test \"dist/test/**/*.test.js\"","build":"npx tsc --project tsconfig.build.json"},"_npmUser":{"name":"jesoria","email":"pepesoriagarcia99@gmail.com"},"repository":{"url":"git+https://github.com/ALARIFE-PROYECT/alarife-commander.git","type":"git"},"_npmVersion":"11.6.2","description":"Command line interface tool for Alarife.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"tslib":"~2.8","commander":"~14.0"},"typesVersions":{"*":{".":["./lib/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"typescript":"~6.0","@types/node":"~24"},"_npmOperationalInternal":{"tmp":"tmp/commander_0.1.0_1775716502948_0.697213578421787","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@alarife/commander","version":"0.2.0","keywords":["alarife"],"author":{"name":"Soria Garcia, Jose Eduardo","email":"alarifeproyect@gmail.com"},"license":"Apache-2.0","_id":"@alarife/commander@0.2.0","maintainers":[{"name":"jesoria","email":"pepesoriagarcia99@gmail.com"}],"homepage":"https://github.com/ALARIFE-PROYECT/alarife-commander#readme","bugs":{"url":"https://github.com/ALARIFE-PROYECT/alarife-commander/issues"},"dist":{"shasum":"9035dac54724ac9f473e3b1d01ed2c587a7f89c4","tarball":"https://registry.npmjs.org/@alarife/commander/-/commander-0.2.0.tgz","fileCount":17,"integrity":"sha512-x2VyuPnbg6rqZFI6YswMILd40w9U47uvjVUgVuhBwPC+mkN4pqG9yFHFX1bpk4dFJn8w317x/dQ4tJHyf255Cg==","signatures":[{"sig":"MEYCIQDtAZKuQHO/tyNx9axu3wpzuoB/r7FJY5LOpb94ndUV0AIhALZkhfZjLlzvSKCm4vdk9GpyUeOhmymx4oktzjJfjnvP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alarife%2fcommander@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":24950},"main":"./lib/index.js","type":"commonjs","types":"./lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/index.js"}},"gitHead":"2a4ac2602aee47d561aed1b3775f72102cd96047","private":false,"scripts":{"test":"npx tsc --project tsconfig.test.json && node --test \"dist/test/**/*.test.js\"","build":"npx tsc --project tsconfig.build.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:929f09b8-272e-4715-8181-642984fe13a3"}},"repository":{"url":"git+https://github.com/ALARIFE-PROYECT/alarife-commander.git","type":"git"},"_npmVersion":"11.11.0","description":"Command line interface tool for Alarife.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"tslib":"~2.8","commander":"~14.0"},"typesVersions":{"*":{".":["./lib/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"typescript":"~6.0","@types/node":"~24"},"_npmOperationalInternal":{"tmp":"tmp/commander_0.2.0_1775716821129_0.07144694651464478","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@alarife/commander","version":"0.3.0","keywords":["alarife"],"author":{"name":"Soria Garcia, Jose Eduardo","email":"alarifeproyect@gmail.com"},"license":"Apache-2.0","_id":"@alarife/commander@0.3.0","maintainers":[{"name":"jesoria","email":"pepesoriagarcia99@gmail.com"}],"homepage":"https://github.com/ALARIFE-PROYECT/alarife-commander#readme","bugs":{"url":"https://github.com/ALARIFE-PROYECT/alarife-commander/issues"},"dist":{"shasum":"4cccb7e1fd091668c28a98edc64f908cde6eeaa9","tarball":"https://registry.npmjs.org/@alarife/commander/-/commander-0.3.0.tgz","fileCount":17,"integrity":"sha512-IgvaFBKwuv4pUsC2SicdouX4O9sXjb7J6JwHeHOmAFTyhgv1dl2UyZ63hvix4iHWSLiiGRd0GWzUsj+ne6jcWA==","signatures":[{"sig":"MEYCIQDQhYgpohvr7pmOa0yucaIISwk0YvEINGXNbVlTrFTC2gIhAOM71jQANZIMbNzYt+YmjSvwMz5hePI1l4Cs8SN5tjxb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alarife%2fcommander@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":25898},"main":"./lib/index.js","type":"commonjs","types":"./lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/index.js"}},"gitHead":"d8aade4d91cdbe367aacbf419d64df68ef67667d","private":false,"scripts":{"test":"npx tsc --project tsconfig.test.json && node --test \"dist/test/**/*.test.js\"","build":"npx tsc --project tsconfig.build.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:929f09b8-272e-4715-8181-642984fe13a3"}},"repository":{"url":"git+https://github.com/ALARIFE-PROYECT/alarife-commander.git","type":"git"},"_npmVersion":"11.11.0","description":"Command line interface tool for Alarife.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"tslib":"~2.8","commander":"~14.0"},"typesVersions":{"*":{".":["./lib/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"typescript":"~6.0","@types/node":"~24"},"_npmOperationalInternal":{"tmp":"tmp/commander_0.3.0_1775719540534_0.3718642574275113","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@alarife/commander","version":"0.4.0","keywords":["alarife"],"author":{"name":"Soria Garcia, Jose Eduardo","email":"alarifeproyect@gmail.com"},"license":"Apache-2.0","_id":"@alarife/commander@0.4.0","maintainers":[{"name":"jesoria","email":"pepesoriagarcia99@gmail.com"}],"homepage":"https://github.com/ALARIFE-PROYECT/alarife-commander#readme","bugs":{"url":"https://github.com/ALARIFE-PROYECT/alarife-commander/issues"},"dist":{"shasum":"5b613f98853599da43fcf2f87149ce85a985bcff","tarball":"https://registry.npmjs.org/@alarife/commander/-/commander-0.4.0.tgz","fileCount":17,"integrity":"sha512-8AjqR6yzktDqNkzlC3DM64c5vDufM2JmNL8cGJilOTX1F38Si3tW2Wn148WPPfboIEy1b2CkwC97MEBYNQLHqg==","signatures":[{"sig":"MEYCIQDsP1HwpY5iBLP2MrViXyUqnuPEPZTs7jwTx2sW/71aCAIhANc47Bub7ZF0wxbgCVMjYsNTEV3gU8agpRBjkCoqHE1Q","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alarife%2fcommander@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":25988},"main":"./lib/index.js","type":"commonjs","types":"./lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/index.js"}},"gitHead":"9aa114109393c27b4b48a4b18e79e2119470ab21","private":false,"scripts":{"test":"npx tsc --project tsconfig.test.json && node --test \"dist/test/**/*.test.js\"","build":"npx tsc --project tsconfig.build.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:929f09b8-272e-4715-8181-642984fe13a3"}},"repository":{"url":"git+https://github.com/ALARIFE-PROYECT/alarife-commander.git","type":"git"},"_npmVersion":"11.11.0","description":"Command line interface tool for Alarife.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"tslib":"~2.8","commander":"~14.0"},"typesVersions":{"*":{".":["./lib/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"typescript":"~6.0","@types/node":"~24"},"_npmOperationalInternal":{"tmp":"tmp/commander_0.4.0_1775741356896_0.5612450399352096","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@alarife/commander","version":"0.5.0","keywords":["alarife"],"author":{"name":"Soria Garcia, Jose Eduardo","email":"alarifeproyect@gmail.com"},"license":"Apache-2.0","_id":"@alarife/commander@0.5.0","maintainers":[{"name":"jesoria","email":"pepesoriagarcia99@gmail.com"}],"homepage":"https://github.com/ALARIFE-PROYECT/alarife-commander#readme","bugs":{"url":"https://github.com/ALARIFE-PROYECT/alarife-commander/issues"},"dist":{"shasum":"b2c34a9865968f9a9c5d995c514d63fa74e25ece","tarball":"https://registry.npmjs.org/@alarife/commander/-/commander-0.5.0.tgz","fileCount":17,"integrity":"sha512-Gv8Om+YBWoeI4/xjs0cD1VGTM2C/p1/61srwkx6mtK+5eMAjONPUh83FU5gXzW/0VuhJPVXQDv7ZM+JNhjBOpg==","signatures":[{"sig":"MEUCIDl1/Qtr3v6FzNl7vvj2dvU5leTk+VmQUCsEa2bP8E+GAiEAgN6QD9FKJEGcZY8eKBWVMog3oVWYZMr7VYLrkvLCwaY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alarife%2fcommander@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":27334},"main":"./lib/index.js","type":"commonjs","types":"./lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/index.js"}},"gitHead":"6ac30390c7d2a3c5507113134674ebfa95182d3c","private":false,"scripts":{"test":"npx tsc --project tsconfig.test.json && node --test \"dist/test/**/*.test.js\"","build":"npx tsc --project tsconfig.build.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:929f09b8-272e-4715-8181-642984fe13a3"}},"repository":{"url":"git+https://github.com/ALARIFE-PROYECT/alarife-commander.git","type":"git"},"_npmVersion":"11.11.0","description":"Command line interface tool for Alarife.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"tslib":"~2.8","commander":"~14.0"},"typesVersions":{"*":{".":["./lib/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"typescript":"~6.0","@types/node":"~24"},"_npmOperationalInternal":{"tmp":"tmp/commander_0.5.0_1775901209641_0.42699703317699567","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@alarife/commander","version":"0.6.0","keywords":["alarife"],"author":{"name":"Soria Garcia, Jose Eduardo","email":"alarifeproyect@gmail.com"},"license":"Apache-2.0","_id":"@alarife/commander@0.6.0","maintainers":[{"name":"jesoria","email":"pepesoriagarcia99@gmail.com"}],"homepage":"https://github.com/ALARIFE-PROYECT/alarife-commander#readme","bugs":{"url":"https://github.com/ALARIFE-PROYECT/alarife-commander/issues"},"dist":{"shasum":"1b1722bd5b41437b9e2a73cae4a332b9034f5cf4","tarball":"https://registry.npmjs.org/@alarife/commander/-/commander-0.6.0.tgz","fileCount":17,"integrity":"sha512-q1FjiB+QjVROKeORwJDPRyzGLndR4pm997y18II7FTk0ihPI+mghYdlonwla+XAEgcSkFra4vSHP3Sf4xQPIyQ==","signatures":[{"sig":"MEYCIQDXElMc9vrlaS3S4JM5eQQtHZj8+UAJak7zwYOP+wLZ2wIhAOgVRuyLWDluDmUOKtSZsiN1czMBhFRsBPomcAobizf+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alarife%2fcommander@0.6.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":29076},"main":"./lib/index.js","type":"commonjs","types":"./lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/index.js"}},"gitHead":"1b4343a5da28c60312a887401a77f062e7ca5f34","private":false,"scripts":{"test":"npx tsc --project tsconfig.test.json && node --test \"dist/test/**/*.test.js\"","build":"npx tsc --project tsconfig.build.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:929f09b8-272e-4715-8181-642984fe13a3"}},"repository":{"url":"git+https://github.com/ALARIFE-PROYECT/alarife-commander.git","type":"git"},"_npmVersion":"11.11.0","description":"Command line interface tool for Alarife.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"tslib":"~2.8","commander":"~14.0"},"typesVersions":{"*":{".":["./lib/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"typescript":"~6.0","@types/node":"~24"},"_npmOperationalInternal":{"tmp":"tmp/commander_0.6.0_1775901591326_0.6736862279680869","host":"s3://npm-registry-packages-npm-production"}},"0.8.0":{"name":"@alarife/commander","description":"Command line interface tool for Alarife.","version":"0.8.0","author":{"name":"Soria Garcia, Jose Eduardo","email":"alarifeproyect@gmail.com"},"license":"Apache-2.0","private":false,"type":"commonjs","main":"./lib/index.js","types":"./lib/index.d.ts","exports":{".":{"import":"./lib/index.js","require":"./lib/index.js","types":"./lib/index.d.ts"}},"typesVersions":{"*":{".":["./lib/index.d.ts"]}},"keywords":["alarife"],"repository":{"type":"git","url":"git+https://github.com/ALARIFE-PROYECT/alarife-commander.git"},"homepage":"https://github.com/ALARIFE-PROYECT/alarife-commander#readme","bugs":{"url":"https://github.com/ALARIFE-PROYECT/alarife-commander/issues"},"scripts":{"build":"npx tsc --project tsconfig.build.json","test":"npx tsc --project tsconfig.test.json && node --test \"dist/test/**/*.test.js\""},"dependencies":{"commander":"~14.0","tslib":"~2.8"},"devDependencies":{"@types/node":"~24","typescript":"~6.0"},"gitHead":"edcc11ad993ce7db13231f9a2260632deb88e848","_id":"@alarife/commander@0.8.0","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-/L/PvbdqqVc7Ni3VD8x7rrTp3CoMQywsOwnOUvSXsK729BDLVt/ThBonfJ/LswN3JJXdpoEr44mYRZ3bHolfIA==","shasum":"e656463d4bf0979f45b52b168b4f4d6f31318492","tarball":"https://registry.npmjs.org/@alarife/commander/-/commander-0.8.0.tgz","fileCount":17,"unpackedSize":31438,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alarife%2fcommander@0.8.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIACe0OJDVCKMlHB50Jv1VIyRCSa76P69tJNlm+8Dw2+qAiAT3TQRfuMmlhJPUu1pozQUCS/K4YJJkptuDiY1dZL7CA=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:929f09b8-272e-4715-8181-642984fe13a3"}},"directories":{},"maintainers":[{"name":"jesoria","email":"pepesoriagarcia99@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/commander_0.8.0_1781439626864_0.8670616026198072"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-09T06:35:02.877Z","modified":"2026-06-14T12:20:27.307Z","0.1.0":"2026-04-09T06:35:03.085Z","0.2.0":"2026-04-09T06:40:21.260Z","0.3.0":"2026-04-09T07:25:40.671Z","0.4.0":"2026-04-09T13:29:17.030Z","0.5.0":"2026-04-11T09:53:29.791Z","0.6.0":"2026-04-11T09:59:51.480Z","0.8.0":"2026-06-14T12:20:27.003Z"},"bugs":{"url":"https://github.com/ALARIFE-PROYECT/alarife-commander/issues"},"author":{"name":"Soria Garcia, Jose Eduardo","email":"alarifeproyect@gmail.com"},"license":"Apache-2.0","homepage":"https://github.com/ALARIFE-PROYECT/alarife-commander#readme","keywords":["alarife"],"repository":{"type":"git","url":"git+https://github.com/ALARIFE-PROYECT/alarife-commander.git"},"description":"Command line interface tool for Alarife.","maintainers":[{"name":"jesoria","email":"pepesoriagarcia99@gmail.com"}],"readme":"# @alarife/commander - Tool for command management in Alarife.\n\n<div align=\"center\">\n\n[![NPM Version](https://img.shields.io/badge/version-0.3.0-blue.svg)](https://www.npmjs.com/package/@alarife/commander)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue.svg)](https://www.typescriptlang.org/)\n\n**This tool is a command-line implementation of commander.**\n\n</div>\n\n## 📋 Table of Contents\n\n- [Installation](#-installation)\n- [Basic Usage](#-basic-usage)\n- [Detailed API](#-detailed-api)\n- [License](#-license)\n\n## 🚀 Installation\n\n```bash\nnpm install @alarife/commander --save-dev\n```\n\n## 📦 Basic Usage\n\n### Defining a command\n\n```typescript\nimport { ProgramLineInterface, Command } from '@alarife/commander';\n\nconst greet: Command = {\n  name: 'greet',\n  description: 'Greet a user by name',\n  action: (event) => {\n    const [name] = event.args;\n    console.log(`Hello, ${name}!`);\n  },\n  arguments: [\n    {\n      descriptiveType: 'name',\n      description: 'Name of the user to greet',\n      required: true,\n    },\n  ],\n};\n\nconst program = new ProgramLineInterface([greet]);\nprogram.parse(process.argv, 'node');\n```\n\n```bash\nnode app.js greet World\n# Hello, World!\n```\n\n### Adding options\n\n```typescript\nconst build: Command = {\n  name: 'build',\n  description: 'Build the project',\n  action: (event) => {\n    console.log(event.options);       // { outDir: 'dist', minify: true }\n    console.log(event.configOptions); // { 'out-dir': 'dist', minify: true }\n  },\n  options: [\n    {\n      name: 'out-dir',\n      shortName: 'o',\n      descriptiveType: 'path',\n      description: 'Output directory',\n      defaultValue: 'dist',\n    },\n    {\n      name: 'minify',\n      shortName: 'm',\n      description: 'Minify the output',\n    },\n  ],\n};\n```\n\n```bash\nnode app.js build --out-dir lib --minify\n```\n\n### Negatable flags (`--no-*`)\n\nWhen an option name starts with `no-`, commander exposes the value in `options` using camelCase **without** the `no-` prefix and inverts the boolean. `configOptions` preserves the literal name and inverts the value back, so the key always represents *\"the `--no-xxx` flag was activated\"*.\n\n```typescript\nconst build: Command = {\n  name: 'build',\n  options: [\n    { name: 'no-banner' },\n  ],\n  action: (event) => {\n    // Running: node app.js build --no-banner\n    console.log(event.options.banner);              // false\n    console.log(event.configOptions['no-banner']);  // true\n\n    // Running: node app.js build\n    console.log(event.options.banner);              // true\n    console.log(event.configOptions['no-banner']);  // false\n  },\n};\n```\n\n### Using environment variables\n\nYou can bind an option to an environment variable using the `env` property. If the option is not provided via the command line, the value is read from the specified environment variable. If the variable is not defined either, `defaultValue` is used as a fallback.\n\n```typescript\nconst deploy: Command = {\n  name: 'deploy',\n  description: 'Deploy the application',\n  action: (event) => {\n    console.log(event.options); // { token: '<value from CLI, env, or default>' }\n  },\n  options: [\n    {\n      name: 'token',\n      shortName: 't',\n      descriptiveType: 'string',\n      description: 'Authentication token',\n      env: 'DEPLOY_TOKEN',\n      defaultValue: 'default-token',\n    },\n  ],\n};\n```\n\n```bash\n# Value from CLI\nnode app.js deploy --token my-secret\n\n# Value from environment variable\nDEPLOY_TOKEN=my-secret node app.js deploy\n\n# Falls back to defaultValue when neither is provided\nnode app.js deploy\n```\n\n### Adding arguments and options dynamically\n\n`addArgument` and `addOption` accept one or more items at once, so you can register multiple arguments or options in a single call.\n\n```typescript\nconst program = new ProgramLineInterface([{ name: 'copy' }]);\n\nprogram.addArgument('copy',\n  { descriptiveType: 'source', required: true },\n  { descriptiveType: 'target', required: true },\n);\n\nprogram.addOption('copy',\n  { name: 'recursive', shortName: 'r', description: 'Copy recursively' },\n  { name: 'force', shortName: 'f', description: 'Overwrite existing files' },\n);\n```\n\n### Using an external handler\n\n```typescript\nconst copy: Command = {\n  name: 'copy',\n  description: 'Copy files from source to target',\n  path: './handlers/copy.js',\n  arguments: [\n    { descriptiveType: 'source', required: true },\n    { descriptiveType: 'target', required: true },\n  ],\n};\n```\n\n```typescript\n// handlers/copy.ts\nimport { CommandEvent, Command } from '@alarife/commander';\n\nexport default (event: CommandEvent) => {\n  const [source, target] = event.args;\n  // copy logic...\n};\n```\n\n## 📖 Detailed API\n\n### `ProgramLineInterface`\n\nMain entry point. Creates a CLI program and registers commands.\n\n```typescript\nconst program = new ProgramLineInterface(commands?: Command[], version?: Version);\n```\n\n| Method | Description |\n|---|---|\n| `addCommand(command: Command)` | Register a new command. |\n| `addArgument(commandName: string, ...arguments: Argument[])` | Add one or more positional arguments to an existing command. |\n| `addOption(commandName: string, ...options: Option[])` | Add one or more options to an existing command. |\n| `parse(args: string[], from?: ParserFrom)` | Parse arguments and execute the matched command. Returns `CommandEvent`. |\n\n`ParserFrom` can be `'node'`, `'electron'`, or `'user'` (default).\n\n---\n\n### `Command`\n\nDeclarative configuration object for a CLI command.\n\n| Property | Type | Required | Description |\n|---|---|---|---|\n| `name` | `string` | ✅ | Command name used in the terminal. |\n| `description` | `string` | | Help text for the command. |\n| `version` | `Version` | | Command-specific version. |\n| `path` | `string` | | Path to a `.js` handler file. |\n| `action` | `(event, command, config) => void` | | Inline handler function. See signature below. |\n| `arguments` | `Argument[]` | | Positional arguments. |\n| `options` | `Option[]` | | Named options / flags. |\n\n**`action` signature:**\n\n```typescript\n(event: CommandEvent, command: CommanderCommand, commandConfig: Command) => void\n```\n\n> Both `action` and `path` can coexist — both will execute.\n\n---\n\n### `Argument`\n\nPositional argument for a command.\n\n| Property | Type | Required | Description |\n|---|---|---|---|\n| `descriptiveType` | `string` | ✅ | Display name shown in help (e.g. `path`, `source`). |\n| `description` | `string` | | Help text. |\n| `required` | `boolean` | | Wraps in `<name>` when true, `[name]` when false. |\n| `variadic` | `boolean` | | Accept multiple values (`<name...>`). |\n| `choices` | `string[]` | | Restrict to a set of allowed values. |\n| `defaultValue` | `any` | | Default value when not provided. |\n\n---\n\n### `Option`\n\nNamed flag for a command.\n\n| Property | Type | Required | Description |\n|---|---|---|---|\n| `name` | `string` | | Long flag name (e.g. `extensions` → `--extensions`). Prefix with `no-` to declare a negatable boolean flag. |\n| `shortName` | `string` | | Short flag alias (e.g. `ex` → `-ex`). |\n| `descriptiveType` | `string` | | Type label shown in help. |\n| `description` | `string` | | Help text. |\n| `required` | `boolean` | | Mark the option as mandatory. |\n| `variadic` | `boolean` | | Accept multiple values. |\n| `choices` | `string[]` | | Restrict to allowed values. |\n| `defaultValue` | `any` | | Default value. |\n| `hideHelp` | `boolean` | | Hide from auto-generated help. |\n| `conflicts` | `string[]` | | Mutually exclusive options. |\n| `implies` | `Record<string, any>` | | Set other options when this one is used. |\n| `hook` | `(value, previous) => any` | | Transform the parsed value. |\n| `env` | `string` | | Environment variable name. If set and the option is not provided, the value is read from this variable. Falls back to `defaultValue` if the variable is not defined. |\n\n> Option names are converted to **camelCase** in `event.options` (e.g. `--project-name` → `options.projectName`) and kept as-is in `event.configOptions` (e.g. `configOptions['project-name']`).\n\n---\n\n### `CommanderCommand`\n\nType alias for the underlying `commander.Command` instance. Passed as the second parameter to `action` and external handlers.\n\n```typescript\ntype CommanderCommand = commander.Command;\n```\n\n---\n\n### `CommandEvent`\n\nReturned by `parse()` and passed to handlers.\n\n```typescript\ninterface CommandEvent {\n  args: any[];                         // Positional arguments in order\n  options: Record<string, any>;        // Parsed options (camelCase keys, as resolved by commander)\n  configOptions: Record<string, any>;  // Parsed options keyed by the literal `name` declared in the config\n}\n```\n\n| Field | Key format | Notes |\n|---|---|---|\n| `options` | `camelCase` | Value as produced by commander. For `--no-xxx` flags the key is `xxx` and the boolean is **not** inverted (commander stores `false` when the flag is passed). |\n| `configOptions` | Literal `name` from the config (e.g. `'out-dir'`, `'no-banner'`) | Value copied as-is for all types. For `--no-xxx` boolean flags the value is inverted so the key represents *\"the flag was activated\"*. Options without a `name` are omitted. |\n\n---\n\n### `ParserFrom`\n\nSpecifies how the argument array should be parsed depending on the runtime.\n\n```typescript\ntype ParserFrom = 'node' | 'electron' | 'user';\n```\n\n| Value | Description |\n|---|---|\n| `'node'` | Strips the first two elements (`node` and script path). |\n| `'electron'` | Strips Electron-specific prefix arguments. |\n| `'user'` | Uses the arguments as-is (default). |\n\n---\n\n### `Version`\n\nCan be a plain string or a configuration object.\n\n```typescript\n// Simple\nconst program = new ProgramLineInterface([], '1.0.0');\n\n// Detailed\nconst program = new ProgramLineInterface([], {\n  version: '1.0.0',\n  name: 'version',\n  shortName: 'v',\n  description: 'Show the current version',\n});\n```\n\n## 📄 License\n\nThis project is licensed under Apache-2.0. See the [LICENSE](./LICENSE) file for details.\n\n---\n\n<div align=\"center\">\n\n**Built with ❤️ by [Jose Eduardo Soria Garcia](mailto:alarifeproyect@gmail.com)**\n\n<sub>🌍 Product developed in Andalucia, España 🇪🇸</sub>\n\n*Part of the Alarife ecosystem*\n\n</div>\n\n","readmeFilename":"README.md"}