@dataroadinc/setup-auth
Version:
CLI tool and programmatic API for automated OAuth setup across cloud platforms
24 lines (23 loc) • 865 B
JavaScript
import { gcpSetupServiceAccount } from "./setup.js";
export async function addCommandGcpSetupServiceAccount(program) {
program
.command("gcp-setup-service-account")
.description("[ADMIN ONLY] One-time setup: Creates service account, IAM roles, and OAuth consent screen for automation infrastructure")
.action(async function _action() {
const options = {
...this.optsWithGlobals(),
};
try {
await gcpSetupServiceAccount(options);
}
catch (error) {
if (error instanceof Error) {
console.error("\n❌ Error during setup-service-account:\n" + error.toString());
}
else {
console.error("\n❌ Unknown error during setup-service-account:", error);
}
process.exit(1);
}
});
}