prjct-cli 0.35.4 → 0.37.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/CHANGELOG.md +84 -0
- package/README.md +64 -618
- package/bin/prjct.ts +128 -17
- package/core/agentic/template-executor.ts +14 -4
- package/core/cli/start.ts +397 -0
- package/core/commands/analysis.ts +6 -3
- package/core/commands/setup.ts +27 -17
- package/core/index.ts +101 -35
- package/core/infrastructure/ai-provider.ts +414 -0
- package/core/infrastructure/command-installer.ts +119 -42
- package/core/infrastructure/editors-config.ts +20 -6
- package/core/infrastructure/path-manager.ts +18 -9
- package/core/infrastructure/setup.ts +356 -62
- package/core/services/skill-service.ts +52 -16
- package/core/types/index.ts +12 -0
- package/core/types/provider.ts +134 -0
- package/core/utils/branding.ts +20 -3
- package/dist/bin/prjct.mjs +1482 -2763
- package/dist/core/infrastructure/command-installer.js +33 -2
- package/dist/core/infrastructure/editors-config.js +13 -3
- package/dist/core/infrastructure/setup.js +293 -73
- package/package.json +9 -9
- package/scripts/postinstall.js +17 -119
- package/templates/_bases/tracker-base.md +7 -5
- package/templates/agents/AGENTS.md +9 -1
- 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/p.md +1 -1
- package/templates/commands/p.toml +37 -0
- package/templates/commands/sync.md +11 -1
- package/templates/cursor/p.md +29 -0
- package/templates/cursor/router.mdc +28 -0
- package/templates/global/CLAUDE.md +33 -1
- package/templates/global/CURSOR.mdc +233 -0
- package/templates/global/GEMINI.md +265 -0
- package/templates/global/STORAGE-SPEC.md +256 -0
- package/templates/global/docs/agents.md +88 -0
- package/templates/global/docs/architecture.md +103 -0
- package/templates/global/docs/commands.md +96 -0
- package/templates/global/docs/validation.md +95 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Provider Types
|
|
3
|
+
*
|
|
4
|
+
* Abstractions for supporting multiple AI coding agents:
|
|
5
|
+
* - Claude Code (CLI)
|
|
6
|
+
* - Gemini CLI (CLI)
|
|
7
|
+
* - Cursor IDE (GUI, project-level config)
|
|
8
|
+
*
|
|
9
|
+
* Key discovery: Skills use identical SKILL.md format for CLI providers.
|
|
10
|
+
* Cursor uses .mdc files with frontmatter for rules.
|
|
11
|
+
*
|
|
12
|
+
* @see https://geminicli.com/docs/cli/gemini-md/
|
|
13
|
+
* @see https://geminicli.com/docs/cli/skills/
|
|
14
|
+
* @see https://cursor.com/docs/context/rules
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Supported AI provider names
|
|
19
|
+
*/
|
|
20
|
+
export type AIProviderName = 'claude' | 'gemini' | 'cursor'
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Command format for each provider
|
|
24
|
+
* - Claude: Markdown files (.md)
|
|
25
|
+
* - Gemini: TOML files (.toml)
|
|
26
|
+
*/
|
|
27
|
+
export type CommandFormat = 'md' | 'toml'
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* AI Provider configuration
|
|
31
|
+
* Defines paths and formats for each AI coding agent
|
|
32
|
+
*/
|
|
33
|
+
export interface AIProviderConfig {
|
|
34
|
+
/** Provider identifier */
|
|
35
|
+
name: AIProviderName
|
|
36
|
+
|
|
37
|
+
/** Display name for UI/logs */
|
|
38
|
+
displayName: string
|
|
39
|
+
|
|
40
|
+
/** CLI command name (e.g., 'claude', 'gemini'). Null for GUI apps like Cursor */
|
|
41
|
+
cliCommand: string | null
|
|
42
|
+
|
|
43
|
+
/** Global config directory (e.g., ~/.claude, ~/.gemini). Null for project-level only (Cursor) */
|
|
44
|
+
configDir: string | null
|
|
45
|
+
|
|
46
|
+
/** Context file name (CLAUDE.md, GEMINI.md, or prjct.mdc for Cursor) */
|
|
47
|
+
contextFile: string
|
|
48
|
+
|
|
49
|
+
/** Skills directory (e.g., ~/.claude/skills). Null for providers without skill support */
|
|
50
|
+
skillsDir: string | null
|
|
51
|
+
|
|
52
|
+
/** Commands directory relative to project (e.g., .claude/commands, .cursor/commands) */
|
|
53
|
+
commandsDir: string
|
|
54
|
+
|
|
55
|
+
/** Rules directory for project-level config (e.g., .cursor/rules). Only used by Cursor */
|
|
56
|
+
rulesDir?: string
|
|
57
|
+
|
|
58
|
+
/** Command file format */
|
|
59
|
+
commandFormat: CommandFormat
|
|
60
|
+
|
|
61
|
+
/** Settings file name (settings.json). Null if not applicable */
|
|
62
|
+
settingsFile: string | null
|
|
63
|
+
|
|
64
|
+
/** Project settings file (e.g., settings.local.json). Null if not applicable */
|
|
65
|
+
projectSettingsFile: string | null
|
|
66
|
+
|
|
67
|
+
/** Ignore file name (.claudeignore, .geminiignore, .cursorignore) */
|
|
68
|
+
ignoreFile: string
|
|
69
|
+
|
|
70
|
+
/** Whether config is project-level only (no global config directory) */
|
|
71
|
+
isProjectLevel?: boolean
|
|
72
|
+
|
|
73
|
+
/** URL for provider website */
|
|
74
|
+
websiteUrl: string
|
|
75
|
+
|
|
76
|
+
/** URL for provider documentation */
|
|
77
|
+
docsUrl: string
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Provider detection result
|
|
82
|
+
*/
|
|
83
|
+
export interface ProviderDetectionResult {
|
|
84
|
+
/** Whether the provider CLI is installed */
|
|
85
|
+
installed: boolean
|
|
86
|
+
|
|
87
|
+
/** Provider version if installed */
|
|
88
|
+
version?: string
|
|
89
|
+
|
|
90
|
+
/** Path to the CLI executable */
|
|
91
|
+
path?: string
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Result of provider selection during setup
|
|
96
|
+
*/
|
|
97
|
+
export interface ProviderSelectionResult {
|
|
98
|
+
/** Selected provider */
|
|
99
|
+
provider: AIProviderName
|
|
100
|
+
|
|
101
|
+
/** Whether user was prompted to choose (multiple installed) */
|
|
102
|
+
userSelected: boolean
|
|
103
|
+
|
|
104
|
+
/** Detection details for CLI-based providers */
|
|
105
|
+
detection: {
|
|
106
|
+
claude: ProviderDetectionResult
|
|
107
|
+
gemini: ProviderDetectionResult
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Result of Cursor project detection
|
|
113
|
+
*/
|
|
114
|
+
export interface CursorProjectDetection {
|
|
115
|
+
/** Whether .cursor/ directory exists in project */
|
|
116
|
+
detected: boolean
|
|
117
|
+
|
|
118
|
+
/** Whether prjct router is installed */
|
|
119
|
+
routerInstalled: boolean
|
|
120
|
+
|
|
121
|
+
/** Project root path */
|
|
122
|
+
projectRoot?: string
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Provider-aware branding configuration
|
|
127
|
+
*/
|
|
128
|
+
export interface ProviderBranding {
|
|
129
|
+
/** Commit footer text */
|
|
130
|
+
commitFooter: string
|
|
131
|
+
|
|
132
|
+
/** Short signature */
|
|
133
|
+
signature: string
|
|
134
|
+
}
|
package/core/utils/branding.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Branding Configuration for prjct-cli
|
|
3
|
-
* Single source of truth for all branding across CLI and
|
|
3
|
+
* Single source of truth for all branding across CLI and AI agents
|
|
4
|
+
*
|
|
5
|
+
* Supports multiple AI providers (Claude Code, Gemini CLI)
|
|
4
6
|
*/
|
|
5
7
|
|
|
6
8
|
import chalk from 'chalk'
|
|
9
|
+
import type { AIProviderName } from '../types/provider'
|
|
10
|
+
import { getProviderBranding, Providers } from '../infrastructure/ai-provider'
|
|
7
11
|
|
|
8
12
|
const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']
|
|
9
13
|
const SPINNER_SPEED = 80
|
|
@@ -30,6 +34,9 @@ interface Branding {
|
|
|
30
34
|
website: string
|
|
31
35
|
docs: string
|
|
32
36
|
}
|
|
37
|
+
// Provider-aware methods
|
|
38
|
+
getCommitFooter: (provider?: AIProviderName) => string
|
|
39
|
+
getSignature: (provider?: AIProviderName) => string
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
const branding: Branding = {
|
|
@@ -52,13 +59,13 @@ const branding: Branding = {
|
|
|
52
59
|
chalk.cyan('⚡') + ' ' + chalk.cyan('prjct') + ' ' + chalk.cyan(SPINNER_FRAMES[frame % 10]) + ' ' + chalk.dim(msg || '')
|
|
53
60
|
},
|
|
54
61
|
|
|
55
|
-
// Template
|
|
62
|
+
// Template (plain text)
|
|
56
63
|
template: {
|
|
57
64
|
header: '⚡ prjct',
|
|
58
65
|
footer: '⚡ prjct'
|
|
59
66
|
},
|
|
60
67
|
|
|
61
|
-
// Git commit footer
|
|
68
|
+
// Default Git commit footer (Claude - for backward compatibility)
|
|
62
69
|
commitFooter: `🤖 Generated with [p/](https://www.prjct.app/)
|
|
63
70
|
Designed for [Claude](https://www.anthropic.com/claude)`,
|
|
64
71
|
|
|
@@ -66,6 +73,16 @@ Designed for [Claude](https://www.anthropic.com/claude)`,
|
|
|
66
73
|
urls: {
|
|
67
74
|
website: 'https://prjct.app',
|
|
68
75
|
docs: 'https://prjct.app/docs'
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
// Provider-aware commit footer
|
|
79
|
+
getCommitFooter: (provider: AIProviderName = 'claude') => {
|
|
80
|
+
return getProviderBranding(provider).commitFooter
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
// Provider-aware signature
|
|
84
|
+
getSignature: (provider: AIProviderName = 'claude') => {
|
|
85
|
+
return getProviderBranding(provider).signature
|
|
69
86
|
}
|
|
70
87
|
}
|
|
71
88
|
|