prompt-helper
Version:
A CLI tool to help you create and manage prompts for AI models.
34 lines • 1.61 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getOptions = getOptions;
// src/options.ts
const commander_1 = require("commander");
const getPackageVersion_1 = require("./libs/getPackageVersion");
function collectPathArray(value, previous) {
return previous.concat([value]);
}
/**
* Parses command-line arguments using Commander and returns structured options.
*
* @returns CLI flags parsed into a structured options object.
*/
function getOptions() {
const program = new commander_1.Command();
const projectVersion = (0, getPackageVersion_1.getPackageVersion)();
program
.name('prompt-helper')
.description('Generate a promptHelper markdown summary of your project')
.version(projectVersion)
.option('-d, --dir <path>', 'base directory to scan', process.cwd())
.option('-o, --out <file>', 'output markdown filename', 'promptHelper.md')
.option('-s, --style <path>', 'path to style markdown file')
.option('-c, --code <path>', 'path to code file or directory to include', collectPathArray, [])
.option('-i, --ignore <pattern>', 'glob pattern of files/directories to ignore from --code', collectPathArray, [])
.option('--todos', 'scan for TODO and FIXME comments')
.option('--complexity', 'append complexity & metrics report')
.option('--dependency-graph', 'include a JSON dependency graph')
.option('--json', 'also emit a `.json` manifest alongside the markdown')
.parse(process.argv);
return program.opts();
}
//# sourceMappingURL=options.js.map