A Python CLI (typer) that bootstraps Node/pnpm and launches a Next.js 16 web app for running configured shell scripts: YAML config validated by a shared Zod schema, dynamic per-script forms mapped to shadcn controls, argv-safe execa execution with live WebSocket streaming, SQLite/Drizzle run history, and optional argon2 session + API token auth. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
18 lines
530 B
JavaScript
18 lines
530 B
JavaScript
#!/usr/bin/env node
|
|
const args = process.argv.slice(2);
|
|
|
|
function getArg(name) {
|
|
const index = args.indexOf(name);
|
|
return index === -1 ? undefined : args[index + 1];
|
|
}
|
|
|
|
const targetDir = getArg("--dir");
|
|
const olderThanDays = getArg("--days");
|
|
const types = getArg("--types");
|
|
|
|
console.log(`Scanning ${targetDir} for files older than ${olderThanDays} days (types: ${types})`);
|
|
if (process.env.CLEANUP_API_KEY) {
|
|
console.log("Using configured external API key.");
|
|
}
|
|
console.log("No matching files found. Cleanup complete.");
|