prjct-cli 0.36.1 → 0.37.1
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/CHANGELOG.md +64 -0
- package/README.md +68 -41
- package/bin/prjct.ts +13 -1
- package/core/agentic/template-executor.ts +14 -4
- package/core/cli/start.ts +14 -4
- package/core/commands/analysis.ts +6 -3
- package/core/commands/setup.ts +27 -17
- package/core/index.ts +45 -26
- package/core/infrastructure/ai-provider.ts +114 -12
- package/core/infrastructure/command-installer.ts +70 -37
- package/core/infrastructure/path-manager.ts +18 -9
- package/core/infrastructure/setup.ts +146 -3
- package/core/types/provider.ts +44 -20
- package/package.json +1 -1
- package/templates/_bases/tracker-base.md +7 -5
- package/templates/commands/github.md +7 -5
- package/templates/commands/init.md +16 -0
- package/templates/commands/jira.md +8 -6
- package/templates/commands/linear.md +8 -6
- package/templates/commands/monday.md +8 -6
- package/templates/commands/sync.md +11 -1
- package/templates/cursor/commands/bug.md +8 -0
- package/templates/cursor/commands/done.md +4 -0
- package/templates/cursor/commands/pause.md +6 -0
- package/templates/cursor/commands/resume.md +4 -0
- package/templates/cursor/commands/ship.md +8 -0
- package/templates/cursor/commands/sync.md +4 -0
- package/templates/cursor/commands/task.md +8 -0
- package/templates/cursor/p.md +29 -0
- package/templates/cursor/router.mdc +28 -0
- package/templates/global/CURSOR.mdc +238 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.37.1] - 2026-01-24
|
|
4
|
+
|
|
5
|
+
### Fix: Cursor Command Syntax (PRJ-65)
|
|
6
|
+
|
|
7
|
+
Fixed Cursor IDE commands not working. Cursor uses `/command` syntax, not `p. command`.
|
|
8
|
+
|
|
9
|
+
**Changes:**
|
|
10
|
+
- Created individual command files: `/sync`, `/task`, `/done`, `/ship`, `/bug`, `/pause`, `/resume`
|
|
11
|
+
- Updated `CURSOR.mdc` with correct `/command` syntax documentation
|
|
12
|
+
- Updated `router.mdc` with new syntax examples
|
|
13
|
+
- Updated `README.md` with Cursor-specific syntax section
|
|
14
|
+
- Fixed `installCursorProject()` to install all individual command files
|
|
15
|
+
|
|
16
|
+
**Cursor Syntax:**
|
|
17
|
+
```
|
|
18
|
+
/sync # Analyze project
|
|
19
|
+
/task "description" # Start task
|
|
20
|
+
/done # Complete subtask
|
|
21
|
+
/ship # Ship feature
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## [0.37.0] - 2026-01-24
|
|
27
|
+
|
|
28
|
+
### Feature: Cursor IDE Support (PRJ-63)
|
|
29
|
+
|
|
30
|
+
prjct now works with **Cursor IDE** in addition to Claude Code and Gemini CLI. Use any AI model Cursor supports (GPT-4, Claude, Gemini, DeepSeek, etc.).
|
|
31
|
+
|
|
32
|
+
**Key Insight:** Cursor has NO global config directory. Unlike Claude/Gemini which use `~/.claude/` and `~/.gemini/`, Cursor uses project-level config in `.cursor/`.
|
|
33
|
+
|
|
34
|
+
**Solution: Minimal Router Pattern**
|
|
35
|
+
- Router files are minimal (~15 lines), point to npm package for real instructions
|
|
36
|
+
- If deleted, `p. sync` regenerates them automatically
|
|
37
|
+
- Added to `.gitignore` - each developer regenerates their own
|
|
38
|
+
|
|
39
|
+
**New Files:**
|
|
40
|
+
- `templates/global/CURSOR.mdc` - Full prjct instructions for Cursor
|
|
41
|
+
- `templates/cursor/router.mdc` - Minimal router (installed in projects)
|
|
42
|
+
- `templates/cursor/p.md` - Command router for `p. <command>`
|
|
43
|
+
|
|
44
|
+
**Modified:**
|
|
45
|
+
- `core/types/provider.ts` - Added 'cursor' to AIProviderName
|
|
46
|
+
- `core/infrastructure/ai-provider.ts` - Added CursorProvider, detectCursorProject()
|
|
47
|
+
- `core/infrastructure/setup.ts` - Added installCursorProject(), hasCursorProject()
|
|
48
|
+
- `templates/commands/init.md` - Cursor detection and setup
|
|
49
|
+
- `templates/commands/sync.md` - Cursor router regeneration
|
|
50
|
+
- `bin/prjct.ts` - Cursor status in --version output
|
|
51
|
+
- `README.md` - Added Cursor to supported platforms
|
|
52
|
+
|
|
53
|
+
**Architecture:**
|
|
54
|
+
```
|
|
55
|
+
Claude/Gemini (CLI) Cursor (GUI)
|
|
56
|
+
~/.claude/CLAUDE.md .cursor/rules/prjct.mdc (router)
|
|
57
|
+
~/.gemini/GEMINI.md ↓
|
|
58
|
+
↓ npm/prjct-cli/templates/global/CURSOR.mdc
|
|
59
|
+
Global config ↓
|
|
60
|
+
└──────────────────────────┘
|
|
61
|
+
↓
|
|
62
|
+
~/.prjct-cli/projects/{id}/ (shared storage)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
3
67
|
## [0.36.1] - 2026-01-23
|
|
4
68
|
|
|
5
69
|
### Docs: Minimal README
|
package/README.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
**Context layer for AI coding agents.**
|
|
4
4
|
|
|
5
|
-
Works with Claude Code, Gemini CLI, and more.
|
|
5
|
+
Works with Claude Code, Gemini CLI, Cursor IDE, and more.
|
|
6
6
|
|
|
7
7
|
[](CLAUDE.md)
|
|
8
8
|
[]()
|
|
9
|
+
[]()
|
|
9
10
|
[](https://www.npmjs.com/package/prjct-cli)
|
|
10
11
|
|
|
11
12
|
## What is prjct?
|
|
@@ -13,81 +14,107 @@ Works with Claude Code, Gemini CLI, and more.
|
|
|
13
14
|
prjct gives AI coding agents the context they need about your project. It maintains state between sessions, tracks progress, and ensures agents understand your codebase.
|
|
14
15
|
|
|
15
16
|
```
|
|
16
|
-
Your AI Agent (Claude/Gemini) prjct
|
|
17
|
-
│
|
|
18
|
-
│ "What am I working on?"
|
|
19
|
-
│
|
|
20
|
-
│
|
|
21
|
-
│ Task: "Add user auth"
|
|
22
|
-
│ Branch: feature/auth
|
|
23
|
-
│ Subtask 2/5: API routes
|
|
24
|
-
│
|
|
25
|
-
│
|
|
26
|
-
▼
|
|
27
|
-
Writes code with full context
|
|
17
|
+
Your AI Agent (Claude/Gemini/Cursor) prjct
|
|
18
|
+
│ │
|
|
19
|
+
│ "What am I working on?" │
|
|
20
|
+
│ ───────────────────────────────► │
|
|
21
|
+
│ │ Reads project context
|
|
22
|
+
│ Task: "Add user auth" │
|
|
23
|
+
│ Branch: feature/auth │
|
|
24
|
+
│ Subtask 2/5: API routes │
|
|
25
|
+
│ ◄─────────────────────────────── │
|
|
26
|
+
│ │
|
|
27
|
+
▼ │
|
|
28
|
+
Writes code with full context │
|
|
28
29
|
```
|
|
29
30
|
|
|
30
31
|
## Install
|
|
31
32
|
|
|
32
33
|
```bash
|
|
33
34
|
npm install -g prjct-cli
|
|
34
|
-
prjct start
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
##
|
|
37
|
+
## Quick Start
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
### Claude Code / Gemini CLI
|
|
40
40
|
|
|
41
|
-
```
|
|
42
|
-
|
|
41
|
+
```bash
|
|
42
|
+
# 1. One-time global setup
|
|
43
|
+
prjct start
|
|
44
|
+
|
|
45
|
+
# 2. Initialize your project
|
|
46
|
+
cd my-project
|
|
47
|
+
prjct init
|
|
48
|
+
|
|
49
|
+
# 3. Open in Claude Code or Gemini CLI and use:
|
|
50
|
+
p. sync # Analyze project
|
|
43
51
|
p. task "add user auth" # Start a task
|
|
44
|
-
p. done # Complete
|
|
45
|
-
p. ship
|
|
52
|
+
p. done # Complete subtask
|
|
53
|
+
p. ship # Ship with PR
|
|
46
54
|
```
|
|
47
55
|
|
|
56
|
+
### Cursor IDE
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# 1. Initialize your project (no global setup needed)
|
|
60
|
+
cd my-project
|
|
61
|
+
prjct init
|
|
62
|
+
|
|
63
|
+
# 2. Open in Cursor and use:
|
|
64
|
+
/sync # Analyze project
|
|
65
|
+
/task "add user auth" # Start a task
|
|
66
|
+
/done # Complete subtask
|
|
67
|
+
/ship # Ship with PR
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
> **Note:** Cursor uses `/command` syntax. Commands are installed per-project in `.cursor/commands/`. If deleted, run `/sync` to regenerate.
|
|
71
|
+
|
|
48
72
|
### Core Workflow
|
|
49
73
|
|
|
50
74
|
```
|
|
51
|
-
p. sync → p. task "..." → [code] → p. done → p. ship
|
|
75
|
+
Claude/Gemini: p. sync → p. task "..." → [code] → p. done → p. ship
|
|
76
|
+
Cursor: /sync → /task "..." → [code] → /done → /ship
|
|
52
77
|
```
|
|
53
78
|
|
|
54
79
|
## How It Works
|
|
55
80
|
|
|
56
|
-
| Component | Claude Code | Gemini CLI |
|
|
57
|
-
|
|
58
|
-
| Router | `~/.claude/commands/p.md` | `~/.gemini/commands/p.toml` |
|
|
59
|
-
| Config | `~/.claude/CLAUDE.md` | `~/.gemini/GEMINI.md` |
|
|
60
|
-
| Storage | `~/.prjct-cli/projects/` | `~/.prjct-cli/projects/` |
|
|
81
|
+
| Component | Claude Code | Gemini CLI | Cursor IDE |
|
|
82
|
+
|-----------|-------------|------------|------------|
|
|
83
|
+
| Router | `~/.claude/commands/p.md` | `~/.gemini/commands/p.toml` | `.cursor/commands/*.md` |
|
|
84
|
+
| Config | `~/.claude/CLAUDE.md` | `~/.gemini/GEMINI.md` | `.cursor/rules/prjct.mdc` |
|
|
85
|
+
| Storage | `~/.prjct-cli/projects/` | `~/.prjct-cli/projects/` | `~/.prjct-cli/projects/` |
|
|
86
|
+
| Scope | Global | Global | Per-project |
|
|
87
|
+
| Syntax | `p. command` | `p. command` | `/command` |
|
|
61
88
|
|
|
62
|
-
|
|
89
|
+
All agents share the same project storage, so you can switch between them freely.
|
|
63
90
|
|
|
64
91
|
## Commands
|
|
65
92
|
|
|
66
|
-
|
|
|
67
|
-
|
|
68
|
-
| `p. sync` | Analyze project, generate domain agents |
|
|
69
|
-
| `p. task "desc"` | Start task with auto-classification |
|
|
70
|
-
| `p. done` | Complete current subtask |
|
|
71
|
-
| `p. ship "name"` | Ship feature with PR + version bump |
|
|
72
|
-
| `p. pause` | Pause current task |
|
|
73
|
-
| `p. resume` | Resume paused task |
|
|
74
|
-
| `p.
|
|
75
|
-
| `p.
|
|
93
|
+
| Claude/Gemini | Cursor | Description |
|
|
94
|
+
|---------------|--------|-------------|
|
|
95
|
+
| `p. sync` | `/sync` | Analyze project, generate domain agents |
|
|
96
|
+
| `p. task "desc"` | `/task "desc"` | Start task with auto-classification |
|
|
97
|
+
| `p. done` | `/done` | Complete current subtask |
|
|
98
|
+
| `p. ship "name"` | `/ship "name"` | Ship feature with PR + version bump |
|
|
99
|
+
| `p. pause` | `/pause` | Pause current task |
|
|
100
|
+
| `p. resume` | `/resume` | Resume paused task |
|
|
101
|
+
| `p. bug "desc"` | `/bug "desc"` | Report a bug |
|
|
102
|
+
| `p. linear` | - | Linear integration |
|
|
103
|
+
| `p. github` | - | GitHub Issues integration |
|
|
76
104
|
|
|
77
105
|
## CLI Commands
|
|
78
106
|
|
|
79
107
|
```bash
|
|
80
|
-
prjct start # First-time setup
|
|
108
|
+
prjct start # First-time setup (Claude/Gemini)
|
|
109
|
+
prjct init # Initialize project (+ Cursor setup)
|
|
81
110
|
prjct --version # Show version + provider status
|
|
82
111
|
prjct --help # Show help
|
|
83
|
-
prjct init # Initialize project
|
|
84
|
-
prjct sync # Sync project state
|
|
85
112
|
```
|
|
86
113
|
|
|
87
114
|
## Requirements
|
|
88
115
|
|
|
89
116
|
- Node.js 18+ or Bun 1.0+
|
|
90
|
-
- Claude Code
|
|
117
|
+
- One of: Claude Code, Gemini CLI, or Cursor IDE
|
|
91
118
|
|
|
92
119
|
## Links
|
|
93
120
|
|
package/bin/prjct.ts
CHANGED
|
@@ -89,8 +89,11 @@ if (args[0] === 'start' || args[0] === 'setup') {
|
|
|
89
89
|
// Show version with provider status
|
|
90
90
|
const detection = detectAllProviders()
|
|
91
91
|
const home = os.homedir()
|
|
92
|
+
const cwd = process.cwd()
|
|
92
93
|
const claudeConfigured = fs.existsSync(path.join(home, '.claude', 'commands', 'p.md'))
|
|
93
94
|
const geminiConfigured = fs.existsSync(path.join(home, '.gemini', 'commands', 'p.toml'))
|
|
95
|
+
const cursorDetected = fs.existsSync(path.join(cwd, '.cursor'))
|
|
96
|
+
const cursorConfigured = fs.existsSync(path.join(cwd, '.cursor', 'rules', 'prjct.mdc'))
|
|
94
97
|
|
|
95
98
|
const GREEN = '\x1b[32m'
|
|
96
99
|
|
|
@@ -118,8 +121,17 @@ ${DIM}Providers:${RESET}`)
|
|
|
118
121
|
console.log(` Gemini CLI ${DIM}○ not installed${RESET}`)
|
|
119
122
|
}
|
|
120
123
|
|
|
124
|
+
// Cursor status (project-level)
|
|
125
|
+
if (cursorDetected) {
|
|
126
|
+
const status = cursorConfigured ? `${GREEN}✓ ready${RESET}` : `${YELLOW}● detected${RESET}`
|
|
127
|
+
console.log(` Cursor IDE ${status}${DIM} (project)${RESET}`)
|
|
128
|
+
} else {
|
|
129
|
+
console.log(` Cursor IDE ${DIM}○ not detected${RESET}`)
|
|
130
|
+
}
|
|
131
|
+
|
|
121
132
|
console.log(`
|
|
122
|
-
${DIM}Run 'prjct start' to configure${RESET}
|
|
133
|
+
${DIM}Run 'prjct start' to configure (CLI providers)${RESET}
|
|
134
|
+
${DIM}Run 'prjct init' to configure (Cursor IDE)${RESET}
|
|
123
135
|
${CYAN}https://prjct.app${RESET}
|
|
124
136
|
`)
|
|
125
137
|
} else {
|
|
@@ -27,7 +27,11 @@ export interface TemplateExecutionContext {
|
|
|
27
27
|
command: string
|
|
28
28
|
args: string
|
|
29
29
|
|
|
30
|
-
//
|
|
30
|
+
// Agent information
|
|
31
|
+
agentName: string
|
|
32
|
+
agentSettingsPath: string
|
|
33
|
+
|
|
34
|
+
// Paths for agent (not content)
|
|
31
35
|
paths: {
|
|
32
36
|
orchestrator: string
|
|
33
37
|
agentRouting: string
|
|
@@ -85,6 +89,8 @@ export class TemplateExecutor {
|
|
|
85
89
|
): Promise<TemplateExecutionContext> {
|
|
86
90
|
const projectId = await this.getProjectId(projectPath)
|
|
87
91
|
const globalPath = pathManager.getGlobalProjectPath(projectId)
|
|
92
|
+
const aiProvider = require('../infrastructure/ai-provider')
|
|
93
|
+
const activeProvider = aiProvider.getActiveProvider()
|
|
88
94
|
|
|
89
95
|
// Get templates directory - use local path during development
|
|
90
96
|
let templatesDir: string
|
|
@@ -102,6 +108,8 @@ export class TemplateExecutor {
|
|
|
102
108
|
globalPath,
|
|
103
109
|
command,
|
|
104
110
|
args,
|
|
111
|
+
agentName: activeProvider.displayName,
|
|
112
|
+
agentSettingsPath: pathManager.getAgentSettingsPath(),
|
|
105
113
|
paths: {
|
|
106
114
|
orchestrator: path.join(templatesDir, 'agentic', 'orchestrator.md'),
|
|
107
115
|
agentRouting: path.join(templatesDir, 'agentic', 'agent-routing.md'),
|
|
@@ -109,7 +117,7 @@ export class TemplateExecutor {
|
|
|
109
117
|
commandTemplate: path.join(templatesDir, 'commands', `${command}.md`),
|
|
110
118
|
repoAnalysis: path.join(globalPath, 'analysis', 'repo-analysis.json'),
|
|
111
119
|
agentsDir: path.join(globalPath, 'agents'),
|
|
112
|
-
skillsDir:
|
|
120
|
+
skillsDir: activeProvider.skillsDir,
|
|
113
121
|
stateJson: path.join(globalPath, 'storage', 'state.json'),
|
|
114
122
|
}
|
|
115
123
|
}
|
|
@@ -157,7 +165,7 @@ export class TemplateExecutor {
|
|
|
157
165
|
}
|
|
158
166
|
|
|
159
167
|
/**
|
|
160
|
-
* Build prompt that tells
|
|
168
|
+
* Build prompt that tells agent to execute templates agentically
|
|
161
169
|
*/
|
|
162
170
|
buildAgenticPrompt(context: TemplateExecutionContext): AgenticPromptInfo {
|
|
163
171
|
const requiresOrchestration = this.requiresOrchestration(context.command)
|
|
@@ -165,9 +173,11 @@ export class TemplateExecutor {
|
|
|
165
173
|
const prompt = `
|
|
166
174
|
## Agentic Execution Mode
|
|
167
175
|
|
|
168
|
-
You are executing a prjct command. Follow the template-first approach.
|
|
176
|
+
You are executing a prjct command as ${context.agentName}. Follow the template-first approach.
|
|
169
177
|
|
|
170
178
|
### Context
|
|
179
|
+
- Agent: ${context.agentName}
|
|
180
|
+
- Settings: ${context.agentSettingsPath}
|
|
171
181
|
- Command: ${context.command}
|
|
172
182
|
- Args: ${context.args}
|
|
173
183
|
- Project: ${context.projectPath}
|
package/core/cli/start.ts
CHANGED
|
@@ -198,12 +198,17 @@ async function selectProviders(): Promise<AIProviderName[]> {
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
|
-
* Install router for a provider
|
|
201
|
+
* Install router for a CLI-based provider (Claude/Gemini)
|
|
202
|
+
* Note: Cursor uses project-level config, not global
|
|
202
203
|
*/
|
|
203
204
|
async function installRouter(provider: AIProviderName): Promise<boolean> {
|
|
204
|
-
const home = os.homedir()
|
|
205
205
|
const config = Providers[provider]
|
|
206
206
|
|
|
207
|
+
// Skip project-level providers (Cursor)
|
|
208
|
+
if (!config.configDir) {
|
|
209
|
+
return false
|
|
210
|
+
}
|
|
211
|
+
|
|
207
212
|
try {
|
|
208
213
|
// Create commands directory
|
|
209
214
|
const commandsDir = path.join(config.configDir, 'commands')
|
|
@@ -231,12 +236,17 @@ async function installRouter(provider: AIProviderName): Promise<boolean> {
|
|
|
231
236
|
}
|
|
232
237
|
|
|
233
238
|
/**
|
|
234
|
-
* Install global config for a provider
|
|
239
|
+
* Install global config for a CLI-based provider (Claude/Gemini)
|
|
240
|
+
* Note: Cursor uses project-level config, not global
|
|
235
241
|
*/
|
|
236
242
|
async function installGlobalConfig(provider: AIProviderName): Promise<boolean> {
|
|
237
|
-
const home = os.homedir()
|
|
238
243
|
const config = Providers[provider]
|
|
239
244
|
|
|
245
|
+
// Skip project-level providers (Cursor)
|
|
246
|
+
if (!config.configDir) {
|
|
247
|
+
return false
|
|
248
|
+
}
|
|
249
|
+
|
|
240
250
|
try {
|
|
241
251
|
// Ensure config directory exists
|
|
242
252
|
fs.mkdirSync(config.configDir, { recursive: true })
|
|
@@ -74,14 +74,17 @@ export class AnalysisCommands extends PrjctCommandsBase {
|
|
|
74
74
|
|
|
75
75
|
await generateContext(projectId!, projectPath)
|
|
76
76
|
|
|
77
|
+
const aiProvider = require('../infrastructure/ai-provider')
|
|
78
|
+
const activeProvider = aiProvider.getActiveProvider()
|
|
79
|
+
|
|
77
80
|
const globalConfigResult = await commandInstaller.installGlobalConfig()
|
|
78
81
|
if (globalConfigResult.success) {
|
|
79
|
-
console.log(
|
|
82
|
+
console.log(`📝 Updated ${pathManager.getDisplayPath(globalConfigResult.path!)}`)
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
console.log('✅ Analysis complete!\n')
|
|
83
86
|
console.log('📄 Full report: analysis/repo-summary.md')
|
|
84
|
-
console.log(
|
|
87
|
+
console.log(`📝 Context: ~/.prjct-cli/projects/${projectId}/${activeProvider.contextFile}\n`)
|
|
85
88
|
console.log('Next steps:')
|
|
86
89
|
console.log('• /p:sync → Generate agents based on stack')
|
|
87
90
|
console.log('• /p:feature → Add a new feature')
|
|
@@ -220,7 +223,7 @@ export class AnalysisCommands extends PrjctCommandsBase {
|
|
|
220
223
|
// Update global config
|
|
221
224
|
const globalConfigResult = await commandInstaller.installGlobalConfig()
|
|
222
225
|
if (globalConfigResult.success) {
|
|
223
|
-
console.log(
|
|
226
|
+
console.log(`📝 Updated ${pathManager.getDisplayPath(globalConfigResult.path!)}`)
|
|
224
227
|
}
|
|
225
228
|
|
|
226
229
|
// Format output
|
package/core/commands/setup.ts
CHANGED
|
@@ -17,17 +17,19 @@ export class SetupCommands extends PrjctCommandsBase {
|
|
|
17
17
|
* First-time setup - Install commands to editors
|
|
18
18
|
*/
|
|
19
19
|
async start(): Promise<CommandResult> {
|
|
20
|
-
|
|
20
|
+
const aiProvider = require('../infrastructure/ai-provider')
|
|
21
|
+
const activeProvider = aiProvider.getActiveProvider()
|
|
22
|
+
|
|
23
|
+
console.log(`🚀 Setting up prjct for ${activeProvider.displayName}...\n`)
|
|
21
24
|
|
|
22
25
|
const status = await commandInstaller.checkInstallation()
|
|
23
26
|
|
|
24
|
-
if (!status.claudeDetected) {
|
|
27
|
+
if (!status.claudeDetected) { // Note: variable name is legacy, checks active provider
|
|
25
28
|
return {
|
|
26
29
|
success: false,
|
|
27
30
|
message:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
' - Claude Desktop: https://claude.com/desktop',
|
|
31
|
+
`❌ ${activeProvider.displayName} not detected.\n\nPlease install it first:\n` +
|
|
32
|
+
` - ${activeProvider.displayName}: ${activeProvider.docsUrl}`,
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -41,7 +43,7 @@ export class SetupCommands extends PrjctCommandsBase {
|
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
console.log(`\n✅ Installed ${result.installed?.length ?? 0} commands to:\n ${result.path}`)
|
|
46
|
+
console.log(`\n✅ Installed ${result.installed?.length ?? 0} commands to:\n ${pathManager.getDisplayPath(result.path || '')}`)
|
|
45
47
|
|
|
46
48
|
if ((result.errors?.length ?? 0) > 0) {
|
|
47
49
|
console.log(`\n⚠️ ${result.errors?.length ?? 0} errors:`)
|
|
@@ -50,9 +52,9 @@ export class SetupCommands extends PrjctCommandsBase {
|
|
|
50
52
|
|
|
51
53
|
console.log('\n🎉 Setup complete!')
|
|
52
54
|
console.log('\nNext steps:')
|
|
53
|
-
console.log(
|
|
55
|
+
console.log(` 1. Open ${activeProvider.displayName}`)
|
|
54
56
|
console.log(' 2. Navigate to your project')
|
|
55
|
-
console.log(' 3. Run: /p:init')
|
|
57
|
+
console.log(' 3. Run: /p:init') // This might need adjustment for Gemini (p init) but /p:init is likely fine for now or we can make it dynamic
|
|
56
58
|
|
|
57
59
|
return {
|
|
58
60
|
success: true,
|
|
@@ -90,25 +92,32 @@ export class SetupCommands extends PrjctCommandsBase {
|
|
|
90
92
|
|
|
91
93
|
console.log('\n📝 Installing global configuration...')
|
|
92
94
|
const configResult = await commandInstaller.installGlobalConfig()
|
|
95
|
+
const displayPath = configResult.path ? pathManager.getDisplayPath(configResult.path) : 'global config'
|
|
93
96
|
|
|
94
97
|
if (configResult.success) {
|
|
95
98
|
if (configResult.action === 'created') {
|
|
96
|
-
console.log(
|
|
99
|
+
console.log(`✅ Created ${displayPath}`)
|
|
97
100
|
} else if (configResult.action === 'updated') {
|
|
98
|
-
console.log(
|
|
101
|
+
console.log(`✅ Updated ${displayPath}`)
|
|
99
102
|
} else if (configResult.action === 'appended') {
|
|
100
|
-
console.log(
|
|
103
|
+
console.log(`✅ Added prjct config to ${displayPath}`)
|
|
101
104
|
}
|
|
102
105
|
} else {
|
|
103
106
|
console.log(`⚠️ ${configResult.error}`)
|
|
104
107
|
}
|
|
105
108
|
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
console.log(
|
|
109
|
+
const aiProvider = require('../infrastructure/ai-provider')
|
|
110
|
+
const activeProvider = aiProvider.getActiveProvider()
|
|
111
|
+
|
|
112
|
+
// Status line is currently Claude-only
|
|
113
|
+
if (activeProvider.name === 'claude') {
|
|
114
|
+
console.log('\n⚡ Installing status line...')
|
|
115
|
+
const statusLineResult = await this.installStatusLine()
|
|
116
|
+
if (statusLineResult.success) {
|
|
117
|
+
console.log('✅ Status line configured')
|
|
118
|
+
} else {
|
|
119
|
+
console.log(`⚠️ ${statusLineResult.error}`)
|
|
120
|
+
}
|
|
112
121
|
}
|
|
113
122
|
|
|
114
123
|
console.log('\n🎉 Setup complete!\n')
|
|
@@ -126,6 +135,7 @@ export class SetupCommands extends PrjctCommandsBase {
|
|
|
126
135
|
*/
|
|
127
136
|
async installStatusLine(): Promise<{ success: boolean; error?: string }> {
|
|
128
137
|
try {
|
|
138
|
+
// Note: This method is currently Claude-specific
|
|
129
139
|
const claudeDir = pathManager.getClaudeDir()
|
|
130
140
|
const settingsPath = pathManager.getClaudeSettingsPath()
|
|
131
141
|
const statusLinePath = path.join(claudeDir, 'prjct-statusline.sh')
|
package/core/index.ts
CHANGED
|
@@ -198,11 +198,15 @@ function displayVersion(version: string): void {
|
|
|
198
198
|
const claudeConfigured = fs.existsSync(claudeCommandPath)
|
|
199
199
|
const geminiConfigured = fs.existsSync(geminiCommandPath)
|
|
200
200
|
|
|
201
|
+
// Check current project for Cursor
|
|
202
|
+
const cursorConfigured = fs.existsSync(path.join(process.cwd(), '.cursor', 'commands', 'sync.md'))
|
|
203
|
+
const cursorExists = fs.existsSync(path.join(process.cwd(), '.cursor'))
|
|
204
|
+
|
|
201
205
|
console.log(`
|
|
202
206
|
${CYAN}p/${RESET} prjct v${version}
|
|
203
207
|
${DIM}Context layer for AI coding agents${RESET}
|
|
204
208
|
|
|
205
|
-
${DIM}Providers:${RESET}`)
|
|
209
|
+
${DIM}Global Providers:${RESET}`)
|
|
206
210
|
|
|
207
211
|
// Claude status
|
|
208
212
|
if (detection.claude.installed) {
|
|
@@ -222,8 +226,19 @@ ${DIM}Providers:${RESET}`)
|
|
|
222
226
|
console.log(` Gemini CLI ${DIM}○ not installed${RESET}`)
|
|
223
227
|
}
|
|
224
228
|
|
|
229
|
+
// Cursor status (per-project)
|
|
230
|
+
console.log(`
|
|
231
|
+
${DIM}Project Providers:${RESET}`)
|
|
232
|
+
if (cursorConfigured) {
|
|
233
|
+
console.log(` Cursor IDE ${GREEN}✓ ready${RESET} ${DIM}(use /sync, /task)${RESET}`)
|
|
234
|
+
} else if (cursorExists) {
|
|
235
|
+
console.log(` Cursor IDE ${YELLOW}● detected${RESET} ${DIM}(run prjct init)${RESET}`)
|
|
236
|
+
} else {
|
|
237
|
+
console.log(` Cursor IDE ${DIM}○ no .cursor/ folder${RESET}`)
|
|
238
|
+
}
|
|
239
|
+
|
|
225
240
|
console.log(`
|
|
226
|
-
${DIM}Run 'prjct start'
|
|
241
|
+
${DIM}Run 'prjct start' for Claude/Gemini, 'prjct init' for Cursor${RESET}
|
|
227
242
|
${CYAN}https://prjct.app${RESET}
|
|
228
243
|
`)
|
|
229
244
|
}
|
|
@@ -234,45 +249,49 @@ ${CYAN}https://prjct.app${RESET}
|
|
|
234
249
|
function displayHelp(): void {
|
|
235
250
|
console.log(`
|
|
236
251
|
prjct - Context layer for AI coding agents
|
|
237
|
-
Works with Claude Code, Gemini CLI, and more.
|
|
252
|
+
Works with Claude Code, Gemini CLI, Cursor IDE, and more.
|
|
238
253
|
|
|
239
254
|
QUICK START
|
|
240
255
|
-----------
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
256
|
+
Claude/Gemini:
|
|
257
|
+
1. prjct start Configure your AI provider
|
|
258
|
+
2. cd my-project && prjct init
|
|
259
|
+
3. Open in Claude Code or Gemini CLI
|
|
260
|
+
4. Type: p. sync Analyze project
|
|
261
|
+
|
|
262
|
+
Cursor IDE:
|
|
263
|
+
1. cd my-project && prjct init
|
|
264
|
+
2. Open in Cursor
|
|
265
|
+
3. Type: /sync Analyze project
|
|
266
|
+
|
|
267
|
+
COMMANDS (inside your AI agent)
|
|
268
|
+
-------------------------------
|
|
269
|
+
Claude/Gemini Cursor Description
|
|
270
|
+
─────────────────────────────────────────────────────
|
|
271
|
+
p. sync /sync Analyze project
|
|
272
|
+
p. task "desc" /task "desc" Start a task
|
|
273
|
+
p. done /done Complete subtask
|
|
274
|
+
p. ship "name" /ship "name" Ship with PR
|
|
255
275
|
|
|
256
276
|
TERMINAL COMMANDS (this CLI)
|
|
257
277
|
----------------------------
|
|
258
|
-
prjct start First-time setup
|
|
278
|
+
prjct start First-time setup (Claude/Gemini global config)
|
|
279
|
+
prjct init Initialize project (required for Cursor)
|
|
259
280
|
prjct setup Reconfigure installations
|
|
260
|
-
prjct init Initialize project (creates .prjct/)
|
|
261
281
|
prjct sync Sync project state
|
|
262
282
|
|
|
263
283
|
EXAMPLES
|
|
264
284
|
--------
|
|
265
|
-
#
|
|
285
|
+
# Claude Code / Gemini CLI (global setup, then per-project)
|
|
266
286
|
$ prjct start
|
|
267
|
-
|
|
268
|
-
# Initialize a new project
|
|
269
287
|
$ cd my-project && prjct init
|
|
270
|
-
|
|
271
|
-
# Inside Claude Code or Gemini CLI
|
|
272
288
|
> p. sync
|
|
273
289
|
> p. task "add user authentication"
|
|
274
|
-
|
|
275
|
-
|
|
290
|
+
|
|
291
|
+
# Cursor IDE (per-project only)
|
|
292
|
+
$ cd my-project && prjct init
|
|
293
|
+
> /sync
|
|
294
|
+
> /task "add user authentication"
|
|
276
295
|
|
|
277
296
|
MORE INFO
|
|
278
297
|
---------
|