@jawkit.cc/cli 0.1.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/LICENSE ADDED
@@ -0,0 +1,31 @@
1
+ JawKit CLI - Proprietary Software License
2
+
3
+ Copyright (c) 2024 JawKit. All rights reserved.
4
+
5
+ This software and associated documentation files (the "Software") are proprietary
6
+ and confidential. The Software is licensed, not sold.
7
+
8
+ PERMITTED:
9
+ - Install and use the Software for personal or commercial purposes
10
+ - Use the Software with a valid license key
11
+
12
+ PROHIBITED:
13
+ - Copy, modify, merge, or create derivative works of the Software
14
+ - Distribute, sublicense, sell, or transfer the Software to third parties
15
+ - Reverse engineer, decompile, or disassemble the Software
16
+ - Remove or alter any proprietary notices or labels on the Software
17
+ - Share, redistribute, or publish any content, prompts, skills, or configurations
18
+ downloaded or installed by the Software ("Content") with any third party
19
+ - Upload Content to public repositories, websites, or file sharing services
20
+ - Include Content in open source projects or public codebases
21
+
22
+ CONTENT RESTRICTIONS:
23
+ The Content provided through JawKit (including but not limited to prompts, skills,
24
+ commands, configurations, and documentation) is licensed for your personal or
25
+ internal business use only. Sharing Content with others who have not purchased
26
+ their own license is strictly prohibited and may result in license termination.
27
+
28
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
29
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY.
30
+
31
+ For licensing inquiries: support@jawkit.cc
package/README.md ADDED
@@ -0,0 +1,363 @@
1
+ # JawKit CLI
2
+
3
+ CLI toolkit for installing AI coding assistant configurations (Claude Code, GitHub Copilot).
4
+
5
+ ## Features
6
+
7
+ - **Multi-agent support**: Claude Code, GitHub Copilot
8
+ - **Tiered content**: Free and Professional ($99)
9
+ - **Secure delivery**: Signed URLs for premium content
10
+ - **Offline support**: Free tier bundled in npm package
11
+
12
+ ## Quick Start
13
+
14
+ ```bash
15
+ # Install globally
16
+ npm install -g @jawkit/cli
17
+
18
+ # Initialize in your project (free tier - no auth needed)
19
+ jawkit init
20
+
21
+ # For premium content, purchase at jawkit.dev and activate:
22
+ jawkit auth activate JAWKIT_YOUR_LICENSE_KEY
23
+
24
+ # Check license status
25
+ jawkit auth status
26
+ ```
27
+
28
+ ---
29
+
30
+ ## Technical Stack
31
+
32
+ ### CLI (Node.js)
33
+
34
+ | Component | Technology | Purpose |
35
+ |-----------|------------|---------|
36
+ | **Runtime** | Node.js 18+ | ES Modules |
37
+ | **CLI Framework** | Commander.js | Command parsing |
38
+ | **Build** | tsup | ES Module bundling |
39
+ | **HTTP Client** | ofetch | API requests |
40
+ | **Prompts** | @inquirer/prompts | Interactive CLI |
41
+ | **Archive** | tar (+ built-in zlib) | tar.gz extraction |
42
+ | **Logging** | chalk + ora | Colors, spinners |
43
+ | **Secure Storage** | keytar | OS keychain for tokens |
44
+
45
+ ### Backend Services
46
+
47
+ | Service | Technology | Purpose |
48
+ |---------|------------|---------|
49
+ | **Payments** | Paddle | Checkout, subscriptions |
50
+ | **License Data** | Cloudflare D1 | License keys, payments, invitations |
51
+ | **Content Storage** | Cloudflare R2 | Content bundles (tar.gz) |
52
+ | **API Gateway** | Cloudflare Workers | License validation, signed URLs, webhooks |
53
+ | **Email** | Resend | License delivery emails |
54
+
55
+ ### Architecture Overview
56
+
57
+ ```
58
+ ┌─────────────────────────────────────────────────────────────────────────────┐
59
+ │ JawKit CLI System │
60
+ ├─────────────────────────────────────────────────────────────────────────────┤
61
+ │ │
62
+ │ User's Machine Cloud Infrastructure │
63
+ │ ┌─────────────────┐ ┌─────────────────────────────┐ │
64
+ │ │ jawkit CLI │ │ Paddle │ │
65
+ │ │ (@jawkit/cli) │ │ ┌───────────────────────┐ │ │
66
+ │ │ │ │ │ • Checkout │ │ │
67
+ │ │ • init │ │ │ • Payment processing │ │ │
68
+ │ │ • auth activate│ │ └───────────┬───────────┘ │ │
69
+ │ │ • upgrade │ │ │ Webhook │ │
70
+ │ │ • version │ └──────────────┼──────────────┘ │
71
+ │ └────────┬────────┘ ▼ │
72
+ │ │ ┌─────────────────────────────┐ │
73
+ │ │ Validate license │ Cloudflare Workers │ │
74
+ │ │◄────────────────────────────────┤ ┌───────────────────────┐ │ │
75
+ │ │ Download content │ │ • Paddle webhook │ │ │
76
+ │ │ (signed URLs for premium) │ │ • License validation │ │ │
77
+ │ │ │ │ • Signed URL gen │ │ │
78
+ │ │ │ │ • D1 Database │ │ │
79
+ │ │ │ └───────────────────────┘ │ │
80
+ │ │ └──────────────┬──────────────┘ │
81
+ │ │ │ │ │
82
+ │ │ ▼ ▼ │
83
+ │ │ ┌─────────┐ ┌─────────────────┐ │
84
+ │ └─────────────────────────────────┤ R2 │ │ D1 │ │
85
+ │ Direct download (free tier) │ Content │ │ license_keys │ │
86
+ │ └─────────┘ │ payments │ │
87
+ │ ┌─────────────────┐ │ invitations │ │
88
+ │ │ Local Storage │ └─────────────────┘ │
89
+ │ │ ~/.jawkit/ │ ┌─────────────────────────────┐ │
90
+ │ │ • license │◄───────────────────────│ Resend │ │
91
+ │ │ • config.json │ │ License delivery email │ │
92
+ │ │ • cache/ │ └─────────────────────────────┘ │
93
+ │ └─────────────────┘ │
94
+ └─────────────────────────────────────────────────────────────────────────────┘
95
+ ```
96
+
97
+ ---
98
+
99
+ ## Project Structure
100
+
101
+ ```
102
+ jawkit-cli/
103
+ ├── src/ # CLI source code
104
+ │ ├── cli.ts # Entry point (Commander setup)
105
+ │ ├── index.ts # Library exports
106
+ │ ├── commands/ # CLI commands
107
+ │ │ ├── auth.ts # auth activate/redeem/deactivate/status
108
+ │ │ ├── init.ts # Initialize content
109
+ │ │ ├── upgrade.ts # Upgrade content
110
+ │ │ └── version.ts # Show versions
111
+ │ ├── auth/ # Authentication module
112
+ │ │ ├── auth.service.ts # License activation, validation
113
+ │ │ ├── license-storage.ts # Keytar + file fallback for license
114
+ │ │ └── types.ts # TierLevel, StoredLicense, etc.
115
+ │ ├── content/ # Content management module
116
+ │ │ ├── content.service.ts # Download orchestration
117
+ │ │ ├── remote-provider.ts # R2 + Worker API client
118
+ │ │ ├── cache-manager.ts # Local disk cache
119
+ │ │ ├── bundled-content.ts # Offline fallback
120
+ │ │ └── extractor.ts # tar.gz extraction
121
+ │ ├── agents/ # Agent adapters
122
+ │ │ ├── base-agent.ts # Abstract base class
123
+ │ │ ├── registry.ts # Agent registry
124
+ │ │ ├── claude-code/ # Claude Code adapter
125
+ │ │ └── github-copilot/ # GitHub Copilot adapter
126
+ │ └── lib/ # Utilities
127
+ │ ├── config.ts # Configuration persistence
128
+ │ ├── errors.ts # Error classes
129
+ │ ├── promo.ts # Promotional messages
130
+ │ └── logger.ts # Console output
131
+ ├── cloudflare/
132
+ │ └── workers/
133
+ │ └── jawkit-api/ # Cloudflare Worker
134
+ │ ├── src/
135
+ │ │ ├── index.ts # Router
136
+ │ │ ├── db/ # D1 repositories
137
+ │ │ │ ├── license-repository.ts
138
+ │ │ │ ├── payment-repository.ts
139
+ │ │ │ └── invitation-repository.ts
140
+ │ │ └── routes/
141
+ │ │ ├── license.ts # License validation
142
+ │ │ ├── invitation.ts # Invitation management
143
+ │ │ ├── paddle-webhook.ts # Paddle webhooks
144
+ │ │ └── download.ts # Signed URL generation
145
+ │ ├── migrations/ # D1 schema migrations
146
+ │ └── public/ # Pricing page static files
147
+ ├── content-source/ # Source content by tier
148
+ ├── content/ # Built bundles (generated)
149
+ ├── scripts/
150
+ │ ├── bundle-content.ts # Build content bundles
151
+ │ ├── migrate-to-d1.ts # Data migration helper
152
+ │ └── local-r2-server.ts # Local development server
153
+ └── docs/
154
+ ├── PRD.md # Product Requirements
155
+ ├── PRP-*.md # Technical specifications
156
+ └── setup/ # Setup guides
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Development Setup
162
+
163
+ ### Prerequisites
164
+
165
+ - Node.js 18+
166
+ - Cloudflare account (Workers paid plan for D1)
167
+ - npm or pnpm
168
+
169
+ ### Step 1: Clone and Install
170
+
171
+ ```bash
172
+ git clone https://github.com/jawkit/cli.git
173
+ cd jawkit-cli
174
+ npm install
175
+ ```
176
+
177
+ ### Step 2: Set Up Cloudflare D1 Database
178
+
179
+ ```bash
180
+ cd cloudflare/workers/jawkit-api
181
+
182
+ # Create D1 database
183
+ npx wrangler d1 create jawkit-licenses
184
+ # Copy the database_id to wrangler.toml
185
+
186
+ # Apply migrations
187
+ npx wrangler d1 migrations apply jawkit-licenses --local
188
+ ```
189
+
190
+ ### Step 3: Configure Cloudflare Worker
191
+
192
+ Create `.dev.vars` in `cloudflare/workers/jawkit-api/`:
193
+
194
+ ```bash
195
+ URL_SIGNING_SECRET=local-dev-secret-change-in-prod
196
+ PADDLE_WEBHOOK_SECRET=pdl_xxx
197
+ PADDLE_API_KEY=your-paddle-api-key
198
+ RESEND_API_KEY=re_xxx
199
+ ADMIN_KEY=local-admin-key
200
+ ```
201
+
202
+ ### Step 4: Build and Test
203
+
204
+ ```bash
205
+ # Build CLI
206
+ npm run build
207
+
208
+ # Test CLI commands
209
+ node dist/cli.js version
210
+ node dist/cli.js init --dry-run
211
+ ```
212
+
213
+ ### Step 5: Start Worker for Local Testing
214
+
215
+ ```bash
216
+ cd cloudflare/workers/jawkit-api
217
+ npx wrangler dev
218
+ # Worker runs at http://localhost:8787
219
+ ```
220
+
221
+ ---
222
+
223
+ ## Available Scripts
224
+
225
+ ### Root Project
226
+
227
+ ```bash
228
+ npm run dev # Watch mode build
229
+ npm run build # Production build
230
+ npm run bundle-content # Build content bundles
231
+ npm run serve:local # Start local R2 simulation server
232
+ npm run test # Run tests (watch)
233
+ npm run test:run # Run tests (single)
234
+ npm run typecheck # Type checking only
235
+ npm run lint # ESLint
236
+ ```
237
+
238
+ ### Cloudflare Worker
239
+
240
+ ```bash
241
+ cd cloudflare/workers/jawkit-api
242
+ npx wrangler dev # Start dev server (localhost:8787)
243
+ npx wrangler deploy # Deploy to Cloudflare
244
+ npx wrangler d1 migrations apply jawkit-licenses --local # Apply migrations locally
245
+ npx wrangler d1 migrations apply jawkit-licenses --remote # Apply to production
246
+ ```
247
+
248
+ ---
249
+
250
+ ## Environment Variables
251
+
252
+ ### CLI (built-in defaults for production)
253
+
254
+ | Variable | Description | Default |
255
+ |----------|-------------|---------|
256
+ | `JAWKIT_API_URL` | API URL for license validation | `https://jawkit-api.xxx.workers.dev` |
257
+ | `R2_PUBLIC_URL` | Content CDN URL | `https://content.jawkit.dev` |
258
+
259
+ ### Cloudflare Worker Secrets
260
+
261
+ | Variable | Type | Description |
262
+ |----------|------|-------------|
263
+ | `URL_SIGNING_SECRET` | secret | HMAC secret for signed URLs |
264
+ | `PADDLE_WEBHOOK_SECRET` | secret | Paddle webhook signature verification |
265
+ | `PADDLE_API_KEY` | secret | Paddle API for customer lookup |
266
+ | `RESEND_API_KEY` | secret | Resend API for license emails |
267
+ | `ADMIN_KEY` | secret | Admin endpoint authentication |
268
+
269
+ ---
270
+
271
+ ## Tier System
272
+
273
+ | Tier | Level | Price | Content |
274
+ |------|-------|-------|---------|
275
+ | `free` | 0 | $0 | Basic commands and skills (no auth required) |
276
+ | `professional` | 1 | $99 one-time | All content including agents, advanced commands, skills |
277
+
278
+ Professional tier includes all free tier content. Purchased via Paddle checkout.
279
+
280
+ ---
281
+
282
+ ## API Endpoints
283
+
284
+ ### Cloudflare Worker
285
+
286
+ | Method | Endpoint | Description |
287
+ |--------|----------|-------------|
288
+ | GET | `/health` | Health check |
289
+ | POST | `/license/validate` | Validate license key, returns tier info |
290
+ | POST | `/invitation/create` | Create invitation (admin) |
291
+ | POST | `/invitation/redeem` | Redeem invitation code |
292
+ | GET | `/invitation/check/:code` | Check invitation validity |
293
+ | GET | `/invitation/list` | List invitations (admin) |
294
+ | POST | `/webhook/paddle` | Paddle payment webhook handler |
295
+ | GET | `/manifests/latest.json` | Get content manifest |
296
+ | GET | `/bundles/:agent/:version/free.tar.gz` | Download free bundle |
297
+ | POST | `/get-download-url` | Get signed URL for premium bundle |
298
+ | GET | `/download/:path` | Download with signature verification |
299
+ | GET | `/` | Pricing page (static) |
300
+ | GET | `/success.html` | Post-purchase success page |
301
+
302
+ ---
303
+
304
+ ## Documentation
305
+
306
+ ### Setup Guides
307
+
308
+ | Guide | Description |
309
+ |-------|-------------|
310
+ | [Cloudflare Setup](docs/setup/01-cloudflare-setup.md) | D1, Worker, and R2 deployment |
311
+ | [Development Workflow](docs/setup/02-development-workflow.md) | Day-to-day development |
312
+ | [Content Authoring](docs/setup/03-content-authoring.md) | Creating content bundles |
313
+ | [Content Pipeline](docs/setup/04-content-pipeline.md) | End-to-end content flow |
314
+ | [Init Command Flow](docs/setup/05-init-command-flow.md) | Detailed init flow |
315
+ | [Tier Management](docs/setup/06-tier-management.md) | Adding/modifying tiers |
316
+ | [CLI Reference](docs/setup/07-cli-reference.md) | Complete workflow reference |
317
+ | [Local Testing](docs/setup/08-local-testing.md) | Testing without cloud |
318
+
319
+ ### Technical Specifications
320
+
321
+ | Document | Description |
322
+ |----------|-------------|
323
+ | [PRD.md](docs/PRD.md) | Product Requirements Document |
324
+ | [PRP-001](docs/PRP-001-CLI-Core.md) | CLI Core Architecture |
325
+ | [PRP-002](docs/PRP-002-Authentication.md) | Authentication System |
326
+ | [PRP-003](docs/PRP-003-Agent-Adapters.md) | Agent Adapter System |
327
+ | [PRP-004](docs/PRP-004-Content-Management.md) | Content Management |
328
+ | [PRP-005](docs/PRP-005-Version-Management.md) | Version Management |
329
+
330
+ ---
331
+
332
+ ## Maintainer Guide
333
+
334
+ ### Key Files for Common Changes
335
+
336
+ | Task | Files to Modify |
337
+ |------|-----------------|
338
+ | Add CLI command | `src/commands/`, `src/cli.ts` |
339
+ | Add agent adapter | `src/agents/`, `src/agents/registry.ts` |
340
+ | Modify auth flow | `src/auth/auth.service.ts`, Worker `/routes/license.ts` |
341
+ | Change tier system | `src/auth/types.ts`, Worker, D1 migrations |
342
+ | Update content schema | `src/content/types.ts`, `scripts/bundle-content.ts` |
343
+
344
+ ### Security Notes
345
+
346
+ 1. **License Keys**: Stored in OS keychain (keytar) with file fallback (0600 permissions)
347
+ 2. **Signed URLs**: HMAC-SHA256, 1-hour expiry, served through Worker
348
+ 3. **Webhook Security**: Paddle signature verification (HMAC-SHA256)
349
+ 4. **Tier Access**: Server-side license validation in Cloudflare Worker
350
+
351
+ ### Testing Checklist
352
+
353
+ - [ ] `npm run typecheck` - No type errors
354
+ - [ ] `npm run lint` - No lint errors
355
+ - [ ] `npm run test:run` - All tests pass
356
+ - [ ] `npm run build` - Builds successfully
357
+ - [ ] Manual test: `jawkit init --dry-run` works
358
+
359
+ ---
360
+
361
+ ## License
362
+
363
+ Proprietary - All rights reserved. This software is confidential and proprietary to JawKit.
Binary file
@@ -0,0 +1,50 @@
1
+ {
2
+ "schemaVersion": "2.0",
3
+ "version": "1.0.0",
4
+ "publishedAt": "2026-01-28T08:40:15.068Z",
5
+ "minCliVersion": "1.0.0",
6
+ "agents": {
7
+ "claude-code": {
8
+ "version": "1.0.0",
9
+ "bundles": {
10
+ "free": {
11
+ "filename": "free.tar.gz",
12
+ "checksum": "sha256:4c65511fc6de980913c3d0bc01bb5e0e187f2a7d5e0d3123a1cfdd39cf152372",
13
+ "size": 2774,
14
+ "fileCount": 6,
15
+ "contentTypes": [
16
+ "commands",
17
+ "skills"
18
+ ]
19
+ },
20
+ "professional": {
21
+ "filename": "professional.tar.gz",
22
+ "checksum": "sha256:6c73c3e24b0e4f300be69e7aa103b232a01081d2c2e1ba0f23dffc85759e74da",
23
+ "size": 4443,
24
+ "fileCount": 8,
25
+ "contentTypes": [
26
+ "agents",
27
+ "commands",
28
+ "skills"
29
+ ]
30
+ }
31
+ }
32
+ },
33
+ "github-copilot": {
34
+ "version": "1.0.0",
35
+ "bundles": {
36
+ "free": {
37
+ "filename": "free.tar.gz",
38
+ "checksum": "sha256:8ec1f6999b1a1ccf067d2b1b0a93906d9950ccf48bf42465082f0712678867ca",
39
+ "size": 1052,
40
+ "fileCount": 2,
41
+ "contentTypes": [
42
+ "commands",
43
+ "skills"
44
+ ]
45
+ }
46
+ }
47
+ }
48
+ },
49
+ "changelog": "## v1.0.0\n\n- Initial release"
50
+ }