megabuff 0.7.0 → 0.8.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/README.md +342 -279
- package/media/github-media-banner.png +0 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,76 +1,107 @@
|
|
|
1
|
-
# MegaBuff
|
|
1
|
+
# 🤖 MegaBuff
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<img src="github-media-banner.png" alt="MegaBuff Banner" width="100%">
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<br/>
|
|
8
|
+
<br/>
|
|
9
|
+
|
|
10
|
+
**Transform your AI prompts from good to great!** ✨
|
|
11
|
+
|
|
12
|
+
AI-powered prompt optimizer with multi-provider support (OpenAI, Anthropic & Google Gemini)
|
|
13
|
+
|
|
14
|
+
🔑 BYOK (Bring Your Own Key) • 🎨 16 Beautiful Themes • ⚡ Lightning Fast
|
|
15
|
+
|
|
16
|
+
[](https://www.npmjs.com/package/megabuff)
|
|
17
|
+
[](https://www.npmjs.com/package/megabuff)
|
|
18
|
+
[](https://opensource.org/licenses/AGPL-3.0)
|
|
19
|
+
[](https://github.com/thesupermegabuff/megabuff-cli/stargazers)
|
|
20
|
+
[](https://github.com/thesupermegabuff/megabuff-cli/issues)
|
|
21
|
+
[](https://nodejs.org)
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 📦 Installation
|
|
28
|
+
|
|
29
|
+
Get started in seconds:
|
|
8
30
|
|
|
9
31
|
```bash
|
|
10
32
|
npm install -g megabuff
|
|
11
33
|
megabuff optimize "Rewrite this prompt to be clearer"
|
|
12
34
|
```
|
|
13
35
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
- [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
- [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
36
|
+
**That's it!** 🎉 You're ready to supercharge your prompts.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## ✨ Features
|
|
41
|
+
|
|
42
|
+
- 🤖 **Multi-Provider Support** - OpenAI, Anthropic Claude, Google Gemini, & more
|
|
43
|
+
- 🔑 **BYOK Model** - Bring your own API key, full control
|
|
44
|
+
- 🎨 **16 Beautiful Themes** - Customize your CLI experience
|
|
45
|
+
- ⚡ **Lightning Fast** - Optimize prompts in seconds
|
|
46
|
+
- 📋 **Auto-Clipboard** - Results copied automatically
|
|
47
|
+
- 🔄 **Flexible Input** - Inline, file, pipe, or interactive
|
|
48
|
+
- 💾 **Multiple Output Formats** - Stdout, file, or interactive view
|
|
49
|
+
- 🔒 **Secure Storage** - Keychain support for API keys
|
|
50
|
+
- 🎯 **Smart Model Selection** - Auto-detects provider from model name
|
|
51
|
+
- 📊 **Stats Tracking** - See word count changes and improvements
|
|
52
|
+
- 🌈 **Beautiful Output** - Themed, formatted, fun to use!
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 📚 Table of Contents
|
|
57
|
+
|
|
58
|
+
- [✨ Features](#-features)
|
|
59
|
+
- [📦 Installation](#-installation)
|
|
60
|
+
- [⚡ Quick Start](#-quick-start)
|
|
61
|
+
- [🔐 Setup](#-setup)
|
|
62
|
+
- [⚙️ Configuration Commands](#️-configuration-commands)
|
|
63
|
+
- [🎨 Theme Commands](#-theme-commands)
|
|
64
|
+
- [💡 Usage](#-usage)
|
|
65
|
+
- [🎯 Examples](#-examples)
|
|
66
|
+
- [🔧 How It Works](#-how-it-works)
|
|
67
|
+
- [🆚 VS Code Integration](#-vs-code-integration)
|
|
68
|
+
- [🤝 Contributing](#-contributing)
|
|
69
|
+
- [📄 License](#-license)
|
|
70
|
+
- [👨💻 Development](#-development)
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## ⚡ Quick Start
|
|
75
|
+
|
|
76
|
+
**New to MegaBuff?** Let's get you optimizing in under 60 seconds! ⏱️
|
|
55
77
|
|
|
56
78
|
```bash
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
79
|
+
# 1. Install globally
|
|
80
|
+
npm install -g megabuff
|
|
81
|
+
|
|
82
|
+
# 2. Set up your API key (choose your favorite provider)
|
|
83
|
+
megabuff config token YOUR_API_KEY --provider openai
|
|
84
|
+
|
|
85
|
+
# 3. Start optimizing!
|
|
86
|
+
megabuff optimize "Write a function to validate emails"
|
|
61
87
|
```
|
|
62
88
|
|
|
63
|
-
|
|
89
|
+
> 💡 **Pro Tip:** Try out different themes with `megabuff theme list`!
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 🔐 Setup
|
|
94
|
+
|
|
95
|
+
### 🤖 Getting Your OpenAI API Key (BYOK)
|
|
64
96
|
|
|
65
|
-
|
|
97
|
+
MegaBuff uses a **BYOK (Bring Your Own Key)** model. Why is this awesome?
|
|
66
98
|
|
|
67
|
-
|
|
68
|
-
- ✅
|
|
69
|
-
- ✅
|
|
70
|
-
- ✅
|
|
71
|
-
- ✅ Ability to set your own usage limits
|
|
99
|
+
- ✅ **Full Control** - You manage your usage and costs
|
|
100
|
+
- ✅ **Super Cheap** - Typically just pennies per optimization 💰
|
|
101
|
+
- ✅ **Privacy First** - Your prompts go directly to the provider 🔒
|
|
102
|
+
- ✅ **Your Rules** - Set your own usage limits
|
|
72
103
|
|
|
73
|
-
**
|
|
104
|
+
**Get your key in 4 easy steps:**
|
|
74
105
|
|
|
75
106
|
1. **Create an OpenAI Account**
|
|
76
107
|
- Sign up or log in at [platform.openai.com](https://platform.openai.com/)
|
|
@@ -93,11 +124,9 @@ MegaBuff uses a **BYOK (Bring Your Own Key)** model, meaning you use your own Op
|
|
|
93
124
|
- Store it securely - you'll need to generate a new one if you lose it
|
|
94
125
|
- The key starts with `sk-`
|
|
95
126
|
|
|
96
|
-
### Getting Your Anthropic API Key (BYOK)
|
|
127
|
+
### 🧠 Getting Your Anthropic API Key (BYOK)
|
|
97
128
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
**Steps to get your Anthropic API Key:**
|
|
129
|
+
Want to use **Claude**? Follow these simple steps:
|
|
101
130
|
|
|
102
131
|
1. **Create an Anthropic Console account**
|
|
103
132
|
- Sign up / log in at `https://console.anthropic.com/`
|
|
@@ -114,11 +143,9 @@ MegaBuff can also use **Anthropic (Claude)** if you provide your own Anthropic A
|
|
|
114
143
|
- Copy and store it somewhere secure
|
|
115
144
|
- Anthropic keys typically start with `sk-ant-`
|
|
116
145
|
|
|
117
|
-
### Getting Your Google Gemini API Key (BYOK)
|
|
118
|
-
|
|
119
|
-
MegaBuff also supports **Google Gemini** with your own API key.
|
|
146
|
+
### ✨ Getting Your Google Gemini API Key (BYOK)
|
|
120
147
|
|
|
121
|
-
|
|
148
|
+
Ready to try **Gemini**? Here's how:
|
|
122
149
|
|
|
123
150
|
1. **Go to Google AI Studio**
|
|
124
151
|
- Visit [Google AI Studio](https://aistudio.google.com/app/apikey)
|
|
@@ -191,11 +218,13 @@ The CLI checks for your token in this order (per provider):
|
|
|
191
218
|
3. System keychain (if configured)
|
|
192
219
|
4. Config file at `~/.megabuff/config.json`
|
|
193
220
|
|
|
194
|
-
|
|
221
|
+
---
|
|
195
222
|
|
|
196
|
-
|
|
223
|
+
## ⚙️ Configuration Commands
|
|
197
224
|
|
|
198
|
-
|
|
225
|
+
### 🎮 Interactive Config Menu
|
|
226
|
+
|
|
227
|
+
The easiest way to configure everything:
|
|
199
228
|
|
|
200
229
|
```bash
|
|
201
230
|
megabuff config
|
|
@@ -214,31 +243,38 @@ megabuff config
|
|
|
214
243
|
# 5) Exit
|
|
215
244
|
```
|
|
216
245
|
|
|
217
|
-
### Direct Commands
|
|
246
|
+
### 🔧 Direct Commands
|
|
218
247
|
|
|
248
|
+
**Token Management:**
|
|
219
249
|
```bash
|
|
220
|
-
# Set API token
|
|
221
|
-
megabuff config token sk-your-api-key
|
|
222
|
-
megabuff config token sk-ant-... --provider anthropic --keychain
|
|
250
|
+
# 🔑 Set your API token
|
|
251
|
+
megabuff config token sk-your-api-key --provider openai
|
|
252
|
+
megabuff config token sk-ant-... --provider anthropic --keychain # More secure!
|
|
253
|
+
|
|
254
|
+
# 🗑️ Remove a token
|
|
255
|
+
megabuff config remove --provider anthropic
|
|
256
|
+
```
|
|
223
257
|
|
|
224
|
-
|
|
258
|
+
**Provider & Model Selection:**
|
|
259
|
+
```bash
|
|
260
|
+
# 🤖 Set default provider
|
|
225
261
|
megabuff config provider anthropic
|
|
226
|
-
megabuff config provider
|
|
262
|
+
megabuff config provider # Show current
|
|
227
263
|
|
|
228
|
-
# Set model (
|
|
229
|
-
megabuff config model claude-sonnet-4-5
|
|
230
|
-
megabuff config model gpt-4o
|
|
231
|
-
megabuff config model gemini-1.5-pro
|
|
232
|
-
megabuff config model #
|
|
264
|
+
# 🎯 Set model (auto-selects provider!)
|
|
265
|
+
megabuff config model claude-sonnet-4-5 # → Anthropic
|
|
266
|
+
megabuff config model gpt-4o # → OpenAI
|
|
267
|
+
megabuff config model gemini-1.5-pro # → Google
|
|
268
|
+
megabuff config model # Show current
|
|
269
|
+
```
|
|
233
270
|
|
|
234
|
-
|
|
271
|
+
**View Everything:**
|
|
272
|
+
```bash
|
|
273
|
+
# 📊 Show complete configuration
|
|
235
274
|
megabuff config show
|
|
236
|
-
|
|
237
|
-
# Remove a saved token
|
|
238
|
-
megabuff config remove --provider anthropic
|
|
239
275
|
```
|
|
240
276
|
|
|
241
|
-
### Available Models
|
|
277
|
+
### 🤖 Available Models
|
|
242
278
|
|
|
243
279
|
**OpenAI:**
|
|
244
280
|
- `gpt-4o`
|
|
@@ -262,186 +298,196 @@ megabuff config remove --provider anthropic
|
|
|
262
298
|
- `gemini-1.5-flash` (default for Google)
|
|
263
299
|
- `gemini-1.0-pro`
|
|
264
300
|
|
|
265
|
-
|
|
301
|
+
---
|
|
266
302
|
|
|
267
|
-
|
|
303
|
+
## 🎨 Theme Commands
|
|
268
304
|
|
|
269
|
-
|
|
270
|
-
npm install
|
|
271
|
-
|
|
272
|
-
# Using the dev script (recommended)
|
|
273
|
-
npm run dev optimize "Write a function to sort arrays"
|
|
305
|
+
**Make your CLI experience uniquely yours!** Choose from 16 stunning color themes. ✨
|
|
274
306
|
|
|
275
|
-
|
|
276
|
-
npx tsx src/index.ts optimize "Your prompt here"
|
|
307
|
+
### 👀 View Current Theme
|
|
277
308
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
megabuff optimize "Your prompt here"
|
|
309
|
+
```bash
|
|
310
|
+
megabuff theme
|
|
281
311
|
```
|
|
282
312
|
|
|
283
|
-
|
|
313
|
+
Shows your active theme with a beautiful preview! 🌈
|
|
284
314
|
|
|
285
|
-
|
|
315
|
+
### 📋 List All Themes
|
|
286
316
|
|
|
287
317
|
```bash
|
|
288
|
-
|
|
318
|
+
megabuff theme list
|
|
289
319
|
```
|
|
290
320
|
|
|
291
|
-
|
|
321
|
+
Browse all 16 themes with:
|
|
322
|
+
- ⭐ Your active theme highlighted
|
|
323
|
+
- Live color previews
|
|
324
|
+
- Theme descriptions
|
|
292
325
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
Install the CLI globally on your machine for testing:
|
|
326
|
+
### 🎭 Change Theme
|
|
296
327
|
|
|
297
328
|
```bash
|
|
298
|
-
|
|
329
|
+
megabuff theme set dracula # 🧛♂️ Dark & mysterious
|
|
330
|
+
megabuff theme set cyberpunk # 🌆 Neon future vibes
|
|
331
|
+
megabuff theme set pastel-rainbow # 🌈 Soft & dreamy
|
|
299
332
|
```
|
|
300
333
|
|
|
301
|
-
|
|
334
|
+
Your choice is saved and applied to all commands instantly!
|
|
302
335
|
|
|
303
|
-
|
|
336
|
+
### 🔍 Preview Theme
|
|
304
337
|
|
|
305
|
-
|
|
338
|
+
Try before you apply:
|
|
306
339
|
|
|
307
340
|
```bash
|
|
308
|
-
megabuff
|
|
341
|
+
megabuff theme preview monokai
|
|
309
342
|
```
|
|
310
343
|
|
|
311
|
-
|
|
344
|
+
See the full color palette in action before committing! 🎨
|
|
312
345
|
|
|
313
|
-
|
|
314
|
-
megabuff optimize --file prompt.txt
|
|
315
|
-
```
|
|
346
|
+
### 🌟 Available Themes
|
|
316
347
|
|
|
317
|
-
|
|
348
|
+
| Theme | Vibe | Description |
|
|
349
|
+
|-------|------|-------------|
|
|
350
|
+
| 🎯 **default** | Clean & Pro | Cyan and green palette |
|
|
351
|
+
| 🎨 **material** | Modern | Google Material Design |
|
|
352
|
+
| 🧛♂️ **dracula** | Dark & Gothic | Purple and pink accents |
|
|
353
|
+
| ❄️ **nord** | Arctic | Cool bluish tones |
|
|
354
|
+
| ☀️ **solarized** | Precision | Perfect balance |
|
|
355
|
+
| 🎸 **monokai** | Vibrant | Monokai Pro inspired |
|
|
356
|
+
| 🌆 **cyberpunk** | Futuristic | Neon city lights |
|
|
357
|
+
| 🌅 **sunset** | Warm | Oranges & purples |
|
|
358
|
+
| 🌈 **pastel-rainbow** | Dreamy | Soft rainbow hues |
|
|
359
|
+
| 🍬 **bubblegum** | Sweet | All the pink vibes |
|
|
360
|
+
| 🍭 **cotton-candy** | Fluffy | Pink meets blue |
|
|
361
|
+
| 🦄 **unicorn** | Magical | Pastel paradise |
|
|
362
|
+
| 🌊 **ocean** | Aquatic | Deep blue serenity |
|
|
363
|
+
| 🌲 **forest** | Natural | Earthy greens |
|
|
364
|
+
| 📺 **retro** | Nostalgic | 80s terminal style |
|
|
365
|
+
| ⚡ **neon-dreams** | Electric | Vibrant neons |
|
|
318
366
|
|
|
319
|
-
|
|
320
|
-
echo "Explain quantum computing" | megabuff optimize
|
|
321
|
-
cat prompt.txt | megabuff optimize
|
|
322
|
-
```
|
|
367
|
+
**Every theme is optimized for readability and style!** 🎨✨
|
|
323
368
|
|
|
324
|
-
|
|
369
|
+
---
|
|
325
370
|
|
|
326
|
-
|
|
327
|
-
megabuff optimize
|
|
328
|
-
# Then paste/type your prompt and press Ctrl+D when done
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
## Output Options
|
|
371
|
+
## 💡 Usage
|
|
332
372
|
|
|
333
|
-
|
|
373
|
+
**MegaBuff is flexible!** Use whichever input method works best for you:
|
|
334
374
|
|
|
335
|
-
|
|
336
|
-
1. Printed to stdout (so you can pipe it)
|
|
337
|
-
2. Automatically copied to your clipboard (works on macOS, Windows, and Linux)
|
|
375
|
+
### 1️⃣ Inline (Fastest!)
|
|
338
376
|
|
|
339
377
|
```bash
|
|
340
|
-
megabuff optimize "
|
|
341
|
-
# Result is both printed AND copied to clipboard
|
|
378
|
+
megabuff optimize "Write a function that validates emails"
|
|
342
379
|
```
|
|
343
380
|
|
|
344
|
-
###
|
|
345
|
-
|
|
346
|
-
If you don't want automatic clipboard copy:
|
|
381
|
+
### 2️⃣ From a File
|
|
347
382
|
|
|
348
383
|
```bash
|
|
349
|
-
megabuff optimize
|
|
384
|
+
megabuff optimize --file my-prompt.txt
|
|
350
385
|
```
|
|
351
386
|
|
|
352
|
-
###
|
|
387
|
+
### 3️⃣ Pipe It In
|
|
353
388
|
|
|
354
389
|
```bash
|
|
355
|
-
|
|
356
|
-
|
|
390
|
+
echo "Explain quantum computing" | megabuff optimize
|
|
391
|
+
cat prompt.txt | megabuff optimize
|
|
357
392
|
```
|
|
358
393
|
|
|
359
|
-
### Interactive
|
|
394
|
+
### 4️⃣ Interactive Mode
|
|
360
395
|
|
|
361
396
|
```bash
|
|
362
|
-
megabuff optimize
|
|
363
|
-
#
|
|
397
|
+
megabuff optimize
|
|
398
|
+
# Type/paste your prompt, then Ctrl+D ✨
|
|
364
399
|
```
|
|
365
400
|
|
|
366
|
-
###
|
|
401
|
+
### 📤 Output Options
|
|
402
|
+
|
|
403
|
+
**By default, MegaBuff does BOTH:**
|
|
404
|
+
- ✅ Prints to stdout (for piping)
|
|
405
|
+
- ✅ Copies to clipboard (instant paste!)
|
|
406
|
+
|
|
407
|
+
**Customize the output:**
|
|
367
408
|
|
|
368
409
|
```bash
|
|
369
|
-
#
|
|
370
|
-
megabuff optimize "
|
|
410
|
+
# Don't copy to clipboard
|
|
411
|
+
megabuff optimize "prompt" --no-copy
|
|
412
|
+
|
|
413
|
+
# Save to file (still copies by default)
|
|
414
|
+
megabuff optimize "prompt" --output result.txt
|
|
371
415
|
|
|
372
|
-
# Interactive view
|
|
373
|
-
megabuff optimize "
|
|
416
|
+
# Interactive before/after view
|
|
417
|
+
megabuff optimize "prompt" --interactive
|
|
374
418
|
|
|
375
|
-
#
|
|
376
|
-
megabuff optimize "
|
|
419
|
+
# Save without clipboard
|
|
420
|
+
megabuff optimize "prompt" -o result.txt --no-copy
|
|
377
421
|
```
|
|
378
422
|
|
|
379
|
-
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
## 🎯 Examples
|
|
426
|
+
|
|
427
|
+
**Real-world use cases to get you started:**
|
|
380
428
|
|
|
381
429
|
```bash
|
|
382
|
-
# Quick
|
|
430
|
+
# 🚀 Quick optimization
|
|
383
431
|
megabuff optimize "Write code for user auth"
|
|
384
432
|
|
|
385
|
-
# Use
|
|
386
|
-
megabuff optimize --provider anthropic "
|
|
433
|
+
# 🧠 Use Claude for better reasoning
|
|
434
|
+
megabuff optimize --provider anthropic "Explain recursion"
|
|
387
435
|
|
|
388
|
-
#
|
|
389
|
-
megabuff optimize --provider google "
|
|
436
|
+
# ✨ Try Gemini
|
|
437
|
+
megabuff optimize --provider google "Design a database schema"
|
|
390
438
|
|
|
391
|
-
# From file with
|
|
392
|
-
megabuff optimize --file
|
|
439
|
+
# 📁 From a file with before/after comparison
|
|
440
|
+
megabuff optimize --file prompt.txt --interactive
|
|
393
441
|
|
|
394
|
-
# Pipe and save
|
|
442
|
+
# 🔄 Pipe and save
|
|
395
443
|
cat input.txt | megabuff optimize --output optimized.txt
|
|
396
444
|
|
|
397
|
-
#
|
|
398
|
-
megabuff
|
|
445
|
+
# 🎯 Use a specific model
|
|
446
|
+
megabuff config model claude-sonnet-4-5
|
|
447
|
+
megabuff optimize "Explain quantum computing"
|
|
399
448
|
|
|
400
|
-
#
|
|
401
|
-
megabuff
|
|
449
|
+
# 🎨 Make it pretty!
|
|
450
|
+
megabuff theme set cyberpunk # Set theme
|
|
451
|
+
megabuff theme preview dracula # Preview first
|
|
452
|
+
megabuff theme list # See all options
|
|
402
453
|
|
|
403
|
-
#
|
|
404
|
-
megabuff optimize
|
|
454
|
+
# 🔧 Power user combos
|
|
455
|
+
megabuff optimize --file long-prompt.txt --provider anthropic -o result.txt --interactive
|
|
456
|
+
```
|
|
405
457
|
|
|
406
|
-
|
|
407
|
-
megabuff config provider anthropic
|
|
408
|
-
megabuff optimize "Rewrite this prompt to be clearer"
|
|
458
|
+
---
|
|
409
459
|
|
|
410
|
-
|
|
411
|
-
megabuff config model claude-sonnet-4-5
|
|
412
|
-
megabuff optimize "Explain quantum computing"
|
|
460
|
+
## 🔧 How It Works
|
|
413
461
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
462
|
+
**The Magic Behind MegaBuff** ✨
|
|
463
|
+
|
|
464
|
+
MegaBuff uses state-of-the-art AI to transform your prompts:
|
|
465
|
+
|
|
466
|
+
### 🎯 What Gets Optimized?
|
|
418
467
|
|
|
419
|
-
|
|
468
|
+
1. **Clarity** - Removes ambiguity and vague instructions
|
|
469
|
+
2. **Context** - Adds missing details that improve results
|
|
470
|
+
3. **Structure** - Organizes information logically
|
|
471
|
+
4. **Format** - Specifies expected output clearly
|
|
472
|
+
5. **Specificity** - Makes requests actionable and precise
|
|
420
473
|
|
|
421
|
-
|
|
474
|
+
### 🤖 Choose Your AI
|
|
422
475
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
476
|
+
| Provider | Best For | Default Model |
|
|
477
|
+
|----------|----------|---------------|
|
|
478
|
+
| 🤖 **OpenAI** | Fast & economical | GPT-4o-mini |
|
|
479
|
+
| 🧠 **Anthropic** | Deep reasoning | Claude Sonnet 4.5 |
|
|
480
|
+
| ✨ **Google** | Efficient & quality | Gemini 1.5 Flash |
|
|
427
481
|
|
|
428
|
-
|
|
429
|
-
1. Identifies ambiguities or unclear instructions
|
|
430
|
-
2. Adds relevant context that would improve results
|
|
431
|
-
3. Structures the prompt for clarity
|
|
432
|
-
4. Specifies expected output format if not present
|
|
433
|
-
5. Makes the prompt more specific and actionable
|
|
482
|
+
**Switch providers anytime** with `--provider` or set your favorite as default!
|
|
434
483
|
|
|
435
|
-
|
|
436
|
-
- Set a specific model with `megabuff config model <model-name>`
|
|
437
|
-
- Provider is automatically selected based on the model
|
|
438
|
-
- Or explicitly choose provider with `--provider` flag
|
|
484
|
+
---
|
|
439
485
|
|
|
440
|
-
## VS Code Integration
|
|
486
|
+
## 🆚 VS Code Integration
|
|
441
487
|
|
|
442
|
-
MegaBuff
|
|
488
|
+
**Use MegaBuff right inside VS Code!** 🎉
|
|
443
489
|
|
|
444
|
-
### Option 1: VS Code Extension (Full Experience)
|
|
490
|
+
### ⭐ Option 1: VS Code Extension (Full Experience)
|
|
445
491
|
|
|
446
492
|
Install and develop the MegaBuff VS Code extension:
|
|
447
493
|
|
|
@@ -463,131 +509,148 @@ Then press `F5` to launch the extension in debug mode.
|
|
|
463
509
|
|
|
464
510
|
See [megabuff-vscode/README.md](../megabuff-vscode/README.md) for more details.
|
|
465
511
|
|
|
466
|
-
### Option 2: VS Code Tasks (Quick Setup)
|
|
512
|
+
### 🚀 Option 2: VS Code Tasks (Quick Setup)
|
|
467
513
|
|
|
468
|
-
|
|
514
|
+
Pre-configured tasks for instant productivity:
|
|
469
515
|
|
|
470
|
-
1. Select text
|
|
471
|
-
2.
|
|
472
|
-
3.
|
|
516
|
+
1. Select text
|
|
517
|
+
2. `Ctrl+Shift+P` → "Tasks: Run Task"
|
|
518
|
+
3. Pick a MegaBuff task
|
|
473
519
|
|
|
474
|
-
Available
|
|
475
|
-
-
|
|
476
|
-
-
|
|
477
|
-
-
|
|
478
|
-
-
|
|
520
|
+
**Available Tasks:**
|
|
521
|
+
- ✨ Optimize Selected Text
|
|
522
|
+
- 📄 Optimize Current File
|
|
523
|
+
- 🔍 Optimize (Interactive View)
|
|
524
|
+
- ⚙️ Configure API Key
|
|
479
525
|
|
|
480
|
-
### Option 3: Terminal Integration
|
|
526
|
+
### 💻 Option 3: Terminal Integration
|
|
481
527
|
|
|
482
|
-
|
|
528
|
+
Just use the integrated terminal:
|
|
483
529
|
|
|
484
530
|
```bash
|
|
485
|
-
# Select text, then in terminal:
|
|
486
531
|
pbpaste | megabuff optimize # macOS
|
|
487
532
|
xclip -o | megabuff optimize # Linux
|
|
488
533
|
```
|
|
489
534
|
|
|
490
|
-
|
|
535
|
+
---
|
|
536
|
+
|
|
537
|
+
## 🤝 Contributing
|
|
538
|
+
|
|
539
|
+
**We'd love your help making MegaBuff better!**
|
|
540
|
+
|
|
541
|
+
Found a bug? Have an idea? Open an issue:
|
|
491
542
|
|
|
492
|
-
|
|
543
|
+
👉 [GitHub Issues](https://github.com/thesupermegabuff/megabuff-cli/issues)
|
|
493
544
|
|
|
494
|
-
|
|
545
|
+
---
|
|
495
546
|
|
|
496
|
-
##
|
|
547
|
+
## 📄 License
|
|
497
548
|
|
|
498
|
-
|
|
549
|
+
**MegaBuff is open source!** Licensed under **AGPL-3.0**
|
|
499
550
|
|
|
500
|
-
|
|
551
|
+
**What this means:**
|
|
552
|
+
- ✅ **Free to use** - For any purpose
|
|
553
|
+
- ✅ **Free to modify** - Make it your own
|
|
554
|
+
- ✅ **Free to share** - Spread the love
|
|
555
|
+
- 🔓 **Open source required** - Derivative works must stay open
|
|
556
|
+
- 🌐 **Service transparency** - If you run it as a service, share the code
|
|
501
557
|
|
|
502
|
-
|
|
503
|
-
```bash
|
|
504
|
-
npm login
|
|
505
|
-
```
|
|
558
|
+
[Read the full license](LICENSE)
|
|
506
559
|
|
|
507
|
-
|
|
508
|
-
- Change `author` to your name and email
|
|
509
|
-
- Update `repository` URL with your GitHub username
|
|
510
|
-
- Update `bugs` and `homepage` URLs
|
|
560
|
+
---
|
|
511
561
|
|
|
512
|
-
|
|
513
|
-
```bash
|
|
514
|
-
npm search megabuff
|
|
515
|
-
```
|
|
516
|
-
The name `megabuff` should be available (or use an alternative if taken)
|
|
562
|
+
## 👨💻 Development
|
|
517
563
|
|
|
518
|
-
|
|
564
|
+
**Want to contribute or build from source?**
|
|
519
565
|
|
|
520
|
-
|
|
521
|
-
```bash
|
|
522
|
-
git status
|
|
523
|
-
git add .
|
|
524
|
-
git commit -m "Prepare for publish"
|
|
525
|
-
```
|
|
566
|
+
### 🔧 Local Development
|
|
526
567
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
```
|
|
532
|
-
This compiles TypeScript to JavaScript in the `dist/` folder
|
|
568
|
+
```bash
|
|
569
|
+
# Clone the repo
|
|
570
|
+
git clone https://github.com/thesupermegabuff/megabuff-cli.git
|
|
571
|
+
cd megabuff-cli
|
|
533
572
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
npm pack
|
|
537
|
-
# This creates a .tgz file you can inspect
|
|
538
|
-
```
|
|
573
|
+
# Install dependencies
|
|
574
|
+
npm install
|
|
539
575
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
npm publish
|
|
543
|
-
```
|
|
576
|
+
# Run in dev mode
|
|
577
|
+
npm run dev optimize "Your prompt"
|
|
544
578
|
|
|
545
|
-
|
|
579
|
+
# Or use tsx directly
|
|
580
|
+
npx tsx src/index.ts optimize "Your prompt"
|
|
581
|
+
```
|
|
546
582
|
|
|
547
|
-
###
|
|
583
|
+
### 📦 Build
|
|
548
584
|
|
|
549
|
-
|
|
585
|
+
```bash
|
|
586
|
+
npm run build # Compiles to dist/
|
|
587
|
+
```
|
|
550
588
|
|
|
551
|
-
|
|
552
|
-
```bash
|
|
553
|
-
# For bug fixes (0.1.0 -> 0.1.1)
|
|
554
|
-
npm version patch
|
|
589
|
+
### 🔗 Test Locally
|
|
555
590
|
|
|
556
|
-
|
|
557
|
-
|
|
591
|
+
```bash
|
|
592
|
+
npm link # Install as global command
|
|
593
|
+
megabuff optimize "Test it out!"
|
|
594
|
+
```
|
|
558
595
|
|
|
559
|
-
|
|
560
|
-
npm version major
|
|
561
|
-
```
|
|
596
|
+
---
|
|
562
597
|
|
|
563
|
-
|
|
564
|
-
```bash
|
|
565
|
-
npm publish
|
|
566
|
-
```
|
|
598
|
+
## 📚 Publishing to npm
|
|
567
599
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
git push && git push --tags
|
|
571
|
-
```
|
|
600
|
+
<details>
|
|
601
|
+
<summary><b>📦 Publishing Guide (For Maintainers)</b></summary>
|
|
572
602
|
|
|
573
|
-
###
|
|
603
|
+
### 🎯 First-time Setup
|
|
574
604
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
- ✅ `LICENSE` - License file
|
|
580
|
-
- ❌ `src/` - TypeScript source (excluded)
|
|
581
|
-
- ❌ `node_modules/` - Dependencies (excluded)
|
|
582
|
-
- ❌ Development files (excluded via .npmignore)
|
|
605
|
+
1. Create an [npm account](https://www.npmjs.com/signup)
|
|
606
|
+
2. Login: `npm login`
|
|
607
|
+
3. Update `package.json` with your details
|
|
608
|
+
4. Check name availability: `npm search megabuff`
|
|
583
609
|
|
|
584
|
-
###
|
|
610
|
+
### 🚀 Publishing Process
|
|
585
611
|
|
|
586
|
-
|
|
612
|
+
```bash
|
|
613
|
+
# 1. Commit changes
|
|
614
|
+
git add .
|
|
615
|
+
git commit -m "Release preparation"
|
|
616
|
+
|
|
617
|
+
# 2. Bump version (patch/minor/major)
|
|
618
|
+
npm version minor
|
|
619
|
+
|
|
620
|
+
# 3. Publish!
|
|
621
|
+
npm publish
|
|
622
|
+
|
|
623
|
+
# 4. Push tags
|
|
624
|
+
git push && git push --tags
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
### 📦 What Gets Published
|
|
628
|
+
|
|
629
|
+
- ✅ Compiled JavaScript (`dist/`)
|
|
630
|
+
- ✅ Documentation
|
|
631
|
+
- ✅ Package metadata
|
|
632
|
+
- ❌ TypeScript source
|
|
633
|
+
- ❌ Dev dependencies
|
|
634
|
+
|
|
635
|
+
### 🎉 After Publishing
|
|
636
|
+
|
|
637
|
+
Users install with:
|
|
587
638
|
```bash
|
|
588
639
|
npm install -g megabuff
|
|
589
640
|
```
|
|
590
641
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
642
|
+
Available at: [npmjs.com/package/megabuff](https://www.npmjs.com/package/megabuff)
|
|
643
|
+
|
|
644
|
+
</details>
|
|
645
|
+
|
|
646
|
+
---
|
|
647
|
+
|
|
648
|
+
<div align="center">
|
|
649
|
+
|
|
650
|
+
**Made with ❤️ by the MegaBuff Team**
|
|
651
|
+
|
|
652
|
+
⭐ **Star us on [GitHub](https://github.com/thesupermegabuff/megabuff-cli)!**
|
|
653
|
+
|
|
654
|
+
🐛 [Report Issues](https://github.com/thesupermegabuff/megabuff-cli/issues) • 💡 [Request Features](https://github.com/thesupermegabuff/megabuff-cli/issues)
|
|
655
|
+
|
|
656
|
+
</div>
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "megabuff",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "AI-powered prompt optimizer CLI with BYOK (Bring Your Own Key) support for OpenAI, Anthropic, and Google Gemini",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"command-line"
|
|
28
28
|
],
|
|
29
29
|
"author": "thesupermegabuff <your.email@example.com>",
|
|
30
|
-
"license": "
|
|
30
|
+
"license": "AGPL-3.0",
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
33
33
|
"url": "https://github.com/thesupermegabuff/megabuff-cli.git"
|