@cregis-dev/cckit 0.6.6 → 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.
Files changed (54) hide show
  1. package/LICENSE +21 -21
  2. package/bin/cckit.js +3 -3
  3. package/package.json +53 -53
  4. package/registry.json +145 -145
  5. package/src/cli.js +79 -79
  6. package/src/commands/init.js +174 -174
  7. package/src/commands/status.js +125 -125
  8. package/src/commands/update.js +192 -192
  9. package/src/core/config.js +82 -75
  10. package/src/core/orchestrator.js +79 -79
  11. package/src/core/registry.js +60 -60
  12. package/src/steps/add-plugin.js +148 -116
  13. package/src/steps/configure-user.js +181 -181
  14. package/src/steps/enable-plugins.js +97 -97
  15. package/src/steps/install-bmad.js +85 -85
  16. package/src/steps/install-mcp.js +70 -70
  17. package/src/steps/install-rules.js +69 -69
  18. package/src/steps/install-skills.js +56 -56
  19. package/src/utils/compare-versions.js +106 -106
  20. package/src/utils/fs.js +33 -33
  21. package/src/utils/logger.js +16 -16
  22. package/src/utils/manifest.js +101 -101
  23. package/src/utils/prompt.js +41 -41
  24. package/templates/mcp/claude-code/.mcp.json +40 -40
  25. package/templates/rules/README.md +103 -103
  26. package/templates/rules/common/agents.md +49 -49
  27. package/templates/rules/common/coding-style.md +48 -48
  28. package/templates/rules/common/development-workflow.md +37 -37
  29. package/templates/rules/common/git-workflow.md +24 -24
  30. package/templates/rules/common/hooks.md +30 -30
  31. package/templates/rules/common/patterns.md +31 -31
  32. package/templates/rules/common/performance.md +55 -55
  33. package/templates/rules/common/security.md +29 -29
  34. package/templates/rules/common/testing.md +29 -29
  35. package/templates/rules/golang/coding-style.md +32 -32
  36. package/templates/rules/golang/hooks.md +17 -17
  37. package/templates/rules/golang/patterns.md +45 -45
  38. package/templates/rules/golang/security.md +34 -34
  39. package/templates/rules/golang/testing.md +31 -31
  40. package/templates/rules/python/coding-style.md +42 -42
  41. package/templates/rules/python/hooks.md +19 -19
  42. package/templates/rules/python/patterns.md +39 -39
  43. package/templates/rules/python/security.md +30 -30
  44. package/templates/rules/python/testing.md +38 -38
  45. package/templates/rules/swift/coding-style.md +47 -47
  46. package/templates/rules/swift/hooks.md +20 -20
  47. package/templates/rules/swift/patterns.md +66 -66
  48. package/templates/rules/swift/security.md +33 -33
  49. package/templates/rules/swift/testing.md +45 -45
  50. package/templates/rules/typescript/coding-style.md +65 -65
  51. package/templates/rules/typescript/hooks.md +22 -22
  52. package/templates/rules/typescript/patterns.md +52 -52
  53. package/templates/rules/typescript/security.md +28 -28
  54. package/templates/rules/typescript/testing.md +18 -18
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 cregis-dev
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 cregis-dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/bin/cckit.js CHANGED
@@ -1,3 +1,3 @@
1
- #!/usr/bin/env node
2
- import { run } from '../src/cli.js'
3
- run(process.argv)
1
+ #!/usr/bin/env node
2
+ import { run } from '../src/cli.js'
3
+ run(process.argv)
package/package.json CHANGED
@@ -1,53 +1,53 @@
1
- {
2
- "name": "@cregis-dev/cckit",
3
- "version": "0.6.6",
4
- "description": "Enterprise-grade Claude Code configuration toolkit — orchestrates external tools to set up unified rules, skills, MCP and methodology for teams",
5
- "type": "module",
6
- "bin": {
7
- "cckit": "./bin/cckit.js"
8
- },
9
- "publishConfig": {
10
- "access": "public"
11
- },
12
- "files": [
13
- "bin/",
14
- "src/",
15
- "templates/mcp/",
16
- "registry.json",
17
- "templates/rules/"
18
- ],
19
- "engines": {
20
- "node": ">=18.0.0"
21
- },
22
- "scripts": {
23
- "test": "vitest run",
24
- "test:watch": "vitest",
25
- "test:coverage": "vitest run --coverage",
26
- "release": "node scripts/release.js",
27
- "release:dry": "node scripts/release.js --dry-run"
28
- },
29
- "keywords": [
30
- "claude-code",
31
- "enterprise",
32
- "configuration",
33
- "bmad",
34
- "ecc",
35
- "mcp",
36
- "cli",
37
- "rules",
38
- "ai-coding",
39
- "developer-tools",
40
- "team"
41
- ],
42
- "license": "MIT",
43
- "dependencies": {
44
- "chalk": "^5.6.2",
45
- "commander": "^14.0.3",
46
- "fs-extra": "^11.3.3",
47
- "glob": "^13.0.3",
48
- "yaml": "^2.8.2"
49
- },
50
- "devDependencies": {
51
- "vitest": "^4.0.18"
52
- }
53
- }
1
+ {
2
+ "name": "@cregis-dev/cckit",
3
+ "version": "0.6.7",
4
+ "description": "Enterprise-grade Claude Code configuration toolkit — orchestrates external tools to set up unified rules, skills, MCP and methodology for teams",
5
+ "type": "module",
6
+ "bin": {
7
+ "cckit": "./bin/cckit.js"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "files": [
13
+ "bin/",
14
+ "src/",
15
+ "templates/mcp/",
16
+ "registry.json",
17
+ "templates/rules/"
18
+ ],
19
+ "engines": {
20
+ "node": ">=18.0.0"
21
+ },
22
+ "scripts": {
23
+ "test": "vitest run",
24
+ "test:watch": "vitest",
25
+ "test:coverage": "vitest run --coverage",
26
+ "release": "node scripts/release.js",
27
+ "release:dry": "node scripts/release.js --dry-run"
28
+ },
29
+ "keywords": [
30
+ "claude-code",
31
+ "enterprise",
32
+ "configuration",
33
+ "bmad",
34
+ "ecc",
35
+ "mcp",
36
+ "cli",
37
+ "rules",
38
+ "ai-coding",
39
+ "developer-tools",
40
+ "team"
41
+ ],
42
+ "license": "MIT",
43
+ "dependencies": {
44
+ "chalk": "^5.6.2",
45
+ "commander": "^14.0.3",
46
+ "fs-extra": "^11.3.3",
47
+ "glob": "^13.0.3",
48
+ "yaml": "^2.8.2"
49
+ },
50
+ "devDependencies": {
51
+ "vitest": "^4.0.18"
52
+ }
53
+ }
package/registry.json CHANGED
@@ -1,145 +1,145 @@
1
- {
2
- "version": "2.0.0",
3
- "versions": {
4
- "plugins": "1.0.0",
5
- "rules": "1.0.0",
6
- "skills": "1.0.0",
7
- "bmad": "1.0.0",
8
- "mcp": "1.0.0",
9
- "userSettings": "1.0.0"
10
- },
11
- "plugins": {
12
- "everything-claude-code": {
13
- "name": "Everything Claude Code",
14
- "marketplace": "everything-claude-code",
15
- "marketplaceSource": {
16
- "source": "github",
17
- "repo": "affaan-m/everything-claude-code"
18
- },
19
- "scope": "project",
20
- "default": true,
21
- "description": "Rules, agents, commands, skills, and hooks for Claude Code"
22
- },
23
- "superpowers": {
24
- "name": "Superpowers",
25
- "marketplace": "claude-plugins-official",
26
- "scope": "project",
27
- "default": true,
28
- "description": "Structured workflows with brainstorming, debugging, TDD, and code review skills"
29
- },
30
- "claude-code-setup": {
31
- "name": "Claude Code Setup",
32
- "marketplace": "claude-plugins-official",
33
- "scope": "project",
34
- "default": true,
35
- "description": "Analyze codebases and recommend Claude Code automations, audit and improve CLAUDE.md files"
36
- },
37
- "claude-md-management": {
38
- "name": "Claude MD Management",
39
- "marketplace": "claude-plugins-official",
40
- "scope": "project",
41
- "default": true,
42
- "description": "Audit, improve, and update CLAUDE.md documentation files"
43
- },
44
- "code-simplifier": {
45
- "name": "Code Simplifier",
46
- "marketplace": "claude-plugins-official",
47
- "scope": "project",
48
- "default": true,
49
- "description": "Simplify and refine code for clarity, consistency, and maintainability"
50
- },
51
- "commit-commands": {
52
- "name": "Commit Commands",
53
- "marketplace": "claude-plugins-official",
54
- "scope": "project",
55
- "default": true,
56
- "description": "Git commit workflows: commit, push, PR creation, and branch cleanup"
57
- },
58
- "firecrawl": {
59
- "name": "Firecrawl",
60
- "marketplace": "claude-plugins-official",
61
- "scope": "project",
62
- "default": true,
63
- "description": "Web scraping, search, and skill generation using Firecrawl"
64
- },
65
- "typescript-lsp": {
66
- "name": "TypeScript LSP",
67
- "marketplace": "claude-plugins-official",
68
- "scope": "project",
69
- "default": true,
70
- "description": "TypeScript language server protocol integration for enhanced TypeScript development"
71
- },
72
- "pr-review-toolkit": {
73
- "name": "PR Review Toolkit",
74
- "marketplace": "claude-plugins-official",
75
- "scope": "project",
76
- "default": true,
77
- "description": "Comprehensive PR review using specialized agents"
78
- }
79
- },
80
- "rules": {
81
- "template": "templates/rules",
82
- "target": ".claude/rules"
83
- },
84
- "skills": [
85
- {
86
- "id": "pinchtab",
87
- "repo": "https://github.com/pinchtab/pinchtab",
88
- "skill": "pinchtab",
89
- "installCommand": "npx skills add https://github.com/pinchtab/pinchtab --skill pinchtab -y -a claude-code"
90
- },
91
- {
92
- "id": "find-skills",
93
- "repo": "https://github.com/vercel-labs/skills",
94
- "skill": "find-skills",
95
- "installCommand": "npx skills add https://github.com/vercel-labs/skills --skill find-skills -y -a claude-code"
96
- },
97
- {
98
- "id": "skill-vetter",
99
- "repo": "https://github.com/useai-pro/openclaw-skills-security",
100
- "skill": "skill-vetter",
101
- "installCommand": "npx skills add https://github.com/useai-pro/openclaw-skills-security --skill skill-vetter -y -a claude-code"
102
- }
103
- ],
104
- "bmad": {
105
- "command": "npx",
106
- "args": [
107
- "bmad-method",
108
- "install",
109
- "--directory",
110
- ".",
111
- "--modules",
112
- "bmm,tea",
113
- "--communication-language",
114
- "Chinese",
115
- "--document-output-language",
116
- "Chinese",
117
- "--tools",
118
- "claude-code",
119
- "--yes",
120
- "--output-folder",
121
- "_bmad-output"
122
- ]
123
- },
124
- "mcp": {
125
- "template": "templates/mcp/claude-code/.mcp.json",
126
- "target": ".mcp.json"
127
- },
128
- "userSettings": {
129
- "apiUrl": "https://gateway.cregis.ai",
130
- "models": {
131
- "minimax": "MiniMax-M2.5",
132
- "kimi": "Kimi-K2.5",
133
- "gemini": "gemini-3.1-pro-preview",
134
- "gpt": "gpt-5.3-codex"
135
- },
136
- "defaultModel": "minimax",
137
- "modelEnvKeys": [
138
- "ANTHROPIC_MODEL",
139
- "ANTHROPIC_SMALL_FAST_MODEL",
140
- "ANTHROPIC_DEFAULT_SONNET_MODEL",
141
- "ANTHROPIC_DEFAULT_OPUS_MODEL",
142
- "ANTHROPIC_DEFAULT_HAIKU_MODEL"
143
- ]
144
- }
145
- }
1
+ {
2
+ "version": "2.0.0",
3
+ "versions": {
4
+ "plugins": "1.0.0",
5
+ "rules": "1.0.0",
6
+ "skills": "1.0.0",
7
+ "bmad": "1.0.0",
8
+ "mcp": "1.0.0",
9
+ "userSettings": "1.0.0"
10
+ },
11
+ "plugins": {
12
+ "everything-claude-code": {
13
+ "name": "Everything Claude Code",
14
+ "marketplace": "everything-claude-code",
15
+ "marketplaceSource": {
16
+ "source": "github",
17
+ "repo": "affaan-m/everything-claude-code"
18
+ },
19
+ "scope": "project",
20
+ "default": true,
21
+ "description": "Rules, agents, commands, skills, and hooks for Claude Code"
22
+ },
23
+ "superpowers": {
24
+ "name": "Superpowers",
25
+ "marketplace": "claude-plugins-official",
26
+ "scope": "project",
27
+ "default": true,
28
+ "description": "Structured workflows with brainstorming, debugging, TDD, and code review skills"
29
+ },
30
+ "claude-code-setup": {
31
+ "name": "Claude Code Setup",
32
+ "marketplace": "claude-plugins-official",
33
+ "scope": "project",
34
+ "default": true,
35
+ "description": "Analyze codebases and recommend Claude Code automations, audit and improve CLAUDE.md files"
36
+ },
37
+ "claude-md-management": {
38
+ "name": "Claude MD Management",
39
+ "marketplace": "claude-plugins-official",
40
+ "scope": "project",
41
+ "default": true,
42
+ "description": "Audit, improve, and update CLAUDE.md documentation files"
43
+ },
44
+ "code-simplifier": {
45
+ "name": "Code Simplifier",
46
+ "marketplace": "claude-plugins-official",
47
+ "scope": "project",
48
+ "default": true,
49
+ "description": "Simplify and refine code for clarity, consistency, and maintainability"
50
+ },
51
+ "commit-commands": {
52
+ "name": "Commit Commands",
53
+ "marketplace": "claude-plugins-official",
54
+ "scope": "project",
55
+ "default": true,
56
+ "description": "Git commit workflows: commit, push, PR creation, and branch cleanup"
57
+ },
58
+ "firecrawl": {
59
+ "name": "Firecrawl",
60
+ "marketplace": "claude-plugins-official",
61
+ "scope": "project",
62
+ "default": true,
63
+ "description": "Web scraping, search, and skill generation using Firecrawl"
64
+ },
65
+ "typescript-lsp": {
66
+ "name": "TypeScript LSP",
67
+ "marketplace": "claude-plugins-official",
68
+ "scope": "project",
69
+ "default": true,
70
+ "description": "TypeScript language server protocol integration for enhanced TypeScript development"
71
+ },
72
+ "pr-review-toolkit": {
73
+ "name": "PR Review Toolkit",
74
+ "marketplace": "claude-plugins-official",
75
+ "scope": "project",
76
+ "default": true,
77
+ "description": "Comprehensive PR review using specialized agents"
78
+ }
79
+ },
80
+ "rules": {
81
+ "template": "templates/rules",
82
+ "target": ".claude/rules"
83
+ },
84
+ "skills": [
85
+ {
86
+ "id": "pinchtab",
87
+ "repo": "https://github.com/pinchtab/pinchtab",
88
+ "skill": "pinchtab",
89
+ "installCommand": "npx skills add https://github.com/pinchtab/pinchtab --skill pinchtab -y -a claude-code"
90
+ },
91
+ {
92
+ "id": "find-skills",
93
+ "repo": "https://github.com/vercel-labs/skills",
94
+ "skill": "find-skills",
95
+ "installCommand": "npx skills add https://github.com/vercel-labs/skills --skill find-skills -y -a claude-code"
96
+ },
97
+ {
98
+ "id": "skill-vetter",
99
+ "repo": "https://github.com/useai-pro/openclaw-skills-security",
100
+ "skill": "skill-vetter",
101
+ "installCommand": "npx skills add https://github.com/useai-pro/openclaw-skills-security --skill skill-vetter -y -a claude-code"
102
+ }
103
+ ],
104
+ "bmad": {
105
+ "command": "npx",
106
+ "args": [
107
+ "bmad-method",
108
+ "install",
109
+ "--directory",
110
+ ".",
111
+ "--modules",
112
+ "bmm,tea",
113
+ "--communication-language",
114
+ "Chinese",
115
+ "--document-output-language",
116
+ "Chinese",
117
+ "--tools",
118
+ "claude-code",
119
+ "--yes",
120
+ "--output-folder",
121
+ "_bmad-output"
122
+ ]
123
+ },
124
+ "mcp": {
125
+ "template": "templates/mcp/claude-code/.mcp.json",
126
+ "target": ".mcp.json"
127
+ },
128
+ "userSettings": {
129
+ "apiUrl": "https://gateway.cregis.ai",
130
+ "models": {
131
+ "minimax": "MiniMax-M2.5",
132
+ "kimi": "Kimi-K2.5",
133
+ "gemini": "gemini-3.1-pro-preview",
134
+ "gpt": "gpt-5.3-codex"
135
+ },
136
+ "defaultModel": "minimax",
137
+ "modelEnvKeys": [
138
+ "ANTHROPIC_MODEL",
139
+ "ANTHROPIC_SMALL_FAST_MODEL",
140
+ "ANTHROPIC_DEFAULT_SONNET_MODEL",
141
+ "ANTHROPIC_DEFAULT_OPUS_MODEL",
142
+ "ANTHROPIC_DEFAULT_HAIKU_MODEL"
143
+ ]
144
+ }
145
+ }
package/src/cli.js CHANGED
@@ -1,79 +1,79 @@
1
- import { Command } from 'commander'
2
- import { runInit } from './commands/init.js'
3
- import { VERSION } from './core/config.js'
4
-
5
- export function run(argv) {
6
- const program = new Command()
7
-
8
- program
9
- .name('cckit')
10
- .description('Enterprise-grade Claude Code configuration toolkit')
11
- .version(VERSION)
12
-
13
- program
14
- .command('install')
15
- .description('Install enterprise Claude Code configuration')
16
- .option('-y, --yes', 'Accept all defaults', false)
17
- .option('-d, --dir <path>', 'Target directory', process.cwd())
18
- .option('--user-name <name>', 'Your name for agents')
19
- .option('-l, --lang <codes>', 'Languages: ts,py,go')
20
- .option('--no-bmad', 'Skip BMAD installation')
21
- .option('--no-ecc', 'Skip ECC rules')
22
- .option('--no-mcp', 'Skip MCP config')
23
- .option('--no-skills', 'Skip skill installation')
24
- .option('--plugins <ids>', 'Plugin ids, "default", or "none"')
25
- .option('--no-plugins', 'Skip plugin installation')
26
- .option('--communication-language <lang>', 'Communication language')
27
- .option('--doc-language <lang>', 'Document output language')
28
- .option('--api-url <url>', 'API base URL (default: gateway.cregis.ai)')
29
- .option('--api-key <key>', 'API key for the gateway')
30
- .option('--force-api-key', 'Force overwrite existing API key', false)
31
- .option('--model <name>', 'Model: minimax, kimi, gemini, gpt (default: minimax)')
32
- .option('--debug', 'Debug output', false)
33
- .action(async (opts) => {
34
- try {
35
- await runInit(opts)
36
- } catch (err) {
37
- console.error(`\n Error: ${err.message}\n`)
38
- process.exit(1)
39
- }
40
- })
41
-
42
- program
43
- .command('status')
44
- .description('Show installation status')
45
- .option('-d, --dir <path>', 'Target directory', process.cwd())
46
- .action(async (opts) => {
47
- try {
48
- const { runStatus } = await import('./commands/status.js')
49
- await runStatus(opts)
50
- } catch (err) {
51
- console.error(`\n Error: ${err.message}\n`)
52
- process.exit(1)
53
- }
54
- })
55
-
56
- program
57
- .command('update')
58
- .description('Re-run installation steps to update components')
59
- .option('-d, --dir <path>', 'Target directory', process.cwd())
60
- .option('--dry-run', 'Preview changes without applying', false)
61
- .option('--no-apply', 'Check only, do not apply updates')
62
- .option('--force', 'Force overwrite user-modified files', false)
63
- .option('--api-url <url>', 'API base URL override')
64
- .option('--api-key <key>', 'API key for the gateway')
65
- .option('--force-api-key', 'Force overwrite existing API key', false)
66
- .option('--model <name>', 'Model: minimax, kimi, gemini, gpt')
67
- .option('--debug', 'Debug output', false)
68
- .action(async (opts) => {
69
- try {
70
- const { runUpdate } = await import('./commands/update.js')
71
- await runUpdate({ ...opts, apply: opts.apply !== false })
72
- } catch (err) {
73
- console.error(`\n Error: ${err.message}\n`)
74
- process.exit(1)
75
- }
76
- })
77
-
78
- program.parse(argv)
79
- }
1
+ import { Command } from 'commander'
2
+ import { runInit } from './commands/init.js'
3
+ import { VERSION } from './core/config.js'
4
+
5
+ export function run(argv) {
6
+ const program = new Command()
7
+
8
+ program
9
+ .name('cckit')
10
+ .description('Enterprise-grade Claude Code configuration toolkit')
11
+ .version(VERSION)
12
+
13
+ program
14
+ .command('install')
15
+ .description('Install enterprise Claude Code configuration')
16
+ .option('-y, --yes', 'Accept all defaults', false)
17
+ .option('-d, --dir <path>', 'Target directory', process.cwd())
18
+ .option('--user-name <name>', 'Your name for agents')
19
+ .option('-l, --lang <codes>', 'Languages: ts,py,go')
20
+ .option('--no-bmad', 'Skip BMAD installation')
21
+ .option('--no-ecc', 'Skip ECC rules')
22
+ .option('--no-mcp', 'Skip MCP config')
23
+ .option('--no-skills', 'Skip skill installation')
24
+ .option('--plugins <ids>', 'Plugin ids, "default", or "none"')
25
+ .option('--no-plugins', 'Skip plugin installation')
26
+ .option('--communication-language <lang>', 'Communication language')
27
+ .option('--doc-language <lang>', 'Document output language')
28
+ .option('--api-url <url>', 'API base URL (default: gateway.cregis.ai)')
29
+ .option('--api-key <key>', 'API key for the gateway')
30
+ .option('--force-api-key', 'Force overwrite existing API key', false)
31
+ .option('--model <name>', 'Model: minimax, kimi, gemini, gpt (default: minimax)')
32
+ .option('--debug', 'Debug output', false)
33
+ .action(async (opts) => {
34
+ try {
35
+ await runInit(opts)
36
+ } catch (err) {
37
+ console.error(`\n Error: ${err.message}\n`)
38
+ process.exit(1)
39
+ }
40
+ })
41
+
42
+ program
43
+ .command('status')
44
+ .description('Show installation status')
45
+ .option('-d, --dir <path>', 'Target directory', process.cwd())
46
+ .action(async (opts) => {
47
+ try {
48
+ const { runStatus } = await import('./commands/status.js')
49
+ await runStatus(opts)
50
+ } catch (err) {
51
+ console.error(`\n Error: ${err.message}\n`)
52
+ process.exit(1)
53
+ }
54
+ })
55
+
56
+ program
57
+ .command('update')
58
+ .description('Re-run installation steps to update components')
59
+ .option('-d, --dir <path>', 'Target directory', process.cwd())
60
+ .option('--dry-run', 'Preview changes without applying', false)
61
+ .option('--no-apply', 'Check only, do not apply updates')
62
+ .option('--force', 'Force overwrite user-modified files', false)
63
+ .option('--api-url <url>', 'API base URL override')
64
+ .option('--api-key <key>', 'API key for the gateway')
65
+ .option('--force-api-key', 'Force overwrite existing API key', false)
66
+ .option('--model <name>', 'Model: minimax, kimi, gemini, gpt')
67
+ .option('--debug', 'Debug output', false)
68
+ .action(async (opts) => {
69
+ try {
70
+ const { runUpdate } = await import('./commands/update.js')
71
+ await runUpdate({ ...opts, apply: opts.apply !== false })
72
+ } catch (err) {
73
+ console.error(`\n Error: ${err.message}\n`)
74
+ process.exit(1)
75
+ }
76
+ })
77
+
78
+ program.parse(argv)
79
+ }