claudekit-cli 1.9.3 → 1.10.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 CHANGED
@@ -10,6 +10,7 @@ Command-line tool for bootstrapping and updating ClaudeKit projects.
10
10
  - Multi-tier GitHub authentication (gh CLI → env vars → keychain → prompt)
11
11
  - Streaming downloads with progress tracking
12
12
  - Smart file merging with conflict detection
13
+ - Automatic skills directory migration (flat → categorized)
13
14
  - Secure credential storage using OS keychain
14
15
  - Beautiful CLI interface with interactive prompts
15
16
 
@@ -123,6 +124,13 @@ ck update --kit engineer --version v1.0.0
123
124
  ck update --exclude "local-config/**" --exclude "*.local"
124
125
  ```
125
126
 
127
+ **Automatic Skills Migration:**
128
+ - Detects structure changes (flat → categorized)
129
+ - Preserves all customizations via SHA-256 hashing
130
+ - Creates backup before migration
131
+ - Rollback on failure
132
+ - Interactive prompts for confirmation
133
+
126
134
  ### List Available Versions
127
135
 
128
136
  ```bash
@@ -140,103 +148,12 @@ ck versions --limit 50
140
148
  ck versions --all
141
149
  ```
142
150
 
143
- ### Diagnose Issues
144
-
145
- Run diagnostics to troubleshoot authentication and repository access problems:
151
+ ### Diagnostics & Doctor
146
152
 
147
153
  ```bash
148
- # Run comprehensive diagnostics
149
- ck diagnose
150
-
151
- # Check specific kit
152
- ck diagnose --kit engineer
153
-
154
- # Get detailed output
155
- ck diagnose --verbose
156
- ```
157
-
158
- ### Doctor Command
159
-
160
- Check your current ClaudeKit setup and available components:
161
-
162
- ```bash
163
- # Show ClaudeKit setup overview
164
- ck doctor
165
- ```
166
-
167
- **What the doctor command shows:**
168
- - **Global Setup**: Installation status, version, and component counts
169
- - **Project Setup**: Current project information and available components
170
- - **Summary**: Overall setup status and total available components
171
- - **Helpful Tips**: Next steps and related commands
172
-
173
- **Example output:**
174
- ```
175
- CK Global Setup
176
- Location: /Users/user/.claude
177
- Version: 1.0.0
178
- Components: 0 agents, 0 commands, 0 workflows, 0 skills
179
-
180
- CK Project Setup
181
- Location: ./my-project/.claude
182
- Version: 1.10.4
183
- Name: claudekit-engineer
184
- Components: 15 agents, 11 commands, 4 workflows, 31 skills
185
-
186
- Total Available Components:
187
- 🤖 Agents: 15
188
- ⚡ Commands: 11
189
- 🔄 Workflows: 4
190
- 🛠️ Skills: 31
191
- ```
192
-
193
- **What it checks:**
194
- - ✅ GitHub CLI installation and authentication status
195
- - ✅ Environment variables (GITHUB_TOKEN, GH_TOKEN)
196
- - ✅ Token format validation
197
- - ✅ Authentication method being used
198
- - ✅ Repository access for each kit
199
- - ✅ Release availability
200
- - ✅ System information
201
-
202
- **Example output:**
203
- ```
204
- 🔍 ClaudeKit CLI Diagnostics
205
-
206
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
207
- Diagnostic Results:
208
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
209
-
210
- ✅ GitHub CLI
211
- GitHub CLI is installed and authenticated
212
- This is the recommended authentication method
213
-
214
- ✅ Environment Variables
215
- GITHUB_TOKEN is set and has valid format
216
- Token: ghp_xxx...
217
-
218
- ✅ Authentication
219
- Successfully authenticated via Environment Variable
220
- Token: ghp_xxx...
221
-
222
- ✅ Repository Access (engineer)
223
- You have access to owner/claudekit-engineer
224
-
225
- ✅ Releases (engineer)
226
- Found 12 release(s)
227
- Latest: v1.5.0 (1/15/2025)
228
-
229
- ℹ️ System Information
230
- Windows x64
231
- Node.js: v20.11.0
232
- Working directory: C:\Projects\my-app
233
- ClaudeKit CLI: v1.5.1
234
-
235
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
236
- Summary: 6 passed, 0 failed, 0 warnings
237
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
238
-
239
- All checks passed! 🎉
154
+ ck diagnose # Check auth, access, releases
155
+ ck doctor # Show setup overview, component counts
156
+ ck diagnose --verbose # Detailed diagnostics
240
157
  ```
241
158
 
242
159
  ### Other Commands
@@ -250,31 +167,14 @@ ck --help
250
167
  ck -h
251
168
  ```
252
169
 
253
- ### Debugging and Verbose Mode
254
-
255
- Enable detailed logging for debugging or troubleshooting:
170
+ ### Debugging
256
171
 
257
172
  ```bash
258
- # Enable verbose logging with flag
259
- ck new --verbose
260
- ck update -v # Short form
261
-
262
- # Using environment variable
263
- CLAUDEKIT_VERBOSE=1 ck new
264
-
265
- # Save logs to file for sharing
266
- ck new --verbose --log-file debug.log
173
+ ck new --verbose # Enable verbose logging
174
+ ck new --verbose --log-file debug.log # Save to file
175
+ CLAUDEKIT_VERBOSE=1 ck new # Via environment variable
267
176
  ```
268
177
 
269
- **Verbose mode shows:**
270
- - HTTP request/response details (with sanitized tokens)
271
- - File operations (downloads, extractions, copies)
272
- - Command execution steps and timing
273
- - Error stack traces with full context
274
- - Authentication flow details
275
-
276
- **Note:** All sensitive data (tokens, credentials) is automatically sanitized in verbose logs for security.
277
-
278
178
  ## Authentication
279
179
 
280
180
  The CLI requires GitHub authentication to download releases from private repositories.
@@ -297,270 +197,49 @@ The CLI requires GitHub authentication to download releases from private reposit
297
197
  └─────────────────────────────────────────────────┘
298
198
  ```
299
199
 
300
- ### Quick Setup by Platform
301
-
302
- <details>
303
- <summary><strong>🪟 Windows (PowerShell) - Recommended Setup</strong></summary>
304
-
305
- **Option 1: GitHub CLI (Easiest & Recommended)**
200
+ ### Quick Setup
306
201
 
307
- ```powershell
308
- # Install GitHub CLI
309
- winget install GitHub.cli
310
-
311
- # Authenticate with GitHub
202
+ **Recommended: GitHub CLI**
203
+ ```bash
204
+ # Install & authenticate
312
205
  gh auth login
313
- # Select: "Login with a web browser"
314
- # Follow the browser prompts
315
-
316
- # Verify authentication
317
- gh auth status
318
-
319
- # You're ready! Use ClaudeKit CLI
320
- ck new --kit engineer
321
- ```
322
-
323
- **Option 2: Personal Access Token**
324
-
325
- 1. **Accept Repository Invitation**: Check your email for the GitHub repository invitation and accept it
326
- 2. **Create Token**: Go to [GitHub Token Settings](https://github.com/settings/tokens/new?scopes=repo&description=ClaudeKit%20CLI)
327
- - Description: "ClaudeKit CLI"
328
- - Scopes: Check `repo` (Full control of private repositories)
329
- - Click "Generate token" and copy it
330
- 3. **Set Environment Variable Permanently**:
331
- ```powershell
332
- # Set for current user (persists across sessions)
333
- [System.Environment]::SetEnvironmentVariable(
334
- "GITHUB_TOKEN",
335
- "ghp_YOUR_TOKEN_HERE",
336
- [System.EnvironmentVariableTarget]::User
337
- )
338
-
339
- # Restart PowerShell to apply changes
340
- ```
341
- 4. **Verify**:
342
- ```powershell
343
- # Check if token is set
344
- $env:GITHUB_TOKEN
345
- ```
346
-
347
- **Note**: Setting via `$env:GITHUB_TOKEN = "ghp_xxx"` only works for the current session. Use the method above for permanent setup.
348
206
 
349
- </details>
350
-
351
- <details>
352
- <summary><strong>🍎 macOS / 🐧 Linux - Setup</strong></summary>
353
-
354
- **Option 1: GitHub CLI (Recommended)**
207
+ # Windows
208
+ winget install GitHub.cli
355
209
 
356
- ```bash
357
210
  # macOS
358
211
  brew install gh
359
212
 
360
- # Linux (Debian/Ubuntu)
213
+ # Linux
361
214
  sudo apt install gh
362
-
363
- # Authenticate
364
- gh auth login
365
-
366
- # Verify
367
- gh auth status
368
- ```
369
-
370
- **Option 2: Environment Variable**
371
-
372
- ```bash
373
- # Add to ~/.bashrc, ~/.zshrc, or ~/.profile
374
- export GITHUB_TOKEN=ghp_your_token_here
375
-
376
- # Reload shell
377
- source ~/.bashrc # or ~/.zshrc
378
- ```
379
-
380
- </details>
381
-
382
- ### Why Use GitHub CLI?
383
-
384
215
  ```
385
- GitHub CLI Benefits:
386
- ├─ ✅ Automatic token management
387
- ├─ ✅ Secure storage in OS credential manager
388
- ├─ ✅ Proper OAuth scopes (no manual setup)
389
- ├─ ✅ Token auto-refresh
390
- ├─ ✅ Works across all ClaudeKit commands
391
- └─ ✅ One-time setup
392
- ```
393
-
394
- ## Troubleshooting
395
-
396
- ### Quick Diagnostic Tool
397
216
 
398
- Before diving into manual troubleshooting, run the diagnostic tool to automatically check for common issues:
399
-
400
- ```bash
401
- ck diagnose
402
- ```
403
-
404
- This will check:
405
- - GitHub CLI status
406
- - Environment variables
407
- - Token validity and format
408
- - Repository access
409
- - Release availability
410
-
411
- ### Common Issues & Solutions
412
-
413
- <details>
414
- <summary><strong>❌ "Access denied to repository" or "Cannot access ClaudeKit"</strong></summary>
415
-
416
- **This error means authentication is working, but you don't have access to the repository.**
417
-
418
- ```
419
- Possible Causes:
420
- ├─ 1. Haven't accepted GitHub repository invitation
421
- ├─ 2. Token lacks 'repo' scope
422
- ├─ 3. Token expired or revoked
423
- └─ 4. Not added as collaborator yet
424
- ```
425
-
426
- **Solutions:**
427
-
428
- 1. **Check Email for Repository Invitation**
429
- - Look for email from GitHub with subject "You've been invited to join..."
430
- - Click "Accept invitation"
431
- - Wait a few minutes for permissions to propagate
432
-
433
- 2. **Use GitHub CLI (Recommended)**
434
- ```bash
435
- gh auth login
436
- # This handles scopes automatically
437
- ```
438
-
439
- 3. **Verify Token Scopes**
440
- - Go to: https://github.com/settings/tokens
441
- - Find your token
442
- - Ensure `repo` scope is checked (not just `public_repo`)
443
- - If missing, create a new token with proper scopes
444
-
445
- 4. **Test Repository Access**
217
+ **Alternative: Personal Access Token**
218
+ 1. Create token at [github.com/settings/tokens/new](https://github.com/settings/tokens/new?scopes=repo)
219
+ 2. Set environment variable:
446
220
  ```bash
447
- # Try cloning the repository
448
- git clone https://github.com/[owner]/claudekit-engineer.git
221
+ # Windows (permanent)
222
+ [System.Environment]::SetEnvironmentVariable("GITHUB_TOKEN", "ghp_TOKEN", [System.EnvironmentVariableTarget]::User)
449
223
 
450
- # If this fails, you don't have access yet
224
+ # macOS/Linux (add to ~/.bashrc or ~/.zshrc)
225
+ export GITHUB_TOKEN=ghp_your_token_here
451
226
  ```
452
227
 
453
- </details>
454
-
455
- <details>
456
- <summary><strong>❌ "Authentication failed" (401 Error)</strong></summary>
457
-
458
- **This means the token is invalid or not being read.**
459
-
460
- **Solutions:**
461
-
462
- 1. **Verify Token is Set**
463
- ```powershell
464
- # Windows PowerShell
465
- $env:GITHUB_TOKEN
466
-
467
- # macOS/Linux
468
- echo $GITHUB_TOKEN
469
- ```
470
-
471
- 2. **Check Token Format**
472
- - Classic tokens start with `ghp_`
473
- - Fine-grained tokens start with `github_pat_`
474
- - Token should be 40+ characters
475
-
476
- 3. **Use GitHub CLI Instead**
477
- ```bash
478
- gh auth login
479
- ```
480
-
481
- 4. **Restart Terminal**
482
- - Environment variables may not be loaded
483
- - Close and reopen terminal/PowerShell
484
-
485
- </details>
486
-
487
- <details>
488
- <summary><strong>🪟 Windows: Token Not Persisting Between Sessions</strong></summary>
489
-
490
- **Problem**: Setting `$env:GITHUB_TOKEN = "ghp_xxx"` doesn't work after closing PowerShell.
491
-
492
- **Solution**: Use permanent environment variable:
493
-
494
- ```powershell
495
- # Set for current user (permanent)
496
- [System.Environment]::SetEnvironmentVariable(
497
- "GITHUB_TOKEN",
498
- "ghp_YOUR_TOKEN_HERE",
499
- [System.EnvironmentVariableTarget]::User
500
- )
501
-
502
- # Restart PowerShell
503
- ```
504
-
505
- Or use GitHub CLI for automatic management:
506
- ```powershell
507
- winget install GitHub.cli
508
- gh auth login
509
- ```
510
-
511
- </details>
512
-
513
- <details>
514
- <summary><strong>❌ "No releases found" Error</strong></summary>
515
-
516
- **Possible Causes:**
517
- - Repository has no releases yet
518
- - Token doesn't have access to releases
519
-
520
- **Solutions:**
521
- 1. Contact support to verify releases exist
522
- 2. Check repository directly on GitHub
523
- 3. Use `ck versions --kit engineer` to list available versions
524
-
525
- </details>
526
-
527
- <details>
528
- <summary><strong>🐛 Enable Verbose Mode for Debugging</strong></summary>
228
+ ## Troubleshooting
529
229
 
530
- Get detailed logs to diagnose issues:
230
+ Run diagnostics to check for common issues:
531
231
 
532
232
  ```bash
533
- # Enable verbose output
534
- ck new --verbose
535
-
536
- # Save logs to file
537
- ck new --verbose --log-file debug.log
538
-
539
- # Or use environment variable
540
- CLAUDEKIT_VERBOSE=1 ck new
233
+ ck diagnose # Check authentication, access, releases
234
+ ck new --verbose # Enable detailed logging
235
+ ck doctor # Show setup overview
541
236
  ```
542
237
 
543
- This shows:
544
- - Authentication method used
545
- - API requests/responses
546
- - Token validation (sanitized)
547
- - File operations
548
- - Error stack traces
549
-
550
- </details>
551
-
552
- ### Getting Help
553
-
554
- If you're still having issues:
555
-
556
- 1. **Run with verbose mode**: `ck new --verbose --log-file debug.log`
557
- 2. **Check the log file**: Review `debug.log` for detailed errors
558
- 3. **Report issue**: https://github.com/mrgoonie/claudekit-cli/issues
559
- 4. **Include**:
560
- - Operating system (Windows/macOS/Linux)
561
- - CLI version: `ck --version`
562
- - Error message (with tokens removed)
563
- - Steps to reproduce
238
+ **Common Issues:**
239
+ - **"Access denied"**: Accept GitHub repo invitation, verify `repo` scope
240
+ - **"Authentication failed"**: Check token format (ghp_*), verify env var
241
+ - **Token not persisting (Windows)**: Use `SetEnvironmentVariable` or `gh auth login`
242
+ - **Need help**: Run `ck diagnose`, check logs, report at GitHub issues
564
243
 
565
244
  ## Available Kits
566
245
 
@@ -598,411 +277,87 @@ The following file patterns are protected and will not be overwritten during upd
598
277
 
599
278
  ## Excluding Files
600
279
 
601
- Use the `--exclude` flag to skip specific files or directories during download and extraction. This is useful for:
602
-
603
- - Excluding temporary or cache directories
604
- - Skipping log files or debug output
605
- - Omitting files you want to manage manually
606
- - Avoiding unnecessary large files
607
-
608
- ### Basic Usage
280
+ Use `--exclude` flag with glob patterns to skip files:
609
281
 
610
282
  ```bash
611
- # Exclude log files
612
- ck new --exclude "*.log"
613
-
614
- # Exclude multiple patterns
615
- ck new --exclude "*.log" --exclude "temp/**" --exclude "cache/**"
616
-
617
- # Common exclude patterns for updates
618
- ck update --exclude "node_modules/**" --exclude "dist/**" --exclude ".env.*"
283
+ ck new --exclude "*.log" --exclude "temp/**"
284
+ ck update --exclude "node_modules/**" --exclude "dist/**"
619
285
  ```
620
286
 
621
- ### Supported Glob Patterns
622
-
623
- The `--exclude` flag accepts standard glob patterns:
624
-
625
- - `*` - Match any characters except `/` (e.g., `*.log` matches all log files)
626
- - `**` - Match any characters including `/` (e.g., `temp/**` matches all files in temp directory)
627
- - `?` - Match single character (e.g., `file?.txt` matches `file1.txt`, `file2.txt`)
628
- - `[abc]` - Match characters in brackets (e.g., `[Tt]emp` matches `Temp` or `temp`)
629
- - `{a,b}` - Match alternatives (e.g., `*.{log,tmp}` matches `*.log` and `*.tmp`)
630
-
631
- ### Common Exclude Patterns
287
+ **Patterns:** `*` (any chars), `**` (recursive), `?` (single char), `[abc]`, `{a,b}`
288
+ **Restrictions:** No absolute paths, no path traversal (..), 1-500 chars
289
+ **Note:** User patterns are ADDED to default protected patterns
632
290
 
633
- ```bash
634
- # Exclude all log files
635
- --exclude "*.log" --exclude "**/*.log"
636
-
637
- # Exclude temporary directories
638
- --exclude "tmp/**" --exclude "temp/**" --exclude ".tmp/**"
639
-
640
- # Exclude cache directories
641
- --exclude "cache/**" --exclude ".cache/**" --exclude "**/.cache/**"
642
-
643
- # Exclude build artifacts
644
- --exclude "dist/**" --exclude "build/**" --exclude "out/**"
645
-
646
- # Exclude local configuration
647
- --exclude "*.local" --exclude "local/**" --exclude ".env.local"
648
-
649
- # Exclude IDE/editor files
650
- --exclude ".vscode/**" --exclude ".idea/**" --exclude "*.swp"
651
- ```
291
+ ### Custom .claude Files & Skills Migration
652
292
 
653
- ### Important Notes
654
-
655
- **Additive Behavior:**
656
- - User exclude patterns are ADDED to the default protected patterns
657
- - They do not replace the built-in protections
658
- - All patterns work together to determine which files to skip
659
-
660
- **Security Restrictions:**
661
- - Absolute paths (starting with `/`) are not allowed
662
- - Path traversal patterns (containing `..`) are not allowed
663
- - Patterns must be between 1-500 characters
664
- - These restrictions prevent accidental or malicious file system access
665
-
666
- **Pattern Matching:**
667
- - Patterns are case-sensitive on Linux/macOS
668
- - Patterns are case-insensitive on Windows
669
- - Patterns are applied during both extraction and merge phases
670
- - Excluded files are never written to disk, saving time and space
671
-
672
- **Examples of Invalid Patterns:**
673
-
674
- ```bash
675
- # ❌ Absolute paths not allowed
676
- ck new --exclude "/etc/passwd"
677
-
678
- # ❌ Path traversal not allowed
679
- ck new --exclude "../../secret"
680
-
681
- # ❌ Empty patterns not allowed
682
- ck new --exclude ""
683
-
684
- # ✅ Correct way to exclude root-level files
685
- ck new --exclude "secret.txt" --exclude "config.local.json"
686
- ```
687
-
688
- ### Custom .claude Files
689
-
690
- When updating a project, the CLI automatically preserves your custom `.claude/` files that don't exist in the new release package. This allows you to maintain:
293
+ **Custom File Preservation:**
294
+ The CLI automatically preserves your custom `.claude/` files during updates:
691
295
 
692
296
  - Custom slash commands
693
297
  - Personal workflows
694
298
  - Project-specific configurations
695
299
  - Any other custom files in `.claude/` directory
696
300
 
697
- **How it works:**
698
- 1. Before updating, the CLI scans your project's `.claude/` directory
699
- 2. Compares it with the new release's `.claude/` directory
700
- 3. Identifies custom files (files in your project but not in the release)
701
- 4. Automatically protects these custom files during the update
301
+ **Skills Directory Migration:**
302
+ Automatic migration when structure changes (flat categorized):
702
303
 
703
- **Example:**
704
- ```
705
- Your project:
706
- .claude/
707
- ├── commands/standard.md (from ClaudeKit)
708
- └── commands/my-custom.md (your custom command)
709
-
710
- After update:
711
- .claude/
712
- ├── commands/standard.md (updated from new release)
713
- └── commands/my-custom.md (preserved - your custom file)
714
- ```
304
+ - **Detection**: Manifest-based + heuristic fallback
305
+ - **Customizations**: SHA-256 hash comparison detects modifications
306
+ - **Safety**: Backup before migration, rollback on failure
307
+ - **Preservation**: All customizations preserved during migration
308
+ - **Interactive**: Prompts for confirmation (can skip in CI/CD)
715
309
 
716
- ## Development
717
-
718
- ```bash
719
- # Install dependencies
720
- bun install
721
-
722
- # Run in development
723
- bun run dev new --kit engineer
724
-
725
- # Build
726
- bun run build
727
-
728
- # Compile standalone binary
729
- bun run compile
730
-
731
- # Run tests
732
- bun test
733
-
734
- # Type check
735
- bun run typecheck
736
-
737
- # Lint & Format
738
- bun run lint
739
- bun run format
310
+ **Example Migration:**
740
311
  ```
312
+ Before (flat):
313
+ .claude/skills/
314
+ ├── gemini-vision/
315
+ ├── postgresql-psql/
316
+ └── cloudflare-dns/
741
317
 
742
- ## Project Structure
743
-
744
- ```
745
- claudekit-cli/
746
- ├── docs/ # Documentation
747
- ├── project-pdr.md # Product requirements
748
- │ ├── code-standards.md # Coding standards
749
- │ ├── system-architecture.md # Architecture diagrams
750
- │ ├── codebase-summary.md # Codebase overview
751
- │ └── tech-stack.md # Technology stack
752
- ├── plans/ # Implementation plans & reports
753
- │ ├── 251008-claudekit-cli-implementation-plan.md
754
- │ ├── reports/ # Agent reports
755
- │ ├── research/ # Research documents
756
- │ └── templates/ # Plan templates
757
- ├── src/ # Source code
758
- │ ├── commands/ # Command implementations
759
- │ │ ├── new.ts # 'ck new' command
760
- │ │ └── update.ts # 'ck update' command
761
- │ ├── lib/ # Core libraries
762
- │ │ ├── auth.ts # Authentication manager
763
- │ │ ├── github.ts # GitHub API client
764
- │ │ ├── download.ts # Download manager
765
- │ │ ├── merge.ts # File merger
766
- │ │ └── prompts.ts # Interactive prompts
767
- │ ├── utils/ # Utilities
768
- │ │ ├── config.ts # Configuration manager
769
- │ │ └── logger.ts # Logger with sanitization
770
- │ ├── index.ts # CLI entry point
771
- │ └── types.ts # Type definitions
772
- ├── tests/ # Test files (mirrors src/)
773
- │ ├── lib/
774
- │ ├── utils/
775
- │ └── types.test.ts
776
- ├── README.md # User documentation
777
- ├── package.json # Package manifest
778
- └── tsconfig.json # TypeScript config
318
+ After (categorized):
319
+ .claude/skills/
320
+ ├── ai-multimodal/
321
+ │ └── gemini-vision/
322
+ ├── databases/
323
+ └── postgresql-psql/
324
+ └── devops/
325
+ └── cloudflare-dns/
779
326
  ```
780
327
 
781
- ---
328
+ Customizations in any skill are detected and preserved automatically.
782
329
 
783
- ## Key Features & Components
784
-
785
- ### 1. Commands
786
- - **`ck new`**: Create new project from release
787
- - **`ck update`**: Update existing project or install globally with `--global` flag
788
- - **`ck versions`**: List available versions of ClaudeKit repositories
789
- - **`ck doctor`**: Show current ClaudeKit setup and component overview
790
- - **`ck diagnose`**: Run diagnostics to troubleshoot authentication and access issues
791
- - **`ck --version`**: Show CLI version
792
- - **`ck --help`**: Show help
793
-
794
- ### 2. Authentication (Multi-Tier Fallback)
795
- 1. GitHub CLI (`gh auth token`)
796
- 2. Environment variables (GITHUB_TOKEN, GH_TOKEN)
797
- 3. Configuration file (~/.claudekit/config.json)
798
- 4. OS Keychain (via keytar)
799
- 5. User prompt (with optional secure storage)
800
-
801
- ### 3. Core Operations
802
- - **Download**: Streaming downloads with progress bars
803
- - **Extract**: TAR.GZ and ZIP support with path traversal protection
804
- - **Merge**: Smart file merging with conflict detection
805
- - **Protected Files**: .env, *.key, *.pem, node_modules/, .git/, etc.
806
-
807
- ## Frequently Asked Questions (FAQ)
808
-
809
- <details>
810
- <summary><strong>Q: Do I need to install the `gh` CLI to use ClaudeKit CLI?</strong></summary>
811
-
812
- **A:** No, but it's highly recommended for the best experience.
813
-
814
- **Without gh CLI:**
815
- - Must manually create Personal Access Token
816
- - Must set environment variable or enter token each time
817
- - Must manage token renewal manually
818
-
819
- **With gh CLI:**
820
- - One-time `gh auth login` setup
821
- - Automatic token management
822
- - Better security (OAuth vs static token)
823
- - Works seamlessly across all tools
824
-
825
- </details>
826
-
827
- <details>
828
- <summary><strong>Q: Can I use the CLI if I'm already added to the repository?</strong></summary>
829
-
830
- **A:** Yes! If you're added as a collaborator:
831
-
832
- 1. **Using CLI** (with gh or token):
833
- ```bash
834
- ck new --kit engineer
835
- ```
836
-
837
- 2. **Direct git clone** (alternative):
838
- ```bash
839
- git clone https://github.com/owner/claudekit-engineer.git
840
- ```
841
-
842
- 3. **Manual download** (from GitHub UI):
843
- - Go to repository → Releases
844
- - Download latest release zip
845
- - Extract manually
846
-
847
- The CLI provides additional benefits like smart merging, exclude patterns, and automatic updates.
848
-
849
- </details>
850
-
851
- <details>
852
- <summary><strong>Q: What GitHub token scopes do I need?</strong></summary>
853
-
854
- **A:** For private repositories, you need the **`repo`** scope.
855
-
856
- ```
857
- Required Scope:
858
- └─ repo (Full control of private repositories)
859
- ├─ repo:status
860
- ├─ repo_deployment
861
- ├─ public_repo
862
- ├─ repo:invite
863
- └─ security_events
864
- ```
865
-
866
- **Creating token with correct scope:**
867
- 1. Go to: https://github.com/settings/tokens/new?scopes=repo&description=ClaudeKit%20CLI
868
- 2. The `repo` scope will be pre-selected
869
- 3. Click "Generate token"
870
-
871
- **Common mistake:** Using `public_repo` scope only - this doesn't work for private repositories.
872
-
873
- </details>
874
-
875
- <details>
876
- <summary><strong>Q: Why am I getting "Access denied" even though I set GITHUB_TOKEN?</strong></summary>
877
-
878
- **A:** "Access denied" with a valid token means you don't have repository access, not that authentication failed.
879
-
880
- **Checklist:**
881
- - ✅ Token is being read correctly (you'd get "Authentication failed" otherwise)
882
- - ❌ You haven't accepted the GitHub repository invitation
883
- - ❌ Token lacks `repo` scope (has `public_repo` only)
884
- - ❌ You're not added as a collaborator yet
885
-
886
- **Solution:**
887
- 1. Check email for GitHub invitation
888
- 2. Accept invitation
889
- 3. Wait 2-5 minutes for permissions to sync
890
- 4. Try again: `ck new --kit engineer`
891
-
892
- </details>
893
-
894
- <details>
895
- <summary><strong>Q: How do I make my token persist in PowerShell?</strong></summary>
896
-
897
- **A:** Use permanent environment variable:
898
-
899
- ```powershell
900
- [System.Environment]::SetEnvironmentVariable(
901
- "GITHUB_TOKEN",
902
- "ghp_YOUR_TOKEN",
903
- [System.EnvironmentVariableTarget]::User
904
- )
905
- ```
906
-
907
- Then restart PowerShell.
908
-
909
- **Or use GitHub CLI** (no manual token management needed):
910
- ```powershell
911
- winget install GitHub.cli
912
- gh auth login
913
- ```
914
-
915
- </details>
916
-
917
- <details>
918
- <summary><strong>Q: Can I download releases without using the CLI?</strong></summary>
919
-
920
- **A:** Yes, if you're a collaborator:
921
-
922
- 1. **Via Browser:**
923
- - Go to repository on GitHub
924
- - Click "Releases"
925
- - Download the release zip/tarball
926
-
927
- 2. **Via Git:**
928
- ```bash
929
- git clone https://github.com/owner/claudekit-engineer.git
930
- ```
931
-
932
- 3. **Via gh CLI:**
933
- ```bash
934
- gh release download latest --repo owner/claudekit-engineer
935
- ```
936
-
937
- However, the ClaudeKit CLI provides:
938
- - Smart file merging during updates
939
- - Protected file preservation
940
- - Exclude pattern support
941
- - Automatic wrapper directory detection
942
- - Progress tracking
943
-
944
- </details>
945
-
946
- <details>
947
- <summary><strong>Q: What's the difference between 401, 403, and 404 errors?</strong></summary>
948
-
949
- **A:** Different errors mean different things:
950
-
951
- ```
952
- 401 Unauthorized:
953
- └─ Token is invalid, expired, or not provided
954
- Solution: Check token format, regenerate if needed
955
-
956
- 403 Forbidden:
957
- └─ Token is valid but lacks required scopes
958
- Solution: Recreate token with 'repo' scope
959
-
960
- 404 Not Found (on private repos):
961
- └─ Token is valid but you don't have repository access
962
- Solution: Accept GitHub invitation, wait for permissions
963
- ```
964
-
965
- </details>
966
-
967
- <details>
968
- <summary><strong>Q: How do I know which authentication method is being used?</strong></summary>
330
+ ## Development
969
331
 
970
- **A:** Run with verbose mode:
332
+ See [Development Guide](./docs/codebase-summary.md) for:
333
+ - Project structure (commands, lib, utils, tests)
334
+ - Build & compilation (`bun run build`, `bun run compile`)
335
+ - Testing & type checking
336
+ - Code standards & linting
971
337
 
338
+ **Quick Start:**
972
339
  ```bash
973
- ck new --verbose
974
- ```
975
-
976
- You'll see output like:
977
- ```
978
- [DEBUG] Using GitHub CLI authentication
979
- # or
980
- [DEBUG] Using environment variable authentication
981
- # or
982
- [DEBUG] Using keychain authentication
340
+ bun install
341
+ bun run dev new --kit engineer
342
+ bun test
983
343
  ```
984
344
 
985
- </details>
345
+ ## FAQ
986
346
 
987
- <details>
988
- <summary><strong>Q: Is my GitHub token secure when using this CLI?</strong></summary>
347
+ **Q: Do I need GitHub CLI?**
348
+ A: No, but recommended. Provides auto token management, OAuth security, one-time setup.
989
349
 
990
- **A:** Yes, multiple security measures are in place:
350
+ **Q: What token scope needed?**
351
+ A: `repo` scope for private repositories. Create at [github.com/settings/tokens/new](https://github.com/settings/tokens/new?scopes=repo).
991
352
 
992
- - Tokens are sanitized in all logs (replaced with `***`)
993
- - Tokens stored in OS keychain are encrypted
994
- - ✅ Tokens are never written to files in plain text
995
- - ✅ Config file references keychain storage only
996
- - ✅ HTTPS used for all GitHub API requests
997
- - ✅ No telemetry or external logging
353
+ **Q: "Access denied" error?**
354
+ A: Accept GitHub repo invitation, verify `repo` scope, wait 2-5min for permissions.
998
355
 
999
- **Token storage locations:**
1000
- - **gh CLI**: Windows Credential Manager / macOS Keychain / Linux Secret Service
1001
- - **Keychain**: OS-encrypted secure storage
1002
- - **Environment**: Session memory only
1003
- - **Config file**: Reference only ("`stored_in_keychain`")
356
+ **Q: Token not persisting (Windows)?**
357
+ A: Use `SetEnvironmentVariable` with `User` target, or `gh auth login`.
1004
358
 
1005
- </details>
359
+ **Q: Is my token secure?**
360
+ A: Yes. Tokens sanitized in logs, stored encrypted in OS keychain, never in plaintext.
1006
361
 
1007
362
  ## License
1008
363
 
Binary file
package/bin/ck-darwin-x64 CHANGED
Binary file
package/bin/ck-linux-x64 CHANGED
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudekit-cli",
3
- "version": "1.9.3",
3
+ "version": "1.10.0",
4
4
  "description": "CLI tool for bootstrapping and updating ClaudeKit projects",
5
5
  "type": "module",
6
6
  "repository": {