prjct-cli 0.8.2 → 0.8.3

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.
@@ -460,12 +460,12 @@ const COMMANDS = [
460
460
  category: 'setup',
461
461
  description: 'Reconfigure editor installations',
462
462
  usage: {
463
- claude: null,
463
+ claude: '/p:setup',
464
464
  terminal: 'prjct setup [--force] [--editor <name>]',
465
465
  },
466
466
  params: '[--force] [--editor <name>]',
467
467
  implemented: true,
468
- hasTemplate: false,
468
+ hasTemplate: true,
469
469
  icon: 'Settings',
470
470
  requiresInit: false,
471
471
  blockingRules: null,
@@ -475,12 +475,12 @@ const COMMANDS = [
475
475
  category: 'setup',
476
476
  description: 'Migrate all legacy projects',
477
477
  usage: {
478
- claude: null,
478
+ claude: '/p:migrate-all',
479
479
  terminal: 'prjct migrate-all [--deep-scan] [--remove-legacy] [--dry-run]',
480
480
  },
481
481
  params: '[--deep-scan] [--remove-legacy] [--dry-run]',
482
482
  implemented: true,
483
- hasTemplate: false,
483
+ hasTemplate: true,
484
484
  icon: 'Database',
485
485
  requiresInit: false,
486
486
  blockingRules: null,
@@ -210,10 +210,9 @@ class CommandInstaller {
210
210
 
211
211
  /**
212
212
  * Install to all detected editors (alias for installCommands)
213
- * @param {boolean} interactive - Whether to show interactive prompts
214
213
  * @returns {Promise<Object>} Installation results
215
214
  */
216
- async installToAll(interactive = false) {
215
+ async installToAll() {
217
216
  return await this.installCommands()
218
217
  }
219
218
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prjct-cli",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Built for Claude - Ship fast, track progress, stay focused. Developer momentum tool for indie hackers.",
5
5
  "main": "core/index.js",
6
6
  "bin": {
@@ -12,6 +12,7 @@
12
12
  },
13
13
  "scripts": {
14
14
  "postinstall": "node scripts/postinstall.js",
15
+ "update-commands": "node -e \"const installer = require('./core/infrastructure/command-installer'); const i = new installer(); i.syncCommands().then(r => console.log('Commands updated:', r))\"",
15
16
  "install-global": "./scripts/install.sh",
16
17
  "update": "./scripts/update.sh",
17
18
  "test": "vitest run --workspace=vitest.workspace.js",
@@ -8,16 +8,15 @@
8
8
  * 1. Detects if global install
9
9
  * 2. Installs/syncs commands to ~/.claude/commands/p/
10
10
  * 3. Installs/updates global config to ~/.claude/CLAUDE.md
11
- * 4. Migrates legacy projects automatically
12
- * 5. Shows beautiful ASCII art
11
+ * 4. Shows beautiful ASCII art
12
+ *
13
+ * NOTE: Migration is now manual via /p:migrate-all or prjct migrate-all
13
14
  *
14
15
  * @version 0.8.2
15
16
  */
16
17
 
17
- const fs = require('fs')
18
18
  const path = require('path')
19
19
  const installer = require('../core/infrastructure/command-installer')
20
- const migrator = require('../core/infrastructure/migrator')
21
20
  const { VERSION } = require('../core/utils/version')
22
21
 
23
22
  // Colors for terminal output
@@ -48,7 +47,7 @@ async function main() {
48
47
  console.log('')
49
48
 
50
49
  // Step 1: Detect Claude Code
51
- console.log(`${BOLD}[1/5]${NC} Detecting Claude Code...`)
50
+ console.log(`${BOLD}[1/3]${NC} Detecting Claude Code...`)
52
51
  const claudeDetected = await installer.detectClaude()
53
52
 
54
53
  if (!claudeDetected) {
@@ -61,7 +60,7 @@ async function main() {
61
60
  console.log('')
62
61
 
63
62
  // Step 2: Install/sync commands
64
- console.log(`${BOLD}[2/5]${NC} Installing commands to ~/.claude...`)
63
+ console.log(`${BOLD}[2/3]${NC} Installing commands to ~/.claude...`)
65
64
  const syncResult = await installer.syncCommands()
66
65
 
67
66
  if (syncResult.success) {
@@ -82,7 +81,7 @@ async function main() {
82
81
  console.log('')
83
82
 
84
83
  // Step 3: Install global configuration
85
- console.log(`${BOLD}[3/5]${NC} Installing global configuration...`)
84
+ console.log(`${BOLD}[3/3]${NC} Installing global configuration...`)
86
85
  const configResult = await installer.installGlobalConfig()
87
86
 
88
87
  if (configResult.success) {
@@ -99,26 +98,7 @@ async function main() {
99
98
  console.log('')
100
99
  }
101
100
 
102
- // Step 4: Migrate legacy projects
103
- console.log(`${BOLD}[4/5]${NC} Checking for legacy projects...`)
104
- const migrationResult = await migrator.migrateAll({
105
- deepScan: false, // Only search common directories
106
- cleanupLegacy: true, // Remove legacy directories, keep config
107
- dryRun: false
108
- })
109
-
110
- if (migrationResult.successfullyMigrated > 0) {
111
- console.log(`${GREEN}✓${NC} ${migrationResult.successfullyMigrated} projects migrated to global storage`)
112
- } else if (migrationResult.totalFound === 0) {
113
- console.log(`${DIM}No legacy projects found${NC}`)
114
- } else {
115
- console.log(`${DIM}All projects already migrated${NC}`)
116
- }
117
- console.log('')
118
-
119
- // Step 5: Show ASCII art and quick start
120
- console.log(`${BOLD}[5/5]${NC} Installation complete!`)
121
- console.log('')
101
+ // Show ASCII art and quick start
122
102
  showAsciiArt()
123
103
 
124
104
  } catch (error) {
@@ -0,0 +1,120 @@
1
+ # /p:migrate-all - Migrate All Legacy Projects
2
+
3
+ Migrates all legacy prjct projects to the new global storage architecture.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /p:migrate-all [--deep-scan] [--remove-legacy] [--dry-run]
9
+ ```
10
+
11
+ ## What This Command Does
12
+
13
+ 1. **Scans Global Storage**
14
+ - Reads all project IDs from `~/.prjct-cli/projects/`
15
+ - Retrieves project paths from `project.json` files
16
+
17
+ 2. **Detects Legacy Structure**
18
+ - Checks each project for old `.prjct/` directory structure
19
+ - Identifies projects that need migration
20
+
21
+ 3. **Migrates Each Project**
22
+ - Moves data from local `.prjct/` to global `~/.prjct-cli/projects/{id}/`
23
+ - Creates new minimal local config (`.prjct/prjct.config.json`)
24
+ - Preserves all project data and history
25
+
26
+ 4. **Cleanup (Optional)**
27
+ - Removes legacy `.prjct/` directories (with `--remove-legacy`)
28
+ - Keeps only the new minimal config file
29
+
30
+ 5. **Reports Summary**
31
+ - Shows migrated, skipped, and failed projects
32
+ - Lists detailed errors for any failures
33
+
34
+ ## Options
35
+
36
+ - `--deep-scan`: Scan entire file system (slow but thorough)
37
+ - `--remove-legacy`: Delete old `.prjct/` directories after successful migration
38
+ - `--dry-run`: Show what would be migrated without making changes
39
+
40
+ ## When to Use
41
+
42
+ - **After major version updates**: When architecture changes
43
+ - **Upgrading from v0.7.x to v0.8.x**: New global storage system
44
+ - **Consolidating projects**: Moving all projects to global storage
45
+ - **Troubleshooting**: If projects aren't working after update
46
+
47
+ ## Migration Process
48
+
49
+ ### Before (Legacy Structure)
50
+ ```
51
+ your-project/
52
+ .prjct/
53
+ core/
54
+ planning/
55
+ progress/
56
+ memory/
57
+ analysis/
58
+ prjct.config.json # Full config
59
+ ```
60
+
61
+ ### After (Global Storage)
62
+ ```
63
+ your-project/
64
+ .prjct/
65
+ prjct.config.json # Minimal (projectId + dataPath only)
66
+
67
+ ~/.prjct-cli/projects/3a5667a5dedb/
68
+ core/
69
+ planning/
70
+ progress/
71
+ memory/
72
+ analysis/
73
+ agents/
74
+ project.json # System config (authors, version, etc.)
75
+ ```
76
+
77
+ ## Output Example
78
+
79
+ ```
80
+ 🔄 Scanning for legacy prjct projects...
81
+
82
+ 📁 Found 3 projects in global storage
83
+
84
+ 🔄 Migrating: /Users/jj/Apps/my-app
85
+ ✅ Migrated successfully
86
+
87
+ 🔄 Migrating: /Users/jj/Apps/other-project
88
+ ⏭️ Already migrated
89
+
90
+ 📊 Migration Summary:
91
+ ✅ Migrated: 1
92
+ ⏭️ Skipped: 1
93
+ ❌ Failed: 0
94
+ ```
95
+
96
+ ## Error Handling
97
+
98
+ - **No global storage**: Creates directory structure
99
+ - **Missing project paths**: Skips projects with invalid paths
100
+ - **Permission errors**: Reports which projects couldn't be migrated
101
+ - **Already migrated**: Safely skips without changes
102
+
103
+ ## Safety
104
+
105
+ - **Idempotent**: Safe to run multiple times
106
+ - **Non-destructive**: Original files only removed with `--remove-legacy`
107
+ - **Dry run available**: Test migration with `--dry-run` first
108
+ - **Automatic backup**: Legacy data preserved until explicitly removed
109
+
110
+ ## Requirements
111
+
112
+ - Write permissions to `~/.prjct-cli/` and project directories
113
+ - Projects must have valid global config in `project.json`
114
+
115
+ ## Notes
116
+
117
+ - This command does NOT require an initialized prjct project
118
+ - Migration is automatic on install (but manual execution is safer)
119
+ - Always test with `--dry-run` first for large migrations
120
+ - Can be safely interrupted and resumed
@@ -0,0 +1,74 @@
1
+ # /p:setup - Reconfigure prjct-cli Installation
2
+
3
+ Reconfigures prjct-cli installation for Claude Code and Claude Desktop.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /p:setup [--force]
9
+ ```
10
+
11
+ ## What This Command Does
12
+
13
+ 1. **Detects Claude Installation**
14
+ - Checks if `~/.claude/` directory exists
15
+ - Verifies Claude Code or Claude Desktop is installed
16
+
17
+ 2. **Syncs Commands to Claude**
18
+ - Updates all `/p:*` commands in `~/.claude/commands/p/`
19
+ - Adds new commands from latest version
20
+ - Updates existing commands with latest templates
21
+ - Removes orphaned/deprecated commands
22
+
23
+ 3. **Installs/Updates Global Configuration**
24
+ - Creates or updates `~/.claude/CLAUDE.md`
25
+ - Adds prjct-specific instructions for Claude
26
+ - Preserves existing user configuration
27
+
28
+ 4. **Reports Results**
29
+ - Shows commands added, updated, removed
30
+ - Displays any errors encountered
31
+ - Confirms successful installation
32
+
33
+ ## Options
34
+
35
+ - `--force`: Remove existing installation and reinstall from scratch
36
+
37
+ ## When to Use
38
+
39
+ - **After updating prjct-cli**: `npm update -g prjct-cli && /p:setup`
40
+ - **Commands not working**: If `/p:*` commands aren't recognized
41
+ - **Fresh installation**: After installing on a new machine
42
+ - **Troubleshooting**: When encountering command-related issues
43
+
44
+ ## Requirements
45
+
46
+ - Claude Code or Claude Desktop must be installed
47
+ - Write permissions to `~/.claude/` directory
48
+
49
+ ## Output Example
50
+
51
+ ```
52
+ 🔧 Reconfiguring prjct...
53
+
54
+ 📦 Installing /p:* commands...
55
+ ✓ 3 nuevos, 12 actualizados, 1 eliminado
56
+
57
+ 📝 Installing global configuration...
58
+ ✓ Updated ~/.claude/CLAUDE.md
59
+
60
+ ✅ Setup complete!
61
+ ```
62
+
63
+ ## Error Handling
64
+
65
+ - **Claude not detected**: Shows installation URLs for Claude Code/Desktop
66
+ - **Permission errors**: Reports which files couldn't be written
67
+ - **Template errors**: Lists which commands failed to install
68
+
69
+ ## Notes
70
+
71
+ - This command does NOT migrate projects (use `/p:migrate-all` for that)
72
+ - This command does NOT require an initialized prjct project
73
+ - Safe to run multiple times (idempotent)
74
+ - Will not overwrite user customizations in `~/.claude/CLAUDE.md`