client-handover 1.0.0 → 1.0.1

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 +117 -28
  2. package/cli.js +51 -11
  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,21 +14,39 @@ 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) |
48
+ | `/all` | Every section as separate files in one folder |
49
+ | `/handover` | Full handover document (all sections combined) |
30
50
  | `/setup` | Project setup & dependencies |
31
51
  | `/deploy` | Deployment & hosting info |
32
52
  | `/credentials` | Logins & API keys template |
@@ -36,13 +56,9 @@ Get a free API key at [console.anthropic.com](https://console.anthropic.com)
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
86
+ # Full combined doc with a custom output filename
87
+ handover /handover project-info.txt acme-handover
88
+
89
+ # Individual sections
76
90
  handover /setup project-info.txt
77
91
  handover /deploy project-info.txt
78
92
  handover /credentials project-info.txt
79
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
@@ -18,20 +18,45 @@ const COMMANDS = {
18
18
  }
19
19
 
20
20
  function printHelp() {
21
- console.log(chalk.bold('\n🚀 handover-cli — Frontend Website Handover Document Generator\n'))
21
+ console.log(chalk.bold('\n🚀 handover-cli — Frontend Website Handover - by Scott AK (sabrkei)\n'))
22
22
  console.log(chalk.dim('Usage:'))
23
23
  console.log(' handover <command> [project-info-file] [output-name]\n')
24
24
  console.log(chalk.dim('Commands:'))
25
25
  Object.entries(COMMANDS).forEach(([cmd, { label }]) => {
26
26
  console.log(` ${chalk.cyan(cmd.padEnd(16))} ${label}`)
27
27
  })
28
+ console.log(` ${chalk.cyan('/all'.padEnd(16))} All sections in a single folder`)
28
29
  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')
30
+ console.log(' handover /handover # Full doc with placeholders')
31
+ console.log(' handover /setup project-info.txt # Setup section using your notes')
32
+ console.log(' handover /handover project-info.txt my-client # Full doc, custom filename')
33
+ console.log(' handover /all project-info.txt acme-client # Every section in output/acme-client/')
32
34
  console.log()
33
35
  }
34
36
 
37
+ async function runAll(projectInfo, folderName) {
38
+ const sections = [
39
+ { key: 'handover', fn: handover, label: 'Full Handover Document' },
40
+ { key: 'setup', fn: setup, label: 'Project Setup & Dependencies' },
41
+ { key: 'deploy', fn: deploy, label: 'Deployment & Hosting' },
42
+ { key: 'credentials', fn: credentials, label: 'Credentials & Access' },
43
+ { key: 'license', fn: license, label: 'Licensing & Attribution' },
44
+ ]
45
+
46
+ const outputDir = `./output/${folderName}`
47
+
48
+ console.log(chalk.bold(`\n📁 Generating all sections into: ${outputDir}\n`))
49
+
50
+ for (const section of sections) {
51
+ console.log(chalk.bold(`📝 Generating: ${section.label}`))
52
+ const prompt = section.fn(projectInfo)
53
+ await generateDoc(prompt, section.key, outputDir)
54
+ console.log()
55
+ }
56
+
57
+ console.log(chalk.green.bold(`✅ All sections saved to ${outputDir}\n`))
58
+ }
59
+
35
60
  async function main() {
36
61
  const [,, command, infoFile, outputName] = process.argv
37
62
 
@@ -40,13 +65,6 @@ async function main() {
40
65
  process.exit(0)
41
66
  }
42
67
 
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
- }
49
-
50
68
  // Read optional project info file
51
69
  let projectInfo = ''
52
70
  if (infoFile) {
@@ -58,6 +76,28 @@ async function main() {
58
76
  console.log(chalk.green(`\n📄 Loaded project info from: ${infoFile}`))
59
77
  }
60
78
 
79
+ if (command === '/all') {
80
+ const folderName = outputName || 'all'
81
+ try {
82
+ await runAll(projectInfo, folderName)
83
+ } catch (err) {
84
+ if (err.status === 401) {
85
+ console.error(chalk.red('\n❌ Invalid API key. Set your ANTHROPIC_API_KEY environment variable.\n'))
86
+ } else {
87
+ console.error(chalk.red(`\n❌ Error: ${err.message}\n`))
88
+ }
89
+ process.exit(1)
90
+ }
91
+ return
92
+ }
93
+
94
+ const entry = COMMANDS[command]
95
+ if (!entry) {
96
+ console.error(chalk.red(`\n❌ Unknown command: ${command}\n`))
97
+ printHelp()
98
+ process.exit(1)
99
+ }
100
+
61
101
  const docName = outputName || command.replace('/', '')
62
102
  const prompt = entry.fn(projectInfo)
63
103
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "client-handover",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "AI-powered handover document generator for frontend developers handing off client websites",
5
5
  "type": "module",
6
6
  "main": "index.js",