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.
Files changed (2) hide show
  1. package/cli.js +44 -27
  2. 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
- const key = await ask(rl, ' Enter your Anthropic API key (or press Enter to skip): ')
77
- if (key) {
78
- config.apiKey = key
79
- console.log(chalk.green(' API key saved.\n'))
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, ' Your full name: ')
87
+ const name = await ask(rl, ' Developer name: ')
88
88
  if (name) config.developerName = name
89
89
 
90
- const company = await ask(rl, ' Your company name (press Enter if not applicable): ')
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, ' Your email address: ')
93
+ const email = await ask(rl, ' Email address: ')
94
94
  if (email) config.developerEmail = email
95
95
 
96
- const phone = await ask(rl, ' Your phone number (optional, press Enter to skip): ')
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
- console.log(chalk.bold('\n Generating Technical Handover Document...'))
127
- const techPrompt = technicalHandoverPrompt(projectInfo, developerInfo)
128
- await generateDoc(techPrompt, 'technical-handover', techDir)
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
- console.log(chalk.bold('\n Generating Client Handover Document...'))
131
- const nonTechPrompt = nonTechnicalHandoverPrompt(projectInfo, developerInfo)
132
- await generateDoc(nonTechPrompt, 'handover', clientDir)
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
- console.log(` ${chalk.cyan('./technical-handover/')}`)
136
- console.log(` technical-handover.md`)
137
- console.log(` technical-handover.txt`)
138
- console.log(` technical-handover.docx`)
139
- console.log()
140
- console.log(` ${chalk.cyan('./handover/')}`)
141
- console.log(` handover.md`)
142
- console.log(` handover.txt`)
143
- console.log(` handover.docx`)
144
- console.log()
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() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "client-handover",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "AI-powered handover document generator for frontend developers handing off client websites",
5
5
  "type": "module",
6
6
  "bin": {