Skip to content

Commit 814fbf4

Browse files
committed
Add onboarding CLI wizard sample code for #72
1 parent 2f35a13 commit 814fbf4

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

src/onboarding/onboardingWizard.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import inquirer from "inquirer";
2+
import { execSync } from "child_process";
3+
4+
export async function runOnboardingWizard() {
5+
console.log("Welcome to Cloud Health Office CLI Onboarding!");
6+
7+
const responses = await inquirer.prompt([
8+
{
9+
type: "input",
10+
name: "companyName",
11+
message: "Enter your company name:",
12+
validate: (input) => input.trim().length > 0
13+
},
14+
{
15+
type: "input",
16+
name: "contactEmail",
17+
message: "Enter your contact email:",
18+
validate: (input) =>
19+
/^\S+@\S+\.\S+$/.test(input.trim()) || "Please enter a valid email."
20+
},
21+
{
22+
type: "confirm",
23+
name: "azureSandbox",
24+
message: "Would you like to deploy a pre-configured Azure sandbox?",
25+
default: true
26+
}
27+
]);
28+
29+
try {
30+
if (responses.azureSandbox) {
31+
console.log("Deploying Azure sandbox...");
32+
// Simulate Azure deployment
33+
execSync("echo Deploying Azure... (stub)", { stdio: "inherit" });
34+
// Replace with Azure CLI or Bicep script, etc.
35+
}
36+
console.log("Company registered:", responses.companyName);
37+
console.log("Contact email:", responses.contactEmail);
38+
// Extend: Simulate 837 claim generation, add PHI redaction in logs, etc.
39+
console.log("Onboarding complete! See docs at: https://github.com/aurelianware/cloudhealthoffice/wiki/Onboarding");
40+
} catch (err) {
41+
console.error("Error during onboarding:", err);
42+
console.error("Please check your Azure credentials or visit docs for troubleshooting.");
43+
}
44+
}
45+
46+
if (require.main === module) {
47+
runOnboardingWizard();
48+
}

0 commit comments

Comments
 (0)