ckweb-cli 0.2.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 ADDED
@@ -0,0 +1,193 @@
1
+ # ckweb-cli
2
+
3
+ CLI tool for interacting with the [ClaudeKit.cc](https://claudekit.cc) API.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm install
9
+ pnpm build
10
+ pnpm link --global
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```bash
16
+ # Authenticate with your user API key
17
+ ckweb auth login
18
+
19
+ # Authenticate with admin API key
20
+ ckweb auth login --admin
21
+
22
+ # Check API health
23
+ ckweb health
24
+
25
+ # YouTube tools
26
+ ckweb youtube info "https://youtube.com/watch?v=..."
27
+ ckweb yt search "typescript tutorial"
28
+
29
+ # Website analysis
30
+ ckweb web review "https://example.com"
31
+ ckweb web convert "https://example.com"
32
+
33
+ # SEO insights
34
+ ckweb seo keywords "react framework"
35
+ ckweb seo traffic "example.com"
36
+ ```
37
+
38
+ ## Commands
39
+
40
+ ### Authentication
41
+ | Command | Description |
42
+ |---------|-------------|
43
+ | `auth login [--admin]` | Authenticate with API key |
44
+ | `auth validate [--admin]` | Validate stored key |
45
+ | `auth logout [--admin\|--all]` | Remove stored key(s) |
46
+ | `auth status` | Show authentication status |
47
+
48
+ ### Orders & Payments
49
+ | Command | Description |
50
+ |---------|-------------|
51
+ | `orders get <id>` | Get order details |
52
+ | `orders status <id>` | Check order status |
53
+ | `checkout polar` | Create Polar checkout (USD) |
54
+ | `checkout sepay` | Create SePay checkout (VND) |
55
+ | `refunds request <orderId>` | Request a refund |
56
+
57
+ ### Account
58
+ | Command | Description |
59
+ |---------|-------------|
60
+ | `account export-data` | Export your data (GDPR) |
61
+ | `account delete` | Delete your account (GDPR) |
62
+ | `account update-github <userId>` | Update GitHub username |
63
+
64
+ ### Referrals & Payouts
65
+ | Command | Description |
66
+ |---------|-------------|
67
+ | `referrals dashboard` | View referral stats |
68
+ | `referrals request-payout` | Request payout |
69
+ | `referrals payout-history` | View payout history |
70
+ | `payout profile` | View payout profiles |
71
+ | `payout create-profile` | Create payout profile |
72
+ | `payout delete-profile` | Delete payout profile |
73
+
74
+ ### Content
75
+ | Command | Description |
76
+ |---------|-------------|
77
+ | `blog list` | List blog articles |
78
+ | `blog get <id>` | Get article details |
79
+ | `releases list [--tab]` | List product releases |
80
+
81
+ ### Proxy Services (YouTube, Web, SEO)
82
+ | Command | Description |
83
+ |---------|-------------|
84
+ | `youtube info\|caption\|summary\|screenshot\|search\|comments` | YouTube tools |
85
+ | `web review\|scrape\|extract\|convert\|summarize\|screenshot` | Website tools |
86
+ | `seo keywords\|difficulty\|traffic\|backlinks` | SEO tools |
87
+
88
+ ### Pricing & Info
89
+ | Command | Description |
90
+ |---------|-------------|
91
+ | `pricing validate-discount <code>` | Validate discount code |
92
+ | `pricing exchange-rate` | Get USD/VND rate |
93
+ | `pricing early-access` | Early access status |
94
+ | `loyalty eligibility` | Check loyalty eligibility |
95
+ | `stats users` | Platform user count |
96
+
97
+ ### Other
98
+ | Command | Description |
99
+ |---------|-------------|
100
+ | `github invite\|revoke` | GitHub repo access |
101
+ | `newsletter subscribe\|unsubscribe` | Newsletter management |
102
+ | `waitlist join` | Join product waitlist |
103
+ | `health` | Check API health |
104
+
105
+ ### Admin Commands (requires `ck_admin_*` key)
106
+ | Group | Commands |
107
+ |-------|----------|
108
+ | `admin orders` | list, get, complete, refund, refund-keep-access, switch-product, resend-emails, export |
109
+ | `admin users` | get, update-github, update-rates, set-tier, export |
110
+ | `admin referrals` | stats, diagnose, export, tiers-stats |
111
+ | `admin revenue` | stats, export, maintainer, costs, add-cost, update-cost, delete-cost, reports |
112
+ | `admin payouts` | list, update, export, export-detailed, request-csv |
113
+ | `admin loyalty` | stats, blast-email |
114
+ | `admin blog` | create, update, delete, publish, ai-generate, ai-transform, generate-metadata, upload-url, export |
115
+ | `admin keys` | list, create, validate, revoke, rotate |
116
+ | `admin invites` | list, create, get, delete, resend, accept, validate |
117
+ | `admin admins` | list, get, promote, demote, permissions |
118
+ | `admin discounts` | list, create, update, delete, export |
119
+ | `admin tiers` | list |
120
+
121
+ ## Authentication
122
+
123
+ Two types of API keys:
124
+ - **User key** (`ck_live_*`): For user-facing operations
125
+ - **Admin key** (`ck_admin_*`): For admin operations
126
+
127
+ ```bash
128
+ ckweb auth login # User key
129
+ ckweb auth login --admin # Admin key
130
+ ckweb auth status # Show stored keys
131
+ ```
132
+
133
+ Config stored at `~/.config/ckweb-cli/config.json`.
134
+
135
+ ### Env var resolution (priority)
136
+
137
+ Keys and base URL resolve in this order (first match wins):
138
+
139
+ 1. **OS-level env** — `export CKWEB_API_KEY=…` / `CKWEB_ADMIN_API_KEY=…` / `CKWEB_API_URL=…`
140
+ 2. **Stored config** — values saved by `ckweb auth login` (or `login --admin`)
141
+ 3. **.env.*** — `.env.local` → `.env` in current working directory
142
+
143
+ Env vars must match key format (`ck_live_…` / `ck_admin_…`) or they are skipped.
144
+
145
+ ## Output Modes
146
+
147
+ All commands support:
148
+ - `--json` — Raw JSON output (for piping/scripting)
149
+ - `--table` — Formatted table (default for lists)
150
+ - `--quiet` — Minimal output
151
+
152
+ ## Development
153
+
154
+ ```bash
155
+ pnpm install
156
+ pnpm dev # Watch mode
157
+ pnpm build # Production build
158
+ pnpm lint # Type check
159
+ pnpm test # Run tests
160
+ ```
161
+
162
+ ## Releasing
163
+
164
+ ### Auto bump (recommended)
165
+
166
+ Trigger the **Bump Version** workflow from the GitHub Actions tab:
167
+ - `auto` — detects type from conventional commits since last tag
168
+ (`feat:` → minor, `fix:`/`perf:` → patch, `BREAKING CHANGE`/`!:` → major)
169
+ - `patch` / `minor` / `major` — manual override
170
+
171
+ Pushing the new tag triggers the **Release** workflow automatically.
172
+
173
+ ### Manual bump
174
+
175
+ ```bash
176
+ npm version patch # or minor / major
177
+ git push --follow-tags
178
+ ```
179
+
180
+ ### Release workflow
181
+
182
+ `.github/workflows/release.yml` (triggered by `v*` tag):
183
+ 1. Verifies tag matches `package.json` version
184
+ 2. Runs `lint` + `test` + `build`
185
+ 3. Publishes to npm with provenance (requires `NPM_TOKEN` secret)
186
+ 4. Creates GitHub Release with auto-generated notes
187
+
188
+ ## Tech Stack
189
+
190
+ - TypeScript, Node.js 18+
191
+ - Commander.js (CLI framework)
192
+ - Conf (config storage)
193
+ - tsup (bundler)