grg-kit-cli 0.4.0 → 0.5.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 +6 -6
- package/bin/grg.js +4 -4
- package/commands/init.js +29 -4
- package/package.json +7 -6
- package/scripts/generate-resources.js +0 -0
- /package/commands/{llm-prompts.js → llm-setup.js} +0 -0
package/README.md
CHANGED
|
@@ -98,19 +98,19 @@ Examples:
|
|
|
98
98
|
grg list themes # List all themes
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
### `grg llm-
|
|
101
|
+
### `grg llm-setup`
|
|
102
102
|
|
|
103
103
|
Generate LLM-specific prompts and rules for AI assistants (Windsurf, Cursor, etc.).
|
|
104
104
|
|
|
105
105
|
```bash
|
|
106
|
-
grg llm-
|
|
106
|
+
grg llm-setup [options]
|
|
107
107
|
|
|
108
108
|
Options:
|
|
109
109
|
-o, --output <path> Output directory for rules (default: ".windsurf/rules")
|
|
110
110
|
|
|
111
111
|
Examples:
|
|
112
|
-
grg llm-
|
|
113
|
-
grg llm-
|
|
112
|
+
grg llm-setup
|
|
113
|
+
grg llm-setup --output .cursor/rules
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
## MCP Server Integration
|
|
@@ -153,7 +153,7 @@ pnpm install -g @grg-kit/mcp-server
|
|
|
153
153
|
|
|
154
154
|
```bash
|
|
155
155
|
cd your-angular-project
|
|
156
|
-
grg llm-
|
|
156
|
+
grg llm-setup
|
|
157
157
|
```
|
|
158
158
|
|
|
159
159
|
### 4. Restart Your IDE
|
|
@@ -185,7 +185,7 @@ grg list blocks # Available blocks
|
|
|
185
185
|
grg list themes # Available themes
|
|
186
186
|
|
|
187
187
|
# AI setup
|
|
188
|
-
grg llm-
|
|
188
|
+
grg llm-setup # Generate AI rules
|
|
189
189
|
```
|
|
190
190
|
|
|
191
191
|
## License
|
package/bin/grg.js
CHANGED
|
@@ -4,14 +4,14 @@ const { Command } = require('commander');
|
|
|
4
4
|
const { add } = require('../commands/add');
|
|
5
5
|
const { list } = require('../commands/list');
|
|
6
6
|
const { init } = require('../commands/init');
|
|
7
|
-
const { llmPrompts } = require('../commands/llm-
|
|
7
|
+
const { llmPrompts } = require('../commands/llm-setup');
|
|
8
8
|
|
|
9
9
|
const program = new Command();
|
|
10
10
|
|
|
11
11
|
program
|
|
12
12
|
.name('grg')
|
|
13
13
|
.description('GRG Kit CLI - Initialize your Angular project with GRG Kit components and add blocks')
|
|
14
|
-
.version('0.
|
|
14
|
+
.version('0.5.0');
|
|
15
15
|
|
|
16
16
|
// Init command - sets up everything in one shot
|
|
17
17
|
program
|
|
@@ -39,9 +39,9 @@ program
|
|
|
39
39
|
.description('List available blocks and components')
|
|
40
40
|
.action(list);
|
|
41
41
|
|
|
42
|
-
// LLM
|
|
42
|
+
// LLM Setup command
|
|
43
43
|
program
|
|
44
|
-
.command('llm-
|
|
44
|
+
.command('llm-setup')
|
|
45
45
|
.description('Generate LLM-specific prompts and rules for AI assistants (Windsurf, Cursor, etc.)')
|
|
46
46
|
.option('-o, --output <path>', 'Output directory for rules', '.windsurf/rules')
|
|
47
47
|
.action(llmPrompts);
|
package/commands/init.js
CHANGED
|
@@ -117,15 +117,39 @@ async function init(projectName, options) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
// Step 7: Run Spartan-NG UI generator (install all components)
|
|
120
|
+
// The spartan CLI prompts for component selection - we send 'a' to select all, then Enter
|
|
120
121
|
spinner.start('Installing all Spartan-NG UI components...');
|
|
121
122
|
try {
|
|
122
123
|
const { spawn } = require('child_process');
|
|
123
124
|
await new Promise((resolve, reject) => {
|
|
124
|
-
const child = spawn('pnpm', ['ng', 'g', '@spartan-ng/cli:ui'
|
|
125
|
-
stdio: '
|
|
125
|
+
const child = spawn('pnpm', ['ng', 'g', '@spartan-ng/cli:ui'], {
|
|
126
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
126
127
|
shell: true
|
|
127
128
|
});
|
|
129
|
+
|
|
130
|
+
let output = '';
|
|
131
|
+
child.stdout.on('data', (data) => {
|
|
132
|
+
output += data.toString();
|
|
133
|
+
// When we see the prompt, send 'a' to select all, then Enter
|
|
134
|
+
if (output.includes('Choose which primitives')) {
|
|
135
|
+
child.stdin.write('a');
|
|
136
|
+
setTimeout(() => {
|
|
137
|
+
child.stdin.write('\n');
|
|
138
|
+
}, 100);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
child.stderr.on('data', (data) => {
|
|
143
|
+
// Spartan CLI outputs progress to stderr
|
|
144
|
+
const text = data.toString();
|
|
145
|
+
if (text.includes('CREATE') || text.includes('UPDATE')) {
|
|
146
|
+
// Show progress dots
|
|
147
|
+
process.stdout.write('.');
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
128
151
|
child.on('close', (code) => {
|
|
152
|
+
console.log(); // New line after progress dots
|
|
129
153
|
if (code === 0) resolve();
|
|
130
154
|
else reject(new Error(`Process exited with code ${code}`));
|
|
131
155
|
});
|
|
@@ -225,8 +249,9 @@ async function init(projectName, options) {
|
|
|
225
249
|
|
|
226
250
|
console.log(chalk.yellow('\nNext steps:'));
|
|
227
251
|
console.log(chalk.gray(' 1.'), chalk.cyan(`cd ${projectName}`));
|
|
228
|
-
console.log(chalk.gray(' 2. Run'), chalk.cyan('grg
|
|
229
|
-
console.log(chalk.gray(' 3.
|
|
252
|
+
console.log(chalk.gray(' 2. Run'), chalk.cyan('grg llm-setup'), chalk.gray('to generate AI assistant rules'));
|
|
253
|
+
console.log(chalk.gray(' 3. Run'), chalk.cyan('grg list blocks'), chalk.gray('to see available blocks'));
|
|
254
|
+
console.log(chalk.gray(' 4. Add blocks with'), chalk.cyan('grg add block --auth'));
|
|
230
255
|
console.log();
|
|
231
256
|
}
|
|
232
257
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grg-kit-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "CLI tool for pulling GRG Kit resources into your Angular project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"grg": "./bin/grg.js"
|
|
8
8
|
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"generate": "node scripts/generate-resources.js",
|
|
11
|
+
"prepublishOnly": "npm run generate",
|
|
12
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
13
|
+
},
|
|
9
14
|
"keywords": [
|
|
10
15
|
"angular",
|
|
11
16
|
"ui",
|
|
@@ -30,9 +35,5 @@
|
|
|
30
35
|
},
|
|
31
36
|
"engines": {
|
|
32
37
|
"node": ">=16.0.0"
|
|
33
|
-
},
|
|
34
|
-
"scripts": {
|
|
35
|
-
"generate": "node scripts/generate-resources.js",
|
|
36
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
37
38
|
}
|
|
38
|
-
}
|
|
39
|
+
}
|
|
File without changes
|
|
File without changes
|