client-handover 1.0.0 → 1.0.2

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 (3) hide show
  1. package/README.md +125 -36
  2. package/cli.js +64 -18
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,9 +1,11 @@
1
- # handover-cli
1
+ # client-handover
2
2
 
3
3
  AI-powered handover document generator for frontend developers handing off websites to clients.
4
4
 
5
5
  Run one command. Get a professional handover document in Markdown, plain text, and HTML — written for both your client and the next developer.
6
6
 
7
+ Uses the [Claude API](https://console.anthropic.com) (Anthropic) under the hood.
8
+
7
9
  ---
8
10
 
9
11
  ## Install
@@ -12,37 +14,51 @@ Run one command. Get a professional handover document in Markdown, plain text, a
12
14
  npm install -g client-handover
13
15
  ```
14
16
 
15
- Set your Anthropic API key:
17
+ Then set your Anthropic API key as an environment variable:
16
18
 
17
19
  ```bash
20
+ # macOS / Linux
18
21
  export ANTHROPIC_API_KEY=your_key_here
22
+
23
+ # Windows (Command Prompt)
24
+ set ANTHROPIC_API_KEY=your_key_here
25
+
26
+ # Windows (PowerShell)
27
+ $env:ANTHROPIC_API_KEY="your_key_here"
19
28
  ```
20
29
 
21
30
  Get a free API key at [console.anthropic.com](https://console.anthropic.com)
22
31
 
23
32
  ---
24
33
 
34
+ ## Quick start
35
+
36
+ ```bash
37
+ handover handover
38
+ ```
39
+
40
+ This generates a full handover document with placeholder content in an `output/` folder in your current directory.
41
+
42
+ ---
43
+
25
44
  ## Commands
26
45
 
27
46
  | Command | Description |
28
47
  |---------|-------------|
29
- | `/handover` | Full handover document (all sections) |
30
- | `/setup` | Project setup & dependencies |
31
- | `/deploy` | Deployment & hosting info |
32
- | `/credentials` | Logins & API keys template |
33
- | `/license` | Licensing & attribution |
48
+ | `all` | Every section as separate files in one folder |
49
+ | `handover` | Full handover document (all sections combined) |
50
+ | `setup` | Project setup & dependencies |
51
+ | `deploy` | Deployment & hosting info |
52
+ | `credentials` | Logins & API keys template |
53
+ | `license` | Licensing & attribution |
34
54
 
35
55
  ---
36
56
 
37
57
  ## Usage
38
58
 
39
- ### Quick start (placeholder content)
40
- ```bash
41
- handover /handover
42
- ```
59
+ ### With your own project notes
43
60
 
44
- ### With your project notes
45
- Create a plain text file with your project details:
61
+ Create a plain text file describing your project:
46
62
 
47
63
  ```
48
64
  project-info.txt
@@ -58,54 +74,127 @@ Analytics: Google Analytics 4
58
74
  APIs: Mailchimp (newsletter), Stripe (payments)
59
75
  ```
60
76
 
61
- Then run:
77
+ Then run any command with that file as input:
78
+
62
79
  ```bash
63
- handover /handover project-info.txt acme-handover
64
- ```
80
+ # Every section as separate files in one folder
81
+ handover all project-info.txt acme-client
65
82
 
66
- This generates:
67
- ```
68
- output/
69
- ├── acme-handover.md
70
- ├── acme-handover.txt
71
- └── acme-handover.html
72
- ```
83
+ # Full combined doc
84
+ handover handover project-info.txt
73
85
 
74
- ### Individual sections
75
- ```bash
76
- handover /setup project-info.txt
77
- handover /deploy project-info.txt
78
- handover /credentials project-info.txt
79
- handover /license project-info.txt
86
+ # Full combined doc with a custom output filename
87
+ handover handover project-info.txt acme-handover
88
+
89
+ # Individual sections
90
+ handover setup project-info.txt
91
+ handover deploy project-info.txt
92
+ handover credentials project-info.txt
93
+ handover license project-info.txt
80
94
  ```
81
95
 
96
+ The more detail you put in your project-info file, the more accurate and useful the output will be.
97
+
82
98
  ---
83
99
 
84
- ## Output formats
100
+ ## Output
85
101
 
86
- All commands produce three files:
102
+ All commands generate three files per section inside an `output/` folder.
87
103
 
88
- - **`.md`** Markdown, ready to paste into Notion, GitHub, or a README
89
- - **`.txt`** — Plain text, clean for email or printing
90
- - **`.html`** — Styled HTML, ready to send directly to a client
104
+ **Single command** (e.g. `handover`):
105
+ ```
106
+ output/
107
+ ├── handover.md ← Paste into Notion, GitHub, or a README
108
+ ├── handover.txt ← Clean plain text for email or printing
109
+ └── handover.html ← Styled HTML ready to send directly to a client
110
+ ```
111
+
112
+ **`all` command** — every section in its own subfolder:
113
+ ```
114
+ output/acme-client/
115
+ ├── handover.md / .txt / .html
116
+ ├── setup.md / .txt / .html
117
+ ├── deploy.md / .txt / .html
118
+ ├── credentials.md / .txt / .html
119
+ └── license.md / .txt / .html
120
+ ```
121
+
122
+ | Format | Best for |
123
+ |--------|----------|
124
+ | `.md` | Notion, GitHub, linear docs |
125
+ | `.txt` | Email attachments, printing |
126
+ | `.html`| Sending directly to a client |
91
127
 
92
128
  ---
93
129
 
94
130
  ## Use as a library
95
131
 
132
+ You can also import the prompt builders and doc generator directly into your own project:
133
+
96
134
  ```js
97
135
  import { handover, setup, generateDoc } from 'client-handover'
98
136
 
99
- const prompt = handover('Vue 3 project hosted on Vercel...')
137
+ // Build a prompt from your project info string
138
+ const prompt = handover('Vue 3 project hosted on Vercel, domain on Cloudflare...')
139
+
140
+ // Generate and save the document
100
141
  await generateDoc(prompt, 'my-client', './docs')
101
142
  ```
102
143
 
144
+ ### Available exports
145
+
146
+ | Export | Type | Description |
147
+ |--------|------|-------------|
148
+ | `generateDoc(prompt, name, dir)` | async function | Calls Claude API and writes `.md`, `.txt`, `.html` |
149
+ | `handover(projectInfo)` | function | Prompt builder for full handover doc |
150
+ | `setup(projectInfo)` | function | Prompt builder for setup section |
151
+ | `deploy(projectInfo)` | function | Prompt builder for deployment section |
152
+ | `credentials(projectInfo)` | function | Prompt builder for credentials section |
153
+ | `license(projectInfo)` | function | Prompt builder for licensing section |
154
+
155
+ All prompt builders accept an optional `projectInfo` string. If omitted, Claude generates placeholder content.
156
+
103
157
  ---
104
158
 
105
159
  ## Requirements
106
160
 
107
161
  - Node.js 18+
108
- - An [Anthropic API key](https://console.anthropic.com) (free tier available)
162
+ - An Anthropic API key — [get one free at console.anthropic.com](https://console.anthropic.com)
163
+
164
+ ---
165
+
166
+ ## How it works
167
+
168
+ 1. You provide a plain text description of your project (or nothing, for placeholder output)
169
+ 2. The CLI builds a structured prompt for Claude
170
+ 3. Claude generates a professional, dual-audience document (plain English for clients, technical detail for developers)
171
+ 4. The output is saved as `.md`, `.txt`, and `.html`
172
+
173
+ Each document section is written for **two audiences**:
174
+ - **The client** — plain English, reassuring tone, no jargon
175
+ - **The next developer** — precise technical detail, commands, file paths
176
+
177
+ ---
178
+
179
+ ## Project structure
180
+
181
+ ```
182
+ client-handover/
183
+ ├── cli.js # CLI entry point
184
+ ├── index.js # Library exports
185
+ ├── generator.js # Claude API call + file output
186
+ ├── handover.js # Full handover prompt builder
187
+ ├── setup.js # Setup section prompt builder
188
+ ├── deploy.js # Deployment section prompt builder
189
+ ├── credentials.js # Credentials section prompt builder
190
+ └── license.js # Licensing section prompt builder
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Contributing
196
+
197
+ Pull requests are welcome. For major changes, open an issue first.
109
198
 
110
199
  ---
111
200
 
package/cli.js CHANGED
@@ -10,42 +10,66 @@ import chalk from 'chalk'
10
10
  import fs from 'fs'
11
11
 
12
12
  const COMMANDS = {
13
- '/setup': { fn: setup, label: 'Project Setup & Dependencies' },
14
- '/deploy': { fn: deploy, label: 'Deployment & Hosting' },
15
- '/credentials': { fn: credentials, label: 'Credentials & Access' },
16
- '/handover': { fn: handover, label: 'Full Handover Document' },
17
- '/license': { fn: license, label: 'Licensing & Attribution' },
13
+ 'setup': { fn: setup, label: 'Project Setup & Dependencies' },
14
+ 'deploy': { fn: deploy, label: 'Deployment & Hosting' },
15
+ 'credentials': { fn: credentials, label: 'Credentials & Access' },
16
+ 'handover': { fn: handover, label: 'Full Handover Document' },
17
+ 'license': { fn: license, label: 'Licensing & Attribution' },
18
+ }
19
+
20
+ function normalizeCommand(cmd) {
21
+ return cmd.replace(/^\/+/, '')
18
22
  }
19
23
 
20
24
  function printHelp() {
21
- console.log(chalk.bold('\n🚀 handover-cli — Frontend Website Handover Document Generator\n'))
25
+ console.log(chalk.bold('\n🚀 handover-cli — Frontend Website Handover - by Scott AK (sabrkei)\n'))
22
26
  console.log(chalk.dim('Usage:'))
23
27
  console.log(' handover <command> [project-info-file] [output-name]\n')
24
28
  console.log(chalk.dim('Commands:'))
25
29
  Object.entries(COMMANDS).forEach(([cmd, { label }]) => {
26
30
  console.log(` ${chalk.cyan(cmd.padEnd(16))} ${label}`)
27
31
  })
32
+ console.log(` ${chalk.cyan('all'.padEnd(16))} All sections in a single folder`)
28
33
  console.log('\n' + chalk.dim('Examples:'))
29
- console.log(' handover /handover # Full doc with placeholders')
30
- console.log(' handover /setup project-info.txt # Setup section using your notes')
31
- console.log(' handover /handover project-info.txt my-client # Full doc, custom filename')
34
+ console.log(' handover handover # Full doc with placeholders')
35
+ console.log(' handover setup project-info.txt # Setup section using your notes')
36
+ console.log(' handover handover project-info.txt my-client # Full doc, custom filename')
37
+ console.log(' handover all project-info.txt acme-client # Every section in output/acme-client/')
32
38
  console.log()
33
39
  }
34
40
 
41
+ async function runAll(projectInfo, folderName) {
42
+ const sections = [
43
+ { key: 'handover', fn: handover, label: 'Full Handover Document' },
44
+ { key: 'setup', fn: setup, label: 'Project Setup & Dependencies' },
45
+ { key: 'deploy', fn: deploy, label: 'Deployment & Hosting' },
46
+ { key: 'credentials', fn: credentials, label: 'Credentials & Access' },
47
+ { key: 'license', fn: license, label: 'Licensing & Attribution' },
48
+ ]
49
+
50
+ const outputDir = `./output/${folderName}`
51
+
52
+ console.log(chalk.bold(`\n📁 Generating all sections into: ${outputDir}\n`))
53
+
54
+ for (const section of sections) {
55
+ console.log(chalk.bold(`📝 Generating: ${section.label}`))
56
+ const prompt = section.fn(projectInfo)
57
+ await generateDoc(prompt, section.key, outputDir)
58
+ console.log()
59
+ }
60
+
61
+ console.log(chalk.green.bold(`✅ All sections saved to ${outputDir}\n`))
62
+ }
63
+
35
64
  async function main() {
36
- const [,, command, infoFile, outputName] = process.argv
65
+ const [,, rawCommand, infoFile, outputName] = process.argv
37
66
 
38
- if (!command || command === '--help' || command === '-h') {
67
+ if (!rawCommand || rawCommand === '--help' || rawCommand === '-h') {
39
68
  printHelp()
40
69
  process.exit(0)
41
70
  }
42
71
 
43
- const entry = COMMANDS[command]
44
- if (!entry) {
45
- console.error(chalk.red(`\n❌ Unknown command: ${command}\n`))
46
- printHelp()
47
- process.exit(1)
48
- }
72
+ const command = normalizeCommand(rawCommand)
49
73
 
50
74
  // Read optional project info file
51
75
  let projectInfo = ''
@@ -58,7 +82,29 @@ async function main() {
58
82
  console.log(chalk.green(`\n📄 Loaded project info from: ${infoFile}`))
59
83
  }
60
84
 
61
- const docName = outputName || command.replace('/', '')
85
+ if (command === 'all') {
86
+ const folderName = outputName || 'all'
87
+ try {
88
+ await runAll(projectInfo, folderName)
89
+ } catch (err) {
90
+ if (err.status === 401) {
91
+ console.error(chalk.red('\n❌ Invalid API key. Set your ANTHROPIC_API_KEY environment variable.\n'))
92
+ } else {
93
+ console.error(chalk.red(`\n❌ Error: ${err.message}\n`))
94
+ }
95
+ process.exit(1)
96
+ }
97
+ return
98
+ }
99
+
100
+ const entry = COMMANDS[command]
101
+ if (!entry) {
102
+ console.error(chalk.red(`\n❌ Unknown command: ${rawCommand}\n`))
103
+ printHelp()
104
+ process.exit(1)
105
+ }
106
+
107
+ const docName = outputName || command
62
108
  const prompt = entry.fn(projectInfo)
63
109
 
64
110
  console.log(chalk.bold(`\n📝 Generating: ${entry.label}`))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "client-handover",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "AI-powered handover document generator for frontend developers handing off client websites",
5
5
  "type": "module",
6
6
  "main": "index.js",