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>
36 lines
726 B
TypeScript
36 lines
726 B
TypeScript
import { loadConfig, ConfigError } from "../src/lib/config/load";
|
|
|
|
const configPathArg = process.argv[2];
|
|
|
|
try {
|
|
const { config, configPath } = loadConfig(configPathArg);
|
|
console.log(
|
|
JSON.stringify({
|
|
ok: true,
|
|
configPath,
|
|
scriptCount: config.scripts.length,
|
|
authEnabled: config.auth.enabled,
|
|
}),
|
|
);
|
|
process.exit(0);
|
|
} catch (error) {
|
|
if (error instanceof ConfigError) {
|
|
console.log(
|
|
JSON.stringify({
|
|
ok: false,
|
|
message: error.message,
|
|
issues: error.issues,
|
|
}),
|
|
);
|
|
} else {
|
|
console.log(
|
|
JSON.stringify({
|
|
ok: false,
|
|
message: (error as Error).message,
|
|
issues: [],
|
|
}),
|
|
);
|
|
}
|
|
process.exit(1);
|
|
}
|