grg-kit-cli 0.6.5 → 0.6.7
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 +2 -2
- package/commands/init.js +3 -3
- package/commands/llm-setup.js +34 -25
- package/package.json +1 -1
- package/scripts/README.md +5 -5
- package/scripts/generate-resources.js +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ CLI tool for initializing Angular projects with GRG Kit and adding blocks.
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
npm install -g grg-kit-cli
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
@@ -140,7 +140,7 @@ For AI assistants to automatically discover and use GRG Kit resources:
|
|
|
140
140
|
### 1. Install the MCP Server
|
|
141
141
|
|
|
142
142
|
```bash
|
|
143
|
-
|
|
143
|
+
npm install -g grg-kit-mcp-server
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
### 2. Configure Your AI Assistant
|
package/commands/init.js
CHANGED
|
@@ -48,7 +48,7 @@ async function init(options) {
|
|
|
48
48
|
// Step 1: Install Tailwind CSS v4
|
|
49
49
|
spinner.start('Installing Tailwind CSS v4...');
|
|
50
50
|
try {
|
|
51
|
-
await execAsync('
|
|
51
|
+
await execAsync('npm install tailwindcss @tailwindcss/postcss postcss', { stdio: 'pipe' });
|
|
52
52
|
spinner.succeed(chalk.green('✓ Tailwind CSS v4 installed'));
|
|
53
53
|
} catch (error) {
|
|
54
54
|
spinner.warn(chalk.yellow('Tailwind CSS installation skipped (may already be installed)'));
|
|
@@ -71,7 +71,7 @@ async function init(options) {
|
|
|
71
71
|
// Step 4: Install Spartan-NG CLI
|
|
72
72
|
spinner.start('Installing Spartan-NG CLI...');
|
|
73
73
|
try {
|
|
74
|
-
await execAsync('
|
|
74
|
+
await execAsync('npm install -D @spartan-ng/cli', { stdio: 'pipe' });
|
|
75
75
|
spinner.succeed(chalk.green('✓ Spartan-NG CLI installed'));
|
|
76
76
|
} catch (error) {
|
|
77
77
|
spinner.warn(chalk.yellow('Spartan-NG CLI installation skipped'));
|
|
@@ -123,7 +123,7 @@ async function init(options) {
|
|
|
123
123
|
try {
|
|
124
124
|
const { spawn } = require('child_process');
|
|
125
125
|
await new Promise((resolve, reject) => {
|
|
126
|
-
const child = spawn('
|
|
126
|
+
const child = spawn('npx', ['ng', 'g', '@spartan-ng/cli:ui'], {
|
|
127
127
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
128
128
|
shell: true
|
|
129
129
|
});
|
package/commands/llm-setup.js
CHANGED
|
@@ -508,10 +508,10 @@ export class FormComponent {
|
|
|
508
508
|
|
|
509
509
|
## Package Manager
|
|
510
510
|
|
|
511
|
-
|
|
512
|
-
- \`
|
|
513
|
-
- \`
|
|
514
|
-
- \`
|
|
511
|
+
Use npm for package management operations:
|
|
512
|
+
- \`npm install\` for installing dependencies
|
|
513
|
+
- \`npm install <package>\` for adding packages
|
|
514
|
+
- \`npm uninstall\` for removing packages
|
|
515
515
|
|
|
516
516
|
This design system provides a comprehensive foundation for building consistent, accessible, and maintainable Angular applications using modern UI patterns and best practices.
|
|
517
517
|
`;
|
|
@@ -548,8 +548,7 @@ Add the grg-kit MCP server to your AI assistant configuration:
|
|
|
548
548
|
{
|
|
549
549
|
"mcpServers": {
|
|
550
550
|
"grg-kit": {
|
|
551
|
-
"command": "
|
|
552
|
-
"args": ["-y", "@grg-kit/mcp-server"]
|
|
551
|
+
"command": "grg-mcp-server"
|
|
553
552
|
}
|
|
554
553
|
}
|
|
555
554
|
}
|
|
@@ -586,7 +585,7 @@ Search for GRG Kit resources (themes, blocks, components).
|
|
|
586
585
|
\`\`\`typescript
|
|
587
586
|
mcp2_search_ui_resources({
|
|
588
587
|
query: "auth",
|
|
589
|
-
category: "all" // or "themes", "components", "
|
|
588
|
+
category: "all" // or "themes", "components", "blocks"
|
|
590
589
|
})
|
|
591
590
|
\`\`\`
|
|
592
591
|
|
|
@@ -621,22 +620,26 @@ mcp2_get_resource_details({
|
|
|
621
620
|
|
|
622
621
|
### 4. mcp2_install_resource
|
|
623
622
|
|
|
624
|
-
|
|
623
|
+
Get the install command for a block. Returns a command to run via run_command tool.
|
|
625
624
|
|
|
626
625
|
\`\`\`typescript
|
|
627
626
|
mcp2_install_resource({
|
|
628
|
-
resource: "block:auth"
|
|
629
|
-
|
|
627
|
+
resource: "auth", // Just the block name, NOT "block:auth"
|
|
628
|
+
files: ["login"], // Optional: specific files to install
|
|
629
|
+
output: "src/app/pages/auth" // Optional: custom output directory
|
|
630
630
|
})
|
|
631
|
+
// Returns: { command: "grg add block auth login", instruction: "Run this command..." }
|
|
631
632
|
\`\`\`
|
|
632
633
|
|
|
634
|
+
**Important:** The resource parameter should be just the block name (e.g., "auth", "shell", "settings"), NOT prefixed with "block:".
|
|
635
|
+
|
|
633
636
|
### 5. mcp2_list_available_resources
|
|
634
637
|
|
|
635
638
|
List all available resources.
|
|
636
639
|
|
|
637
640
|
\`\`\`typescript
|
|
638
641
|
mcp2_list_available_resources({
|
|
639
|
-
category: "all" // or "themes", "components", "
|
|
642
|
+
category: "all" // or "themes", "components", "blocks"
|
|
640
643
|
})
|
|
641
644
|
\`\`\`
|
|
642
645
|
|
|
@@ -651,10 +654,12 @@ AI Workflow:
|
|
|
651
654
|
1. mcp2_search_ui_resources({ query: "shell sidebar" })
|
|
652
655
|
→ Finds: block:shell
|
|
653
656
|
|
|
654
|
-
2. mcp2_install_resource({ resource: "
|
|
655
|
-
→
|
|
657
|
+
2. mcp2_install_resource({ resource: "shell", files: ["sidebar"] })
|
|
658
|
+
→ Returns command: "grg add block shell sidebar"
|
|
659
|
+
|
|
660
|
+
3. Run the command via run_command tool in the Angular project root
|
|
656
661
|
|
|
657
|
-
|
|
662
|
+
4. Customize using Spartan-NG components (from design-system.md)
|
|
658
663
|
→ Add cards, tables, etc.
|
|
659
664
|
\`\`\`
|
|
660
665
|
|
|
@@ -667,10 +672,12 @@ AI Workflow:
|
|
|
667
672
|
1. mcp2_search_ui_resources({ query: "auth login" })
|
|
668
673
|
→ Finds: block:auth
|
|
669
674
|
|
|
670
|
-
2. mcp2_install_resource({ resource: "
|
|
671
|
-
→
|
|
675
|
+
2. mcp2_install_resource({ resource: "auth", files: ["login"] })
|
|
676
|
+
→ Returns command: "grg add block auth login"
|
|
672
677
|
|
|
673
|
-
3.
|
|
678
|
+
3. Run the command via run_command tool in the Angular project root
|
|
679
|
+
|
|
680
|
+
4. Customize as needed
|
|
674
681
|
\`\`\`
|
|
675
682
|
|
|
676
683
|
### Example 3: User Wants a Theme
|
|
@@ -682,10 +689,10 @@ AI Workflow:
|
|
|
682
689
|
1. mcp2_list_available_resources({ category: "themes" })
|
|
683
690
|
→ Show: claude, amber-minimal, etc.
|
|
684
691
|
|
|
685
|
-
2.
|
|
686
|
-
→
|
|
692
|
+
2. Themes are set via: grg init --theme <name>
|
|
693
|
+
→ Run: grg init --theme claude
|
|
687
694
|
|
|
688
|
-
3. Update src/styles.css import
|
|
695
|
+
3. Update src/styles.css import if needed
|
|
689
696
|
\`\`\`
|
|
690
697
|
|
|
691
698
|
### Example 4: User Wants a Form Component
|
|
@@ -697,8 +704,8 @@ AI Workflow:
|
|
|
697
704
|
1. mcp2_search_ui_resources({ query: "stepper form" })
|
|
698
705
|
→ Finds: component:stepper
|
|
699
706
|
|
|
700
|
-
2.
|
|
701
|
-
→
|
|
707
|
+
2. Components are included automatically with grg init
|
|
708
|
+
→ Just import and use: import { GrgStepperImports } from '@grg-kit/ui/stepper';
|
|
702
709
|
|
|
703
710
|
3. Use with Spartan-NG form components (from design-system.md)
|
|
704
711
|
\`\`\`
|
|
@@ -954,8 +961,10 @@ Use the \`grg-kit\` MCP server for themes, blocks, and GRG Kit components:
|
|
|
954
961
|
|
|
955
962
|
- \`mcp2_search_ui_resources({ query: "auth" })\` - Search resources
|
|
956
963
|
- \`mcp2_suggest_resources({ requirement: "login page" })\` - Get suggestions
|
|
957
|
-
- \`mcp2_install_resource({ resource: "
|
|
958
|
-
- \`mcp2_list_available_resources({ category: "
|
|
964
|
+
- \`mcp2_install_resource({ resource: "auth", files: ["login"] })\` - Get install command (returns command to run)
|
|
965
|
+
- \`mcp2_list_available_resources({ category: "blocks" })\` - List all
|
|
966
|
+
|
|
967
|
+
**Note:** \`mcp2_install_resource\` returns a command string. Use \`run_command\` to execute it in the Angular project root.
|
|
959
968
|
|
|
960
969
|
## Available Resources
|
|
961
970
|
|
|
@@ -977,7 +986,7 @@ ${blocksList}
|
|
|
977
986
|
|
|
978
987
|
## Package Manager
|
|
979
988
|
|
|
980
|
-
|
|
989
|
+
Use npm for package management.
|
|
981
990
|
|
|
982
991
|
## Styling
|
|
983
992
|
|
package/package.json
CHANGED
package/scripts/README.md
CHANGED
|
@@ -15,7 +15,7 @@ GRG Kit uses a **two-stage generation pipeline** to ensure CLI and MCP server al
|
|
|
15
15
|
│
|
|
16
16
|
▼
|
|
17
17
|
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
18
|
-
│ STAGE 1:
|
|
18
|
+
│ STAGE 1: npm generate:sources (in app/) │
|
|
19
19
|
│ │
|
|
20
20
|
│ • Transforms source components → template files │
|
|
21
21
|
│ • Copies meta.json files → templates/ directory │
|
|
@@ -79,7 +79,7 @@ app/src/app/blocks/my-block/meta.json
|
|
|
79
79
|
# 3. Update generate-sources.js CONFIG.blocks.sources array
|
|
80
80
|
|
|
81
81
|
# 4. Run generation
|
|
82
|
-
cd app &&
|
|
82
|
+
cd app && npm generate:sources
|
|
83
83
|
cd ../cli && node scripts/generate-resources.js
|
|
84
84
|
|
|
85
85
|
# 5. Commit and push - CLI/MCP pick up changes automatically
|
|
@@ -124,7 +124,7 @@ Generates template files and copies metadata.
|
|
|
124
124
|
|
|
125
125
|
```bash
|
|
126
126
|
cd app
|
|
127
|
-
|
|
127
|
+
npm generate:sources
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
**What it does:**
|
|
@@ -226,8 +226,8 @@ grg-kit/
|
|
|
226
226
|
|
|
227
227
|
| Task | Command |
|
|
228
228
|
|------|---------|
|
|
229
|
-
| Generate templates + copy meta | `cd app &&
|
|
229
|
+
| Generate templates + copy meta | `cd app && npm generate:sources` |
|
|
230
230
|
| Generate resources + catalog | `cd cli && node scripts/generate-resources.js` |
|
|
231
231
|
| Full regeneration | Run both above |
|
|
232
232
|
| Test CLI | `cd cli && node bin/grg.js list` |
|
|
233
|
-
| Build MCP | `cd mcp-server &&
|
|
233
|
+
| Build MCP | `cd mcp-server && npm build` |
|
|
@@ -302,7 +302,7 @@ module.exports = { RESOURCES, REPO };
|
|
|
302
302
|
const cliPackage = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json'), 'utf-8'));
|
|
303
303
|
|
|
304
304
|
const catalog = {
|
|
305
|
-
_generated: 'AUTO-GENERATED FILE - DO NOT EDIT MANUALLY. Run:
|
|
305
|
+
_generated: 'AUTO-GENERATED FILE - DO NOT EDIT MANUALLY. Run: npm catalog',
|
|
306
306
|
version: '1.0.1',
|
|
307
307
|
lastUpdated: new Date().toISOString().split('T')[0],
|
|
308
308
|
cli: {
|