megabuff 0.7.0 → 0.9.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.
- package/README.md +371 -280
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +13 -1
- package/dist/config.js.map +1 -1
- package/dist/index.js +122 -8
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +8 -0
- package/dist/models.js.map +1 -1
- package/media/github-media-banner.png +0 -0
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -1,76 +1,107 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
🤖 MegaBuff
|
|
3
|
+
</h1>
|
|
4
|
+
<div align="center">
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
**Transform your AI prompts from good to great!** ✨
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
AI-powered prompt optimizer with multi-provider support (OpenAI, Anthropic, Gemini, DeepSeek, xAI & more)
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
🔑 BYOK (Bring Your Own Key) • 🎨 16 Beautiful Themes • ⚡ Lightning Fast
|
|
11
|
+
|
|
12
|
+
[](https://www.npmjs.com/package/megabuff)
|
|
13
|
+
[](https://www.npmjs.com/package/megabuff)
|
|
14
|
+
[](https://opensource.org/licenses/AGPL-3.0)
|
|
15
|
+
[](https://github.com/thesupermegabuff/megabuff-cli/stargazers)
|
|
16
|
+
[](https://github.com/thesupermegabuff/megabuff-cli/issues)
|
|
17
|
+
[](https://nodejs.org)
|
|
18
|
+
|
|
19
|
+
<img width="690" src="media/github-media-banner.png" alt="MegaBuff Banner" width="100%">
|
|
20
|
+
|
|
21
|
+
<br/>
|
|
22
|
+
<br/>
|
|
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
|
+
---
|
|
64
92
|
|
|
65
|
-
|
|
93
|
+
## 🔐 Setup
|
|
66
94
|
|
|
67
|
-
|
|
68
|
-
- ✅ Direct control over your usage and costs
|
|
69
|
-
- ✅ Pay-per-use pricing (typically pennies per optimization)
|
|
70
|
-
- ✅ Full privacy - your prompts go directly to OpenAI
|
|
71
|
-
- ✅ Ability to set your own usage limits
|
|
95
|
+
### 🤖 Getting Your OpenAI API Key (BYOK)
|
|
72
96
|
|
|
73
|
-
**
|
|
97
|
+
MegaBuff uses a **BYOK (Bring Your Own Key)** model. Why is this awesome?
|
|
98
|
+
|
|
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
|
|
103
|
+
|
|
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)
|
|
@@ -171,6 +198,8 @@ This saves your key for future use. You only need to do this once!
|
|
|
171
198
|
export OPENAI_API_KEY="sk-your-api-key-here"
|
|
172
199
|
export ANTHROPIC_API_KEY="sk-ant-your-api-key-here"
|
|
173
200
|
export GOOGLE_API_KEY="your-google-api-key-here"
|
|
201
|
+
export XAI_API_KEY="xai-your-api-key-here"
|
|
202
|
+
export DEEPSEEK_API_KEY="sk-your-deepseek-key-here"
|
|
174
203
|
```
|
|
175
204
|
|
|
176
205
|
Add to your shell profile (`.bashrc`, `.zshrc`, etc.) to persist across sessions.
|
|
@@ -187,15 +216,17 @@ megabuff optimize --provider google "your prompt" --api-key your-google-key-here
|
|
|
187
216
|
|
|
188
217
|
The CLI checks for your token in this order (per provider):
|
|
189
218
|
1. `--api-key` flag (highest priority)
|
|
190
|
-
2. Provider env var (e.g. `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`)
|
|
219
|
+
2. Provider env var (e.g. `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `XAI_API_KEY`, `DEEPSEEK_API_KEY`)
|
|
191
220
|
3. System keychain (if configured)
|
|
192
221
|
4. Config file at `~/.megabuff/config.json`
|
|
193
222
|
|
|
194
|
-
|
|
223
|
+
---
|
|
195
224
|
|
|
196
|
-
|
|
225
|
+
## ⚙️ Configuration Commands
|
|
197
226
|
|
|
198
|
-
|
|
227
|
+
### 🎮 Interactive Config Menu
|
|
228
|
+
|
|
229
|
+
The easiest way to configure everything:
|
|
199
230
|
|
|
200
231
|
```bash
|
|
201
232
|
megabuff config
|
|
@@ -214,31 +245,38 @@ megabuff config
|
|
|
214
245
|
# 5) Exit
|
|
215
246
|
```
|
|
216
247
|
|
|
217
|
-
### Direct Commands
|
|
248
|
+
### 🔧 Direct Commands
|
|
218
249
|
|
|
250
|
+
**Token Management:**
|
|
219
251
|
```bash
|
|
220
|
-
# Set API token
|
|
221
|
-
megabuff config token sk-your-api-key
|
|
222
|
-
megabuff config token sk-ant-... --provider anthropic --keychain
|
|
252
|
+
# 🔑 Set your API token
|
|
253
|
+
megabuff config token sk-your-api-key --provider openai
|
|
254
|
+
megabuff config token sk-ant-... --provider anthropic --keychain # More secure!
|
|
223
255
|
|
|
224
|
-
#
|
|
256
|
+
# 🗑️ Remove a token
|
|
257
|
+
megabuff config remove --provider anthropic
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**Provider & Model Selection:**
|
|
261
|
+
```bash
|
|
262
|
+
# 🤖 Set default provider
|
|
225
263
|
megabuff config provider anthropic
|
|
226
|
-
megabuff config provider
|
|
264
|
+
megabuff config provider # Show current
|
|
227
265
|
|
|
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 #
|
|
266
|
+
# 🎯 Set model (auto-selects provider!)
|
|
267
|
+
megabuff config model claude-sonnet-4-5 # → Anthropic
|
|
268
|
+
megabuff config model gpt-4o # → OpenAI
|
|
269
|
+
megabuff config model gemini-1.5-pro # → Google
|
|
270
|
+
megabuff config model # Show current
|
|
271
|
+
```
|
|
233
272
|
|
|
234
|
-
|
|
273
|
+
**View Everything:**
|
|
274
|
+
```bash
|
|
275
|
+
# 📊 Show complete configuration
|
|
235
276
|
megabuff config show
|
|
236
|
-
|
|
237
|
-
# Remove a saved token
|
|
238
|
-
megabuff config remove --provider anthropic
|
|
239
277
|
```
|
|
240
278
|
|
|
241
|
-
### Available Models
|
|
279
|
+
### 🤖 Available Models
|
|
242
280
|
|
|
243
281
|
**OpenAI:**
|
|
244
282
|
- `gpt-4o`
|
|
@@ -262,186 +300,196 @@ megabuff config remove --provider anthropic
|
|
|
262
300
|
- `gemini-1.5-flash` (default for Google)
|
|
263
301
|
- `gemini-1.0-pro`
|
|
264
302
|
|
|
265
|
-
|
|
303
|
+
---
|
|
266
304
|
|
|
267
|
-
|
|
305
|
+
## 🎨 Theme Commands
|
|
268
306
|
|
|
269
|
-
|
|
270
|
-
npm install
|
|
307
|
+
**Make your CLI experience uniquely yours!** Choose from 16 stunning color themes. ✨
|
|
271
308
|
|
|
272
|
-
|
|
273
|
-
npm run dev optimize "Write a function to sort arrays"
|
|
309
|
+
### 👀 View Current Theme
|
|
274
310
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
# Or install locally as a global command
|
|
279
|
-
npm link
|
|
280
|
-
megabuff optimize "Your prompt here"
|
|
311
|
+
```bash
|
|
312
|
+
megabuff theme
|
|
281
313
|
```
|
|
282
314
|
|
|
283
|
-
|
|
315
|
+
Shows your active theme with a beautiful preview! 🌈
|
|
284
316
|
|
|
285
|
-
|
|
317
|
+
### 📋 List All Themes
|
|
286
318
|
|
|
287
319
|
```bash
|
|
288
|
-
|
|
320
|
+
megabuff theme list
|
|
289
321
|
```
|
|
290
322
|
|
|
291
|
-
|
|
323
|
+
Browse all 16 themes with:
|
|
324
|
+
- ⭐ Your active theme highlighted
|
|
325
|
+
- Live color previews
|
|
326
|
+
- Theme descriptions
|
|
292
327
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
Install the CLI globally on your machine for testing:
|
|
328
|
+
### 🎭 Change Theme
|
|
296
329
|
|
|
297
330
|
```bash
|
|
298
|
-
|
|
331
|
+
megabuff theme set dracula # 🧛♂️ Dark & mysterious
|
|
332
|
+
megabuff theme set cyberpunk # 🌆 Neon future vibes
|
|
333
|
+
megabuff theme set pastel-rainbow # 🌈 Soft & dreamy
|
|
299
334
|
```
|
|
300
335
|
|
|
301
|
-
|
|
336
|
+
Your choice is saved and applied to all commands instantly!
|
|
302
337
|
|
|
303
|
-
|
|
338
|
+
### 🔍 Preview Theme
|
|
304
339
|
|
|
305
|
-
|
|
340
|
+
Try before you apply:
|
|
306
341
|
|
|
307
342
|
```bash
|
|
308
|
-
megabuff
|
|
343
|
+
megabuff theme preview monokai
|
|
309
344
|
```
|
|
310
345
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
```bash
|
|
314
|
-
megabuff optimize --file prompt.txt
|
|
315
|
-
```
|
|
346
|
+
See the full color palette in action before committing! 🎨
|
|
316
347
|
|
|
317
|
-
###
|
|
348
|
+
### 🌟 Available Themes
|
|
318
349
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
350
|
+
| Theme | Vibe | Description |
|
|
351
|
+
|-------|------|-------------|
|
|
352
|
+
| 🎯 **default** | Clean & Pro | Cyan and green palette |
|
|
353
|
+
| 🎨 **material** | Modern | Google Material Design |
|
|
354
|
+
| 🧛♂️ **dracula** | Dark & Gothic | Purple and pink accents |
|
|
355
|
+
| ❄️ **nord** | Arctic | Cool bluish tones |
|
|
356
|
+
| ☀️ **solarized** | Precision | Perfect balance |
|
|
357
|
+
| 🎸 **monokai** | Vibrant | Monokai Pro inspired |
|
|
358
|
+
| 🌆 **cyberpunk** | Futuristic | Neon city lights |
|
|
359
|
+
| 🌅 **sunset** | Warm | Oranges & purples |
|
|
360
|
+
| 🌈 **pastel-rainbow** | Dreamy | Soft rainbow hues |
|
|
361
|
+
| 🍬 **bubblegum** | Sweet | All the pink vibes |
|
|
362
|
+
| 🍭 **cotton-candy** | Fluffy | Pink meets blue |
|
|
363
|
+
| 🦄 **unicorn** | Magical | Pastel paradise |
|
|
364
|
+
| 🌊 **ocean** | Aquatic | Deep blue serenity |
|
|
365
|
+
| 🌲 **forest** | Natural | Earthy greens |
|
|
366
|
+
| 📺 **retro** | Nostalgic | 80s terminal style |
|
|
367
|
+
| ⚡ **neon-dreams** | Electric | Vibrant neons |
|
|
323
368
|
|
|
324
|
-
|
|
369
|
+
**Every theme is optimized for readability and style!** 🎨✨
|
|
325
370
|
|
|
326
|
-
|
|
327
|
-
megabuff optimize
|
|
328
|
-
# Then paste/type your prompt and press Ctrl+D when done
|
|
329
|
-
```
|
|
371
|
+
---
|
|
330
372
|
|
|
331
|
-
##
|
|
373
|
+
## 💡 Usage
|
|
332
374
|
|
|
333
|
-
|
|
375
|
+
**MegaBuff is flexible!** Use whichever input method works best for you:
|
|
334
376
|
|
|
335
|
-
|
|
336
|
-
1. Printed to stdout (so you can pipe it)
|
|
337
|
-
2. Automatically copied to your clipboard (works on macOS, Windows, and Linux)
|
|
377
|
+
### 1️⃣ Inline (Fastest!)
|
|
338
378
|
|
|
339
379
|
```bash
|
|
340
|
-
megabuff optimize "
|
|
341
|
-
# Result is both printed AND copied to clipboard
|
|
380
|
+
megabuff optimize "Write a function that validates emails"
|
|
342
381
|
```
|
|
343
382
|
|
|
344
|
-
###
|
|
345
|
-
|
|
346
|
-
If you don't want automatic clipboard copy:
|
|
383
|
+
### 2️⃣ From a File
|
|
347
384
|
|
|
348
385
|
```bash
|
|
349
|
-
megabuff optimize
|
|
386
|
+
megabuff optimize --file my-prompt.txt
|
|
350
387
|
```
|
|
351
388
|
|
|
352
|
-
###
|
|
389
|
+
### 3️⃣ Pipe It In
|
|
353
390
|
|
|
354
391
|
```bash
|
|
355
|
-
|
|
356
|
-
|
|
392
|
+
echo "Explain quantum computing" | megabuff optimize
|
|
393
|
+
cat prompt.txt | megabuff optimize
|
|
357
394
|
```
|
|
358
395
|
|
|
359
|
-
### Interactive
|
|
396
|
+
### 4️⃣ Interactive Mode
|
|
360
397
|
|
|
361
398
|
```bash
|
|
362
|
-
megabuff optimize
|
|
363
|
-
#
|
|
399
|
+
megabuff optimize
|
|
400
|
+
# Type/paste your prompt, then Ctrl+D ✨
|
|
364
401
|
```
|
|
365
402
|
|
|
366
|
-
###
|
|
403
|
+
### 📤 Output Options
|
|
404
|
+
|
|
405
|
+
**By default, MegaBuff does BOTH:**
|
|
406
|
+
- ✅ Prints to stdout (for piping)
|
|
407
|
+
- ✅ Copies to clipboard (instant paste!)
|
|
408
|
+
|
|
409
|
+
**Customize the output:**
|
|
367
410
|
|
|
368
411
|
```bash
|
|
369
|
-
#
|
|
370
|
-
megabuff optimize "
|
|
412
|
+
# Don't copy to clipboard
|
|
413
|
+
megabuff optimize "prompt" --no-copy
|
|
371
414
|
|
|
372
|
-
#
|
|
373
|
-
megabuff optimize "
|
|
415
|
+
# Save to file (still copies by default)
|
|
416
|
+
megabuff optimize "prompt" --output result.txt
|
|
374
417
|
|
|
375
|
-
#
|
|
376
|
-
megabuff optimize "
|
|
418
|
+
# Interactive before/after view
|
|
419
|
+
megabuff optimize "prompt" --interactive
|
|
420
|
+
|
|
421
|
+
# Save without clipboard
|
|
422
|
+
megabuff optimize "prompt" -o result.txt --no-copy
|
|
377
423
|
```
|
|
378
424
|
|
|
379
|
-
|
|
425
|
+
---
|
|
426
|
+
|
|
427
|
+
## 🎯 Examples
|
|
428
|
+
|
|
429
|
+
**Real-world use cases to get you started:**
|
|
380
430
|
|
|
381
431
|
```bash
|
|
382
|
-
# Quick
|
|
432
|
+
# 🚀 Quick optimization
|
|
383
433
|
megabuff optimize "Write code for user auth"
|
|
384
434
|
|
|
385
|
-
# Use
|
|
386
|
-
megabuff optimize --provider anthropic "
|
|
435
|
+
# 🧠 Use Claude for better reasoning
|
|
436
|
+
megabuff optimize --provider anthropic "Explain recursion"
|
|
387
437
|
|
|
388
|
-
#
|
|
389
|
-
megabuff optimize --provider google "
|
|
438
|
+
# ✨ Try Gemini
|
|
439
|
+
megabuff optimize --provider google "Design a database schema"
|
|
390
440
|
|
|
391
|
-
# From file with
|
|
392
|
-
megabuff optimize --file
|
|
441
|
+
# 📁 From a file with before/after comparison
|
|
442
|
+
megabuff optimize --file prompt.txt --interactive
|
|
393
443
|
|
|
394
|
-
# Pipe and save
|
|
444
|
+
# 🔄 Pipe and save
|
|
395
445
|
cat input.txt | megabuff optimize --output optimized.txt
|
|
396
446
|
|
|
397
|
-
#
|
|
398
|
-
megabuff
|
|
447
|
+
# 🎯 Use a specific model
|
|
448
|
+
megabuff config model claude-sonnet-4-5
|
|
449
|
+
megabuff optimize "Explain quantum computing"
|
|
399
450
|
|
|
400
|
-
#
|
|
401
|
-
megabuff
|
|
451
|
+
# 🎨 Make it pretty!
|
|
452
|
+
megabuff theme set cyberpunk # Set theme
|
|
453
|
+
megabuff theme preview dracula # Preview first
|
|
454
|
+
megabuff theme list # See all options
|
|
402
455
|
|
|
403
|
-
#
|
|
404
|
-
megabuff optimize
|
|
456
|
+
# 🔧 Power user combos
|
|
457
|
+
megabuff optimize --file long-prompt.txt --provider anthropic -o result.txt --interactive
|
|
458
|
+
```
|
|
405
459
|
|
|
406
|
-
|
|
407
|
-
megabuff config provider anthropic
|
|
408
|
-
megabuff optimize "Rewrite this prompt to be clearer"
|
|
460
|
+
---
|
|
409
461
|
|
|
410
|
-
|
|
411
|
-
megabuff config model claude-sonnet-4-5
|
|
412
|
-
megabuff optimize "Explain quantum computing"
|
|
462
|
+
## 🔧 How It Works
|
|
413
463
|
|
|
414
|
-
|
|
415
|
-
megabuff config model gemini-1.5-pro
|
|
416
|
-
megabuff optimize "Explain quantum computing"
|
|
417
|
-
```
|
|
464
|
+
**The Magic Behind MegaBuff** ✨
|
|
418
465
|
|
|
419
|
-
|
|
466
|
+
MegaBuff uses state-of-the-art AI to transform your prompts:
|
|
420
467
|
|
|
421
|
-
|
|
468
|
+
### 🎯 What Gets Optimized?
|
|
422
469
|
|
|
423
|
-
**
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
470
|
+
1. **Clarity** - Removes ambiguity and vague instructions
|
|
471
|
+
2. **Context** - Adds missing details that improve results
|
|
472
|
+
3. **Structure** - Organizes information logically
|
|
473
|
+
4. **Format** - Specifies expected output clearly
|
|
474
|
+
5. **Specificity** - Makes requests actionable and precise
|
|
427
475
|
|
|
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
|
|
476
|
+
### 🤖 Choose Your AI
|
|
434
477
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
478
|
+
| Provider | Best For | Default Model |
|
|
479
|
+
|----------|----------|---------------|
|
|
480
|
+
| 🤖 **OpenAI** | Fast & economical | GPT-4o-mini |
|
|
481
|
+
| 🧠 **Anthropic** | Deep reasoning | Claude Sonnet 4.5 |
|
|
482
|
+
| ✨ **Google** | Efficient & quality | Gemini 1.5 Flash |
|
|
439
483
|
|
|
440
|
-
|
|
484
|
+
**Switch providers anytime** with `--provider` or set your favorite as default!
|
|
441
485
|
|
|
442
|
-
|
|
486
|
+
---
|
|
443
487
|
|
|
444
|
-
|
|
488
|
+
## 🆚 VS Code Integration
|
|
489
|
+
|
|
490
|
+
**Use MegaBuff right inside VS Code!** 🎉
|
|
491
|
+
|
|
492
|
+
### ⭐ Option 1: VS Code Extension (Full Experience)
|
|
445
493
|
|
|
446
494
|
Install and develop the MegaBuff VS Code extension:
|
|
447
495
|
|
|
@@ -463,131 +511,174 @@ Then press `F5` to launch the extension in debug mode.
|
|
|
463
511
|
|
|
464
512
|
See [megabuff-vscode/README.md](../megabuff-vscode/README.md) for more details.
|
|
465
513
|
|
|
466
|
-
### Option 2: VS Code Tasks (Quick Setup)
|
|
514
|
+
### 🚀 Option 2: VS Code Tasks (Quick Setup)
|
|
467
515
|
|
|
468
|
-
|
|
516
|
+
Pre-configured tasks for instant productivity:
|
|
469
517
|
|
|
470
|
-
1. Select text
|
|
471
|
-
2.
|
|
472
|
-
3.
|
|
518
|
+
1. Select text
|
|
519
|
+
2. `Ctrl+Shift+P` → "Tasks: Run Task"
|
|
520
|
+
3. Pick a MegaBuff task
|
|
473
521
|
|
|
474
|
-
Available
|
|
475
|
-
-
|
|
476
|
-
-
|
|
477
|
-
-
|
|
478
|
-
-
|
|
522
|
+
**Available Tasks:**
|
|
523
|
+
- ✨ Optimize Selected Text
|
|
524
|
+
- 📄 Optimize Current File
|
|
525
|
+
- 🔍 Optimize (Interactive View)
|
|
526
|
+
- ⚙️ Configure API Key
|
|
479
527
|
|
|
480
|
-
### Option 3: Terminal Integration
|
|
528
|
+
### 💻 Option 3: Terminal Integration
|
|
481
529
|
|
|
482
|
-
|
|
530
|
+
Just use the integrated terminal:
|
|
483
531
|
|
|
484
532
|
```bash
|
|
485
|
-
# Select text, then in terminal:
|
|
486
533
|
pbpaste | megabuff optimize # macOS
|
|
487
534
|
xclip -o | megabuff optimize # Linux
|
|
488
535
|
```
|
|
489
536
|
|
|
490
|
-
|
|
537
|
+
---
|
|
491
538
|
|
|
492
|
-
|
|
539
|
+
## 🤝 Contributing
|
|
493
540
|
|
|
494
|
-
|
|
541
|
+
**We'd love your help making MegaBuff better!**
|
|
495
542
|
|
|
496
|
-
|
|
543
|
+
Found a bug? Have an idea? Open an issue:
|
|
497
544
|
|
|
498
|
-
|
|
545
|
+
👉 [GitHub Issues](https://github.com/thesupermegabuff/megabuff-cli/issues)
|
|
499
546
|
|
|
500
|
-
|
|
547
|
+
---
|
|
501
548
|
|
|
502
|
-
|
|
503
|
-
```bash
|
|
504
|
-
npm login
|
|
505
|
-
```
|
|
549
|
+
## 📄 License
|
|
506
550
|
|
|
507
|
-
|
|
508
|
-
- Change `author` to your name and email
|
|
509
|
-
- Update `repository` URL with your GitHub username
|
|
510
|
-
- Update `bugs` and `homepage` URLs
|
|
551
|
+
**MegaBuff is open source!** Licensed under **AGPL-3.0**
|
|
511
552
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
553
|
+
**What this means:**
|
|
554
|
+
- ✅ **Free to use** - For any purpose
|
|
555
|
+
- ✅ **Free to modify** - Make it your own
|
|
556
|
+
- ✅ **Free to share** - Spread the love
|
|
557
|
+
- 🔓 **Open source required** - Derivative works must stay open
|
|
558
|
+
- 🌐 **Service transparency** - If you run it as a service, share the code
|
|
517
559
|
|
|
518
|
-
|
|
560
|
+
[Read the full license](LICENSE)
|
|
519
561
|
|
|
520
|
-
|
|
521
|
-
```bash
|
|
522
|
-
git status
|
|
523
|
-
git add .
|
|
524
|
-
git commit -m "Prepare for publish"
|
|
525
|
-
```
|
|
562
|
+
---
|
|
526
563
|
|
|
527
|
-
|
|
528
|
-
```bash
|
|
529
|
-
npm version minor
|
|
530
|
-
npm run build
|
|
531
|
-
```
|
|
532
|
-
This compiles TypeScript to JavaScript in the `dist/` folder
|
|
564
|
+
## 👨💻 Development
|
|
533
565
|
|
|
534
|
-
|
|
535
|
-
```bash
|
|
536
|
-
npm pack
|
|
537
|
-
# This creates a .tgz file you can inspect
|
|
538
|
-
```
|
|
566
|
+
**Want to contribute or build from source?**
|
|
539
567
|
|
|
540
|
-
|
|
541
|
-
```bash
|
|
542
|
-
npm publish
|
|
543
|
-
```
|
|
568
|
+
### 🔧 Local Development
|
|
544
569
|
|
|
545
|
-
|
|
570
|
+
```bash
|
|
571
|
+
# Clone the repo
|
|
572
|
+
git clone https://github.com/thesupermegabuff/megabuff-cli.git
|
|
573
|
+
cd megabuff-cli
|
|
546
574
|
|
|
547
|
-
|
|
575
|
+
# Install dependencies
|
|
576
|
+
npm install
|
|
548
577
|
|
|
549
|
-
|
|
578
|
+
# Run in dev mode
|
|
579
|
+
npm run dev optimize "Your prompt"
|
|
550
580
|
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
npm version patch
|
|
581
|
+
# Or use tsx directly
|
|
582
|
+
npx tsx src/index.ts optimize "Your prompt"
|
|
583
|
+
```
|
|
555
584
|
|
|
556
|
-
|
|
557
|
-
|
|
585
|
+
### 📦 Build & Publish
|
|
586
|
+
|
|
587
|
+
**Building the project:**
|
|
588
|
+
|
|
589
|
+
```bash
|
|
590
|
+
npm run build # Compiles TypeScript to dist/
|
|
591
|
+
```
|
|
558
592
|
|
|
559
|
-
|
|
560
|
-
npm version major
|
|
561
|
-
```
|
|
593
|
+
**Version and build:**
|
|
562
594
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
595
|
+
```bash
|
|
596
|
+
npm version minor # Bump version (patch/minor/major)
|
|
597
|
+
npm run build # Compile TypeScript
|
|
598
|
+
```
|
|
567
599
|
|
|
568
|
-
|
|
569
|
-
```bash
|
|
570
|
-
git push && git push --tags
|
|
571
|
-
```
|
|
600
|
+
This compiles TypeScript to JavaScript in the `dist/` folder.
|
|
572
601
|
|
|
573
|
-
|
|
602
|
+
**Test the package locally** (optional but recommended):
|
|
574
603
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
- ✅ `LICENSE` - License file
|
|
580
|
-
- ❌ `src/` - TypeScript source (excluded)
|
|
581
|
-
- ❌ `node_modules/` - Dependencies (excluded)
|
|
582
|
-
- ❌ Development files (excluded via .npmignore)
|
|
604
|
+
```bash
|
|
605
|
+
npm pack
|
|
606
|
+
# This creates a .tgz file you can inspect
|
|
607
|
+
```
|
|
583
608
|
|
|
584
|
-
|
|
609
|
+
**Test locally with npm link:**
|
|
585
610
|
|
|
586
|
-
|
|
611
|
+
```bash
|
|
612
|
+
npm link # Install as global command
|
|
613
|
+
megabuff optimize "Test it out!"
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
**Publish to npm:**
|
|
617
|
+
|
|
618
|
+
```bash
|
|
619
|
+
npm publish
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
The `prepublishOnly` script will automatically run `npm run build` before publishing.
|
|
623
|
+
|
|
624
|
+
---
|
|
625
|
+
|
|
626
|
+
## 📚 Publishing to npm
|
|
627
|
+
|
|
628
|
+
<details>
|
|
629
|
+
<summary><b>📦 Publishing Guide (For Maintainers)</b></summary>
|
|
630
|
+
|
|
631
|
+
### 🎯 First-time Setup
|
|
632
|
+
|
|
633
|
+
1. Create an [npm account](https://www.npmjs.com/signup)
|
|
634
|
+
2. Login: `npm login`
|
|
635
|
+
3. Update `package.json` with your details
|
|
636
|
+
4. Check name availability: `npm search megabuff`
|
|
637
|
+
|
|
638
|
+
### 🚀 Publishing Process
|
|
639
|
+
|
|
640
|
+
```bash
|
|
641
|
+
# 1. Commit changes
|
|
642
|
+
git add .
|
|
643
|
+
git commit -m "Release preparation"
|
|
644
|
+
|
|
645
|
+
# 2. Bump version (patch/minor/major)
|
|
646
|
+
npm version minor
|
|
647
|
+
|
|
648
|
+
# 3. Publish!
|
|
649
|
+
npm publish
|
|
650
|
+
|
|
651
|
+
# 4. Push tags
|
|
652
|
+
git push && git push --tags
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
### 📦 What Gets Published
|
|
656
|
+
|
|
657
|
+
- ✅ Compiled JavaScript (`dist/`)
|
|
658
|
+
- ✅ Documentation
|
|
659
|
+
- ✅ Package metadata
|
|
660
|
+
- ❌ TypeScript source
|
|
661
|
+
- ❌ Dev dependencies
|
|
662
|
+
|
|
663
|
+
### 🎉 After Publishing
|
|
664
|
+
|
|
665
|
+
Users install with:
|
|
587
666
|
```bash
|
|
588
667
|
npm install -g megabuff
|
|
589
668
|
```
|
|
590
669
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
670
|
+
Available at: [npmjs.com/package/megabuff](https://www.npmjs.com/package/megabuff)
|
|
671
|
+
|
|
672
|
+
</details>
|
|
673
|
+
|
|
674
|
+
---
|
|
675
|
+
|
|
676
|
+
<div align="center">
|
|
677
|
+
|
|
678
|
+
**Made with ❤️ by the MegaBuff Team**
|
|
679
|
+
|
|
680
|
+
⭐ **Star us on [GitHub](https://github.com/thesupermegabuff/megabuff-cli)!**
|
|
681
|
+
|
|
682
|
+
🐛 [Report Issues](https://github.com/thesupermegabuff/megabuff-cli/issues) • 💡 [Request Features](https://github.com/thesupermegabuff/megabuff-cli/issues)
|
|
683
|
+
|
|
684
|
+
</div>
|