clawdie-ai/scripts/set-operator.ts
Operator & Codex 2ab3fa050a refactor(setup): unify operator auth entrypoints
---
Build: pass | Tests: pass — Tests  1991 passed (1991)
2026-04-27 08:13:36 +02:00

29 lines
740 B
TypeScript

#!/usr/bin/env npx tsx
/**
* scripts/set-operator.ts — operator-facing wrapper around the shared
* operator-auth setup flow.
*
* Usage:
* npm run set-operator -- <email>
*/
import { run as runOperatorAuth } from '../setup/operator-auth.js';
function fail(message: string, code = 1): never {
process.stderr.write(`set-operator: ${message}\n`);
process.exit(code);
}
async function main(): Promise<void> {
const email = process.argv[2]?.trim();
if (!email) {
fail('missing email argument. Usage: npm run set-operator -- <email>', 2);
}
await runOperatorAuth(['--email', email]);
}
main().catch((error: unknown) => {
const message = error instanceof Error ? error.message : String(error);
fail(message);
});