client-handover 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +44 -27
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -73,27 +73,27 @@ async function runSetup() {
|
|
|
73
73
|
if (!hasApiKey) {
|
|
74
74
|
console.log(' To generate documents you need an Anthropic API key.')
|
|
75
75
|
console.log(chalk.dim(' Get one free at: https://console.anthropic.com\n'))
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
console.log(chalk.
|
|
80
|
-
} else {
|
|
81
|
-
console.log(chalk.dim(' Skipped. Run "handover key <your-api-key>" at any time.\n'))
|
|
76
|
+
let key = ''
|
|
77
|
+
while (!key) {
|
|
78
|
+
key = await ask(rl, ' Enter your Anthropic API key: ')
|
|
79
|
+
if (!key) console.log(chalk.yellow(' API key is required to continue.\n'))
|
|
82
80
|
}
|
|
81
|
+
config.apiKey = key
|
|
82
|
+
console.log(chalk.green(' ✓ API key saved.\n'))
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
if (!hasDeveloperInfo) {
|
|
86
86
|
console.log(' Your details will appear in all generated handover documents.\n')
|
|
87
|
-
const name = await ask(rl, '
|
|
87
|
+
const name = await ask(rl, ' Developer name: ')
|
|
88
88
|
if (name) config.developerName = name
|
|
89
89
|
|
|
90
|
-
const company = await ask(rl, '
|
|
90
|
+
const company = await ask(rl, ' Company name (press Enter if not applicable): ')
|
|
91
91
|
if (company) config.developerCompany = company
|
|
92
92
|
|
|
93
|
-
const email = await ask(rl, '
|
|
93
|
+
const email = await ask(rl, ' Email address: ')
|
|
94
94
|
if (email) config.developerEmail = email
|
|
95
95
|
|
|
96
|
-
const phone = await ask(rl, '
|
|
96
|
+
const phone = await ask(rl, ' Phone number (optional, press Enter to skip): ')
|
|
97
97
|
if (phone) config.developerPhone = phone
|
|
98
98
|
|
|
99
99
|
console.log()
|
|
@@ -117,31 +117,48 @@ async function runCreate() {
|
|
|
117
117
|
printBanner()
|
|
118
118
|
const developerInfo = await runSetup()
|
|
119
119
|
|
|
120
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout })
|
|
121
|
+
let docType = ''
|
|
122
|
+
while (!['1', '2', '3'].includes(docType)) {
|
|
123
|
+
docType = await ask(rl, ' What would you like to generate?\n 1 - Technical handover\n 2 - Non-technical handover\n 3 - Both\n\n Enter 1, 2 or 3: ')
|
|
124
|
+
if (!['1', '2', '3'].includes(docType)) console.log(chalk.yellow('\n Please enter 1, 2 or 3.\n'))
|
|
125
|
+
}
|
|
126
|
+
rl.close()
|
|
127
|
+
console.log()
|
|
128
|
+
|
|
120
129
|
console.log(chalk.dim(' Scanning project files...'))
|
|
121
130
|
const projectInfo = scanProject(process.cwd())
|
|
122
131
|
|
|
123
132
|
const techDir = './technical-handover'
|
|
124
|
-
const clientDir = './handover'
|
|
133
|
+
const clientDir = './client-handover'
|
|
125
134
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
135
|
+
if (docType === '1' || docType === '3') {
|
|
136
|
+
console.log(chalk.bold('\n Generating Technical Handover Document...'))
|
|
137
|
+
const techPrompt = technicalHandoverPrompt(projectInfo, developerInfo)
|
|
138
|
+
await generateDoc(techPrompt, 'technical-handover', techDir)
|
|
139
|
+
}
|
|
129
140
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
141
|
+
if (docType === '2' || docType === '3') {
|
|
142
|
+
console.log(chalk.bold('\n Generating Client Handover Document...'))
|
|
143
|
+
const nonTechPrompt = nonTechnicalHandoverPrompt(projectInfo, developerInfo)
|
|
144
|
+
await generateDoc(nonTechPrompt, 'client-handover', clientDir)
|
|
145
|
+
}
|
|
133
146
|
|
|
134
147
|
console.log(chalk.green.bold('\n ✅ Handover documents created successfully!\n'))
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
148
|
+
if (docType === '1' || docType === '3') {
|
|
149
|
+
console.log(` ${chalk.cyan('./technical-handover/')}`)
|
|
150
|
+
console.log(` technical-handover.md`)
|
|
151
|
+
console.log(` technical-handover.txt`)
|
|
152
|
+
console.log(` technical-handover.docx`)
|
|
153
|
+
console.log()
|
|
154
|
+
}
|
|
155
|
+
if (docType === '2' || docType === '3') {
|
|
156
|
+
console.log(` ${chalk.cyan('./client-handover/')}`)
|
|
157
|
+
console.log(` client-handover.md`)
|
|
158
|
+
console.log(` client-handover.txt`)
|
|
159
|
+
console.log(` client-handover.docx`)
|
|
160
|
+
console.log()
|
|
161
|
+
}
|
|
145
162
|
}
|
|
146
163
|
|
|
147
164
|
async function main() {
|