@vitaeflow/sdk-js
Version:
Official JavaScript/TypeScript SDK for VitaeFlow - Embed and extract structured resume data from PDFs
59 lines (49 loc) • 1.81 kB
JavaScript
const { program } = require('commander');
const chalk = require('chalk');
const { version } = require('../package.json');
// Import commands
const embedCommand = require('./commands/embed');
const extractCommand = require('./commands/extract');
const validateCommand = require('./commands/validate');
const checkCommand = require('./commands/check');
// ASCII Art Logo
console.log(chalk.cyan(`
╦ ╦╦╔╦╗╔═╗╔═╗╔═╗╦ ╔═╗╦ ╦
╚╗╔╝║ ║ ╠═╣║╣ ╠╣ ║ ║ ║║║║
╚╝ ╩ ╩ ╩ ╩╚═╝╚ ╩═╝╚═╝╚╩╝
`));
console.log(chalk.gray(`Version ${version}\n`));
// Setup CLI
program
.name('vitaeflow')
.description('VitaeFlow CLI - Embed and extract structured resume data from PDFs')
.version(version);
// Add commands
program
.command('embed <pdf> <json>')
.description('Embed JSON data into a PDF')
.option('-o, --output <file>', 'Output file (default: input-vitaeflow.pdf)')
.option('-c, --no-compress', 'Disable compression')
.action(embedCommand);
program
.command('extract <pdf>')
.description('Extract VitaeFlow data from a PDF')
.option('-o, --output <file>', 'Output file (default: stdout)')
.option('-p, --pretty', 'Pretty print JSON')
.action(extractCommand);
program
.command('validate <json>')
.description('Validate JSON against VitaeFlow schema')
.option('-v, --version <version>', 'Schema version', '0.1.0')
.action(validateCommand);
program
.command('check <pdf>')
.description('Check if a PDF contains VitaeFlow data')
.action(checkCommand);
// Parse arguments
program.parse(process.argv);
// Show help if no command
if (!process.argv.slice(2).length) {
program.outputHelp();
}