@vibe-db/cli 1.0.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/BILLING_CLI.md +198 -0
- package/PUBLISHING.md +558 -0
- package/README.md +206 -0
- package/bin/vibedb.js +139 -0
- package/package.json +35 -0
- package/package.json.bak +35 -0
- package/src/api.js +196 -0
- package/src/commands/billing-cancel.js +89 -0
- package/src/commands/billing-info.js +101 -0
- package/src/commands/billing-invoices.js +103 -0
- package/src/commands/billing-subscribe.js +103 -0
- package/src/commands/init.js +62 -0
- package/src/commands/list.js +73 -0
- package/src/commands/login.js +53 -0
- package/src/commands/signup.js +73 -0
- package/src/config.js +78 -0
package/BILLING_CLI.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# VibeDB CLI - Billing Commands
|
|
2
|
+
|
|
3
|
+
The VibeDB CLI now includes full billing management capabilities!
|
|
4
|
+
|
|
5
|
+
## Available Commands
|
|
6
|
+
|
|
7
|
+
### View Billing Information
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
vibedb billing info
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Shows:
|
|
14
|
+
- Stripe customer ID
|
|
15
|
+
- Current subscription status
|
|
16
|
+
- Payment method on file
|
|
17
|
+
- Upcoming invoice details
|
|
18
|
+
|
|
19
|
+
**Example output:**
|
|
20
|
+
```
|
|
21
|
+
💳 Billing Information
|
|
22
|
+
|
|
23
|
+
Stripe Customer ID: cus_TlhoFBgSVv10yz
|
|
24
|
+
|
|
25
|
+
Subscription:
|
|
26
|
+
Status: ● Active
|
|
27
|
+
Period: Jan 10, 2026 → Feb 10, 2026
|
|
28
|
+
|
|
29
|
+
Payment Method:
|
|
30
|
+
Card: visa ****4242
|
|
31
|
+
Expires: 12/2025
|
|
32
|
+
|
|
33
|
+
Upcoming Invoice:
|
|
34
|
+
Amount: $10.00
|
|
35
|
+
Period: Feb 10, 2026 → Mar 10, 2026
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Subscribe
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
vibedb billing subscribe
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Creates a new subscription with interactive prompts:
|
|
45
|
+
- Checks if you already have an active subscription
|
|
46
|
+
- Verifies payment method is on file
|
|
47
|
+
- Confirms before creating subscription
|
|
48
|
+
- Shows subscription details on success
|
|
49
|
+
|
|
50
|
+
**Note:** You need to add a payment method in the Stripe dashboard first.
|
|
51
|
+
|
|
52
|
+
### Cancel Subscription
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
vibedb billing cancel
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Cancels your subscription with confirmation:
|
|
59
|
+
- Shows current subscription details
|
|
60
|
+
- Warns about access ending at period end
|
|
61
|
+
- Requires confirmation
|
|
62
|
+
- Subscription remains active until period end
|
|
63
|
+
|
|
64
|
+
### View Invoices
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
vibedb billing invoices
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Lists all your invoices in a table format:
|
|
71
|
+
- Date
|
|
72
|
+
- Amount
|
|
73
|
+
- Status (paid/open/unpaid)
|
|
74
|
+
- Billing period
|
|
75
|
+
- PDF download link for latest invoice
|
|
76
|
+
|
|
77
|
+
**Example output:**
|
|
78
|
+
```
|
|
79
|
+
📄 Your Invoices
|
|
80
|
+
|
|
81
|
+
┌───────────────┬────────────┬────────────┬──────────────────────────────┐
|
|
82
|
+
│ Date │ Amount │ Status │ Period │
|
|
83
|
+
├───────────────┼────────────┼────────────┼──────────────────────────────┤
|
|
84
|
+
│ Jan 10, 2026 │ $10.00 │ paid │ Jan 10 - Feb 10 │
|
|
85
|
+
│ Dec 10, 2025 │ $10.00 │ paid │ Dec 10 - Jan 10 │
|
|
86
|
+
└───────────────┴────────────┴────────────┴──────────────────────────────┘
|
|
87
|
+
|
|
88
|
+
Total: 2 invoices
|
|
89
|
+
Latest invoice PDF: https://...
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Quick Start
|
|
93
|
+
|
|
94
|
+
1. **Sign up or login:**
|
|
95
|
+
```bash
|
|
96
|
+
vibedb signup
|
|
97
|
+
# or
|
|
98
|
+
vibedb login
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
2. **Check billing status:**
|
|
102
|
+
```bash
|
|
103
|
+
vibedb billing info
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
3. **Add payment method:**
|
|
107
|
+
- Go to Stripe dashboard
|
|
108
|
+
- Find your customer (search by email)
|
|
109
|
+
- Add payment method (test card: 4242 4242 4242 4242)
|
|
110
|
+
|
|
111
|
+
4. **Subscribe:**
|
|
112
|
+
```bash
|
|
113
|
+
vibedb billing subscribe
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
5. **View invoices:**
|
|
117
|
+
```bash
|
|
118
|
+
vibedb billing invoices
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Error Handling
|
|
122
|
+
|
|
123
|
+
All commands gracefully handle common errors:
|
|
124
|
+
|
|
125
|
+
- **Not logged in:** Prompts to run `vibedb login` or `vibedb signup`
|
|
126
|
+
- **Billing not configured:** Shows warning that Stripe isn't set up on server
|
|
127
|
+
- **No payment method:** Provides instructions for adding one
|
|
128
|
+
- **Already subscribed:** Shows current subscription details
|
|
129
|
+
- **No subscription:** Shows helpful message about subscribing
|
|
130
|
+
|
|
131
|
+
## Full Command List
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
vibedb billing --help
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Shows:
|
|
138
|
+
```
|
|
139
|
+
Usage: vibedb billing [options] [command]
|
|
140
|
+
|
|
141
|
+
Manage billing and subscriptions
|
|
142
|
+
|
|
143
|
+
Commands:
|
|
144
|
+
info View billing information and subscription status
|
|
145
|
+
subscribe Subscribe to VibeDB
|
|
146
|
+
cancel Cancel your subscription
|
|
147
|
+
invoices View your invoices
|
|
148
|
+
help [command] display help for command
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Test Cards (Stripe Test Mode)
|
|
152
|
+
|
|
153
|
+
When testing subscriptions, use these test cards:
|
|
154
|
+
|
|
155
|
+
- **Success:** 4242 4242 4242 4242
|
|
156
|
+
- **Declined:** 4000 0000 0000 0002
|
|
157
|
+
- **Requires 3DS:** 4000 0027 6000 3184
|
|
158
|
+
|
|
159
|
+
Any future expiry date and any 3-digit CVC will work.
|
|
160
|
+
|
|
161
|
+
## Integration with AI Assistants
|
|
162
|
+
|
|
163
|
+
The CLI billing commands work great in AI-assisted development workflows:
|
|
164
|
+
|
|
165
|
+
**Tell your AI:**
|
|
166
|
+
```
|
|
167
|
+
"Check my VibeDB billing status"
|
|
168
|
+
"Subscribe me to VibeDB"
|
|
169
|
+
"Show my VibeDB invoices"
|
|
170
|
+
"Cancel my VibeDB subscription"
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The AI assistant can run these commands and show you the results!
|
|
174
|
+
|
|
175
|
+
## Files Added
|
|
176
|
+
|
|
177
|
+
New command files:
|
|
178
|
+
- `/cli/src/commands/billing-info.js` - View billing info
|
|
179
|
+
- `/cli/src/commands/billing-subscribe.js` - Subscribe
|
|
180
|
+
- `/cli/src/commands/billing-cancel.js` - Cancel subscription
|
|
181
|
+
- `/cli/src/commands/billing-invoices.js` - View invoices
|
|
182
|
+
|
|
183
|
+
Updated files:
|
|
184
|
+
- `/cli/bin/vibedb.js` - Added billing subcommands
|
|
185
|
+
- `/cli/src/api.js` - Added billing API methods
|
|
186
|
+
|
|
187
|
+
## Next Steps
|
|
188
|
+
|
|
189
|
+
- ✅ All billing commands working
|
|
190
|
+
- ✅ Full error handling
|
|
191
|
+
- ✅ Pretty formatted output with colors and tables
|
|
192
|
+
- ✅ Interactive confirmations for destructive actions
|
|
193
|
+
- 🔜 Add payment method via CLI (future enhancement)
|
|
194
|
+
- 🔜 Update subscription plan (future enhancement)
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
**The billing system is now fully manageable from the CLI!** 🎉
|