@codemieai/code 0.0.33 → 0.0.34
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 +73 -7
- package/bin/codemie-opencode.js +11 -0
- package/dist/agents/codemie-code/agent.d.ts +17 -1
- package/dist/agents/codemie-code/agent.d.ts.map +1 -1
- package/dist/agents/codemie-code/agent.js +62 -3
- package/dist/agents/codemie-code/agent.js.map +1 -1
- package/dist/agents/codemie-code/index.d.ts +1 -0
- package/dist/agents/codemie-code/index.d.ts.map +1 -1
- package/dist/agents/codemie-code/index.js +28 -2
- package/dist/agents/codemie-code/index.js.map +1 -1
- package/dist/agents/codemie-code/prompts.d.ts +12 -3
- package/dist/agents/codemie-code/prompts.d.ts.map +1 -1
- package/dist/agents/codemie-code/prompts.js +25 -5
- package/dist/agents/codemie-code/prompts.js.map +1 -1
- package/dist/agents/codemie-code/types.d.ts +3 -0
- package/dist/agents/codemie-code/types.d.ts.map +1 -1
- package/dist/agents/codemie-code/types.js.map +1 -1
- package/dist/agents/core/AgentCLI.d.ts.map +1 -1
- package/dist/agents/core/AgentCLI.js +3 -1
- package/dist/agents/core/AgentCLI.js.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +33 -0
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/core/session/BaseSessionAdapter.d.ts +25 -0
- package/dist/agents/core/session/BaseSessionAdapter.d.ts.map +1 -1
- package/dist/agents/core/session/discovery-types.d.ts +53 -0
- package/dist/agents/core/session/discovery-types.d.ts.map +1 -0
- package/dist/agents/core/session/discovery-types.js +8 -0
- package/dist/agents/core/session/discovery-types.js.map +1 -0
- package/dist/agents/core/types.d.ts +45 -0
- package/dist/agents/core/types.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts +44 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +214 -0
- package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/plugin/README.md +40 -2
- package/dist/agents/plugins/claude/plugin/claude-templates/README.md +5 -5
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/CLAUDE.md.template +177 -436
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/code-review-agent-template.md.template +49 -82
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/refactor-cleaner-agent.md.template +337 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/solution-architect-agent.md.template +129 -419
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/unit-tester-agent.md.template +146 -693
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/api/api-patterns.md.template +110 -138
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/architecture.md.template +197 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/data/database-patterns.md.template +171 -91
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/development/development-practices.md.template +219 -131
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/security/security-practices.md.template +223 -98
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/standards/code-quality.md.template +131 -95
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/testing/testing-patterns.md.template +247 -75
- package/dist/agents/plugins/claude/plugin/commands/README.md +133 -0
- package/dist/agents/plugins/claude/plugin/commands/codemie-init.md +336 -544
- package/dist/agents/plugins/claude/plugin/commands/codemie-subagents.md +232 -503
- package/dist/agents/plugins/claude/plugin/commands/memory-add.md +311 -30
- package/dist/agents/plugins/claude/plugin/commands/memory-refresh.md +218 -39
- package/dist/agents/plugins/gemini/gemini.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/gemini.plugin.js +0 -3
- package/dist/agents/plugins/gemini/gemini.plugin.js.map +1 -1
- package/dist/agents/plugins/opencode/index.d.ts +8 -0
- package/dist/agents/plugins/opencode/index.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/index.js +12 -0
- package/dist/agents/plugins/opencode/index.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode-message-types.d.ts +207 -0
- package/dist/agents/plugins/opencode/opencode-message-types.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode-message-types.js +59 -0
- package/dist/agents/plugins/opencode/opencode-message-types.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.d.ts +65 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.js +184 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.paths.d.ts +62 -0
- package/dist/agents/plugins/opencode/opencode.paths.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.paths.js +148 -0
- package/dist/agents/plugins/opencode/opencode.paths.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.plugin.d.ts +35 -0
- package/dist/agents/plugins/opencode/opencode.plugin.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.plugin.js +338 -0
- package/dist/agents/plugins/opencode/opencode.plugin.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.session.d.ts +77 -0
- package/dist/agents/plugins/opencode/opencode.session.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.session.js +424 -0
- package/dist/agents/plugins/opencode/opencode.session.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts +25 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.js +96 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.js.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts +30 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js +116 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts +102 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js +584 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js.map +1 -0
- package/dist/agents/registry.d.ts.map +1 -1
- package/dist/agents/registry.js +2 -0
- package/dist/agents/registry.js.map +1 -1
- package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts +5 -0
- package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts.map +1 -1
- package/dist/cli/commands/doctor/checks/AgentsCheck.js +29 -0
- package/dist/cli/commands/doctor/checks/AgentsCheck.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +86 -7
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/opencode-metrics.d.ts +13 -0
- package/dist/cli/commands/opencode-metrics.d.ts.map +1 -0
- package/dist/cli/commands/opencode-metrics.js +200 -0
- package/dist/cli/commands/opencode-metrics.js.map +1 -0
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +113 -0
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/skill.d.ts +6 -0
- package/dist/cli/commands/skill.d.ts.map +1 -0
- package/dist/cli/commands/skill.js +196 -0
- package/dist/cli/commands/skill.js.map +1 -0
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +34 -6
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/index.js +4 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/migrations/003-remove-hooks-node.migration.d.ts +22 -0
- package/dist/migrations/003-remove-hooks-node.migration.d.ts.map +1 -0
- package/dist/migrations/003-remove-hooks-node.migration.js +103 -0
- package/dist/migrations/003-remove-hooks-node.migration.js.map +1 -0
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +1 -1
- package/dist/migrations/index.js.map +1 -1
- package/dist/providers/plugins/sso/sso.http-client.js +2 -2
- package/dist/providers/plugins/sso/sso.http-client.js.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.js +14 -10
- package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
- package/dist/skills/core/SkillDiscovery.d.ts +83 -0
- package/dist/skills/core/SkillDiscovery.d.ts.map +1 -0
- package/dist/skills/core/SkillDiscovery.js +237 -0
- package/dist/skills/core/SkillDiscovery.js.map +1 -0
- package/dist/skills/core/SkillManager.d.ts +86 -0
- package/dist/skills/core/SkillManager.d.ts.map +1 -0
- package/dist/skills/core/SkillManager.js +155 -0
- package/dist/skills/core/SkillManager.js.map +1 -0
- package/dist/skills/core/types.d.ts +120 -0
- package/dist/skills/core/types.d.ts.map +1 -0
- package/dist/skills/core/types.js +20 -0
- package/dist/skills/core/types.js.map +1 -0
- package/dist/skills/index.d.ts +12 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +12 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/utils/content-loader.d.ts +25 -0
- package/dist/skills/utils/content-loader.d.ts.map +1 -0
- package/dist/skills/utils/content-loader.js +161 -0
- package/dist/skills/utils/content-loader.js.map +1 -0
- package/dist/skills/utils/frontmatter.d.ts +60 -0
- package/dist/skills/utils/frontmatter.d.ts.map +1 -0
- package/dist/skills/utils/frontmatter.js +114 -0
- package/dist/skills/utils/frontmatter.js.map +1 -0
- package/dist/skills/utils/pattern-matcher.d.ts +60 -0
- package/dist/skills/utils/pattern-matcher.d.ts.map +1 -0
- package/dist/skills/utils/pattern-matcher.js +97 -0
- package/dist/skills/utils/pattern-matcher.js.map +1 -0
- package/dist/utils/installation-detector.d.ts +22 -0
- package/dist/utils/installation-detector.d.ts.map +1 -0
- package/dist/utils/installation-detector.js +49 -0
- package/dist/utils/installation-detector.js.map +1 -0
- package/dist/utils/native-installer.d.ts +49 -0
- package/dist/utils/native-installer.d.ts.map +1 -0
- package/dist/utils/native-installer.js +194 -0
- package/dist/utils/native-installer.js.map +1 -0
- package/dist/utils/version-utils.d.ts +50 -0
- package/dist/utils/version-utils.d.ts.map +1 -0
- package/dist/utils/version-utils.js +92 -0
- package/dist/utils/version-utils.js.map +1 -0
- package/package.json +5 -2
- package/scripts/copy-mr-skill-to-global.ts +252 -0
- package/scripts/demo-hooks.sh +125 -0
- package/scripts/test-hooks.sh +196 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/INDEX.md +0 -205
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/TEMPLATE_SIZES.md +0 -74
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/layered-architecture.md.template +0 -143
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/project-structure.md.template +0 -127
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version comparison utilities for semantic versioning
|
|
3
|
+
* Used for Claude Code version management
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Semantic version components
|
|
7
|
+
*/
|
|
8
|
+
export interface SemanticVersion {
|
|
9
|
+
major: number;
|
|
10
|
+
minor: number;
|
|
11
|
+
patch: number;
|
|
12
|
+
raw: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Parse semantic version string into comparable components
|
|
16
|
+
*
|
|
17
|
+
* @param version - Version string (e.g., '2.0.30')
|
|
18
|
+
* @returns Version components { major, minor, patch, raw }
|
|
19
|
+
* @throws {Error} If version string is invalid
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* parseSemanticVersion('2.0.30') // Returns { major: 2, minor: 0, patch: 30, raw: '2.0.30' }
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseSemanticVersion(version: string): SemanticVersion;
|
|
25
|
+
/**
|
|
26
|
+
* Check if version string is valid semantic version
|
|
27
|
+
*
|
|
28
|
+
* @param version - Version string to validate
|
|
29
|
+
* @returns true if valid semantic version
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* isValidSemanticVersion('2.0.30') // true
|
|
33
|
+
* isValidSemanticVersion('v2.0.30') // true
|
|
34
|
+
* isValidSemanticVersion('invalid') // false
|
|
35
|
+
*/
|
|
36
|
+
export declare function isValidSemanticVersion(version: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Compare two semantic versions
|
|
39
|
+
*
|
|
40
|
+
* @param version1 - First version string (e.g., '2.0.30')
|
|
41
|
+
* @param version2 - Second version string (e.g., '2.0.45')
|
|
42
|
+
* @returns -1 if v1 < v2, 0 if equal, 1 if v1 > v2
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* compareVersions('2.0.30', '2.0.45') // Returns -1
|
|
46
|
+
* compareVersions('2.0.45', '2.0.30') // Returns 1
|
|
47
|
+
* compareVersions('2.0.30', '2.0.30') // Returns 0
|
|
48
|
+
*/
|
|
49
|
+
export declare function compareVersions(version1: string, version2: string): number;
|
|
50
|
+
//# sourceMappingURL=version-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-utils.d.ts","sourceRoot":"","sources":["../../src/utils/version-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAmBrE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAO/D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoC1E"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version comparison utilities for semantic versioning
|
|
3
|
+
* Used for Claude Code version management
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Parse semantic version string into comparable components
|
|
7
|
+
*
|
|
8
|
+
* @param version - Version string (e.g., '2.0.30')
|
|
9
|
+
* @returns Version components { major, minor, patch, raw }
|
|
10
|
+
* @throws {Error} If version string is invalid
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* parseSemanticVersion('2.0.30') // Returns { major: 2, minor: 0, patch: 30, raw: '2.0.30' }
|
|
14
|
+
*/
|
|
15
|
+
export function parseSemanticVersion(version) {
|
|
16
|
+
// Remove 'v' prefix if present
|
|
17
|
+
const cleanVersion = version.trim().replace(/^v/, '');
|
|
18
|
+
// Match semantic version pattern: major.minor.patch
|
|
19
|
+
const match = cleanVersion.match(/^(\d+)\.(\d+)\.(\d+)$/);
|
|
20
|
+
if (!match) {
|
|
21
|
+
throw new Error(`Invalid semantic version format: "${version}". Expected format: major.minor.patch (e.g., "2.0.30")`);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
major: parseInt(match[1], 10),
|
|
25
|
+
minor: parseInt(match[2], 10),
|
|
26
|
+
patch: parseInt(match[3], 10),
|
|
27
|
+
raw: version,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Check if version string is valid semantic version
|
|
32
|
+
*
|
|
33
|
+
* @param version - Version string to validate
|
|
34
|
+
* @returns true if valid semantic version
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* isValidSemanticVersion('2.0.30') // true
|
|
38
|
+
* isValidSemanticVersion('v2.0.30') // true
|
|
39
|
+
* isValidSemanticVersion('invalid') // false
|
|
40
|
+
*/
|
|
41
|
+
export function isValidSemanticVersion(version) {
|
|
42
|
+
try {
|
|
43
|
+
parseSemanticVersion(version);
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Compare two semantic versions
|
|
52
|
+
*
|
|
53
|
+
* @param version1 - First version string (e.g., '2.0.30')
|
|
54
|
+
* @param version2 - Second version string (e.g., '2.0.45')
|
|
55
|
+
* @returns -1 if v1 < v2, 0 if equal, 1 if v1 > v2
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* compareVersions('2.0.30', '2.0.45') // Returns -1
|
|
59
|
+
* compareVersions('2.0.45', '2.0.30') // Returns 1
|
|
60
|
+
* compareVersions('2.0.30', '2.0.30') // Returns 0
|
|
61
|
+
*/
|
|
62
|
+
export function compareVersions(version1, version2) {
|
|
63
|
+
// Handle special channel names (treat as highest version)
|
|
64
|
+
const isSpecialChannel = (v) => ['latest', 'stable'].includes(v.toLowerCase());
|
|
65
|
+
if (isSpecialChannel(version1) && isSpecialChannel(version2)) {
|
|
66
|
+
return 0; // Both special channels, consider equal
|
|
67
|
+
}
|
|
68
|
+
if (isSpecialChannel(version1)) {
|
|
69
|
+
return 1; // v1 is latest/stable, higher than any specific version
|
|
70
|
+
}
|
|
71
|
+
if (isSpecialChannel(version2)) {
|
|
72
|
+
return -1; // v2 is latest/stable, higher than v1
|
|
73
|
+
}
|
|
74
|
+
// Parse both versions
|
|
75
|
+
const v1 = parseSemanticVersion(version1);
|
|
76
|
+
const v2 = parseSemanticVersion(version2);
|
|
77
|
+
// Compare major version
|
|
78
|
+
if (v1.major !== v2.major) {
|
|
79
|
+
return v1.major < v2.major ? -1 : 1;
|
|
80
|
+
}
|
|
81
|
+
// Compare minor version
|
|
82
|
+
if (v1.minor !== v2.minor) {
|
|
83
|
+
return v1.minor < v2.minor ? -1 : 1;
|
|
84
|
+
}
|
|
85
|
+
// Compare patch version
|
|
86
|
+
if (v1.patch !== v2.patch) {
|
|
87
|
+
return v1.patch < v2.patch ? -1 : 1;
|
|
88
|
+
}
|
|
89
|
+
// Versions are equal
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=version-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-utils.js","sourceRoot":"","sources":["../../src/utils/version-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IACnD,+BAA+B;IAC/B,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAEtD,oDAAoD;IACpD,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAE1D,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACd,qCAAqC,OAAO,wDAAwD,CACpG,CAAC;IACH,CAAC;IAED,OAAO;QACN,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7B,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7B,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7B,GAAG,EAAE,OAAO;KACZ,CAAC;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAe;IACrD,IAAI,CAAC;QACJ,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,QAAgB;IACjE,0DAA0D;IAC1D,MAAM,gBAAgB,GAAG,CAAC,CAAS,EAAW,EAAE,CAC/C,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAEhD,IAAI,gBAAgB,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9D,OAAO,CAAC,CAAC,CAAC,wCAAwC;IACnD,CAAC;IACD,IAAI,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChC,OAAO,CAAC,CAAC,CAAC,wDAAwD;IACnE,CAAC;IACD,IAAI,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChC,OAAO,CAAC,CAAC,CAAC,CAAC,sCAAsC;IAClD,CAAC;IAED,sBAAsB;IACtB,MAAM,EAAE,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,EAAE,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAE1C,wBAAwB;IACxB,IAAI,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,wBAAwB;IACxB,IAAI,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,wBAAwB;IACxB,IAAI,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,qBAAqB;IACrB,OAAO,CAAC,CAAC;AACV,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemieai/code",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
4
4
|
"description": "Unified AI coding assistant CLI - Manage Claude Code, Gemini & custom agents. Multi-provider support (OpenAI, Azure, LiteLLM, SSO). Built-in LangGraph agent with file operations & git integration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"codemie": "./bin/codemie.js",
|
|
10
10
|
"codemie-code": "./bin/agent-executor.js",
|
|
11
11
|
"codemie-claude": "./bin/codemie-claude.js",
|
|
12
|
-
"codemie-gemini": "./bin/codemie-gemini.js"
|
|
12
|
+
"codemie-gemini": "./bin/codemie-gemini.js",
|
|
13
|
+
"codemie-opencode": "./bin/codemie-opencode.js"
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
15
16
|
"dist",
|
|
@@ -114,6 +115,7 @@
|
|
|
114
115
|
"cors": "^2.8.5",
|
|
115
116
|
"dotenv": "^16.3.1",
|
|
116
117
|
"express": "^5.1.0",
|
|
118
|
+
"fast-glob": "^3.3.2",
|
|
117
119
|
"http-proxy-agent": "^7.0.2",
|
|
118
120
|
"https-proxy-agent": "^7.0.5",
|
|
119
121
|
"inquirer": "^9.2.12",
|
|
@@ -122,6 +124,7 @@
|
|
|
122
124
|
"open": "^8.4.2",
|
|
123
125
|
"ora": "^7.0.1",
|
|
124
126
|
"strip-ansi": "^7.1.2",
|
|
127
|
+
"yaml": "^2.3.4",
|
|
125
128
|
"zod": "^4.1.12"
|
|
126
129
|
},
|
|
127
130
|
"devDependencies": {
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Copy /mr skill from project scope to global scope
|
|
5
|
+
*
|
|
6
|
+
* This script copies the project-level /mr skill to ~/.claude/skills/mr/
|
|
7
|
+
* making it available globally across all projects.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* npm run build && node dist/scripts/copy-mr-skill-to-global.js
|
|
11
|
+
* OR
|
|
12
|
+
* npx tsx scripts/copy-mr-skill-to-global.ts
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import * as fs from 'fs/promises';
|
|
16
|
+
import * as path from 'path';
|
|
17
|
+
import { parseFrontmatter } from '../src/skills/utils/frontmatter.js';
|
|
18
|
+
import { SkillMetadataSchema } from '../src/skills/core/types.js';
|
|
19
|
+
import { resolveHomeDir } from '../src/utils/paths.js';
|
|
20
|
+
import { SkillManager } from '../src/skills/index.js';
|
|
21
|
+
import * as readline from 'readline';
|
|
22
|
+
|
|
23
|
+
interface CopyResult {
|
|
24
|
+
success: boolean;
|
|
25
|
+
message: string;
|
|
26
|
+
copiedFiles?: string[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Validate source skill exists and has valid frontmatter
|
|
31
|
+
*/
|
|
32
|
+
async function validateSourceSkill(sourceDir: string): Promise<void> {
|
|
33
|
+
const skillPath = path.join(sourceDir, 'SKILL.md');
|
|
34
|
+
|
|
35
|
+
// Check file exists
|
|
36
|
+
try {
|
|
37
|
+
await fs.access(skillPath, fs.constants.R_OK);
|
|
38
|
+
} catch {
|
|
39
|
+
throw new Error(`Source skill not found: ${skillPath}`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Validate frontmatter
|
|
43
|
+
const content = await fs.readFile(skillPath, 'utf-8');
|
|
44
|
+
const { metadata } = parseFrontmatter(content, skillPath);
|
|
45
|
+
const validated = SkillMetadataSchema.parse(metadata);
|
|
46
|
+
|
|
47
|
+
console.log(`✓ Source skill validated: ${validated.name}`);
|
|
48
|
+
console.log(` Description: ${validated.description}`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Check if target already exists and prompt user for overwrite
|
|
53
|
+
*/
|
|
54
|
+
async function checkTargetConflict(targetDir: string): Promise<void> {
|
|
55
|
+
const targetSkillPath = path.join(targetDir, 'SKILL.md');
|
|
56
|
+
|
|
57
|
+
try {
|
|
58
|
+
await fs.access(targetSkillPath, fs.constants.F_OK);
|
|
59
|
+
|
|
60
|
+
// File exists - prompt user
|
|
61
|
+
const rl = readline.createInterface({
|
|
62
|
+
input: process.stdin,
|
|
63
|
+
output: process.stdout
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const answer = await new Promise<string>((resolve) => {
|
|
67
|
+
rl.question(
|
|
68
|
+
`\n⚠️ Global /mr skill already exists. Overwrite? (y/N): `,
|
|
69
|
+
resolve
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
rl.close();
|
|
74
|
+
|
|
75
|
+
if (answer.toLowerCase() !== 'y') {
|
|
76
|
+
console.log('❌ Operation cancelled by user');
|
|
77
|
+
process.exit(0);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Create backup before overwriting
|
|
81
|
+
const backupDir = `${targetDir}.backup-${Date.now()}`;
|
|
82
|
+
await fs.rename(targetDir, backupDir);
|
|
83
|
+
console.log(`✓ Backup created: ${backupDir}`);
|
|
84
|
+
} catch {
|
|
85
|
+
// File doesn't exist - proceed
|
|
86
|
+
console.log('✓ No conflict detected');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Create necessary directories for the skill
|
|
92
|
+
*/
|
|
93
|
+
async function prepareDirectories(targetDir: string): Promise<void> {
|
|
94
|
+
// Create main directory
|
|
95
|
+
await fs.mkdir(targetDir, { recursive: true });
|
|
96
|
+
|
|
97
|
+
// Create references subdirectory
|
|
98
|
+
const refsDir = path.join(targetDir, 'references');
|
|
99
|
+
await fs.mkdir(refsDir, { recursive: true });
|
|
100
|
+
|
|
101
|
+
console.log(`✓ Directories created: ${targetDir}`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Copy all skill files from source to target
|
|
106
|
+
*/
|
|
107
|
+
async function copySkillFiles(
|
|
108
|
+
sourceDir: string,
|
|
109
|
+
targetDir: string
|
|
110
|
+
): Promise<string[]> {
|
|
111
|
+
const filesToCopy = [
|
|
112
|
+
{ source: 'SKILL.md', target: 'SKILL.md' },
|
|
113
|
+
{ source: 'references/branch-naming.md', target: 'references/branch-naming.md' },
|
|
114
|
+
{ source: 'references/examples.md', target: 'references/examples.md' },
|
|
115
|
+
];
|
|
116
|
+
|
|
117
|
+
const copiedFiles: string[] = [];
|
|
118
|
+
|
|
119
|
+
for (const { source, target } of filesToCopy) {
|
|
120
|
+
const sourcePath = path.join(sourceDir, source);
|
|
121
|
+
const targetPath = path.join(targetDir, target);
|
|
122
|
+
|
|
123
|
+
// Ensure subdirectory exists
|
|
124
|
+
const targetSubdir = path.dirname(targetPath);
|
|
125
|
+
await fs.mkdir(targetSubdir, { recursive: true });
|
|
126
|
+
|
|
127
|
+
// Copy file
|
|
128
|
+
await fs.copyFile(sourcePath, targetPath);
|
|
129
|
+
copiedFiles.push(source);
|
|
130
|
+
|
|
131
|
+
console.log(`✓ Copied: ${source}`);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return copiedFiles;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Validate the copied skill has valid frontmatter
|
|
139
|
+
*/
|
|
140
|
+
async function validateCopiedSkill(skillPath: string): Promise<void> {
|
|
141
|
+
// Verify file exists
|
|
142
|
+
await fs.access(skillPath, fs.constants.R_OK);
|
|
143
|
+
|
|
144
|
+
// Validate frontmatter
|
|
145
|
+
const content = await fs.readFile(skillPath, 'utf-8');
|
|
146
|
+
const { metadata } = parseFrontmatter(content, skillPath);
|
|
147
|
+
SkillMetadataSchema.parse(metadata);
|
|
148
|
+
|
|
149
|
+
console.log(`✓ Copied skill validated successfully`);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Test that the skill is discoverable by SkillManager
|
|
154
|
+
*/
|
|
155
|
+
async function testDiscovery(): Promise<void> {
|
|
156
|
+
const manager = SkillManager.getInstance();
|
|
157
|
+
manager.reload(); // Clear cache
|
|
158
|
+
|
|
159
|
+
const skills = await manager.listSkills({
|
|
160
|
+
cwd: process.cwd(),
|
|
161
|
+
forceReload: true,
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
const mrSkills = skills.filter(s => s.metadata.name === 'mr');
|
|
165
|
+
|
|
166
|
+
if (mrSkills.length > 0) {
|
|
167
|
+
console.log(`✓ Skill discoverable (${mrSkills.length} instance(s) found)`);
|
|
168
|
+
mrSkills.forEach(skill => {
|
|
169
|
+
console.log(` Source: ${skill.source}`);
|
|
170
|
+
console.log(` Priority: ${skill.computedPriority}`);
|
|
171
|
+
console.log(` Path: ${skill.filePath}`);
|
|
172
|
+
});
|
|
173
|
+
} else {
|
|
174
|
+
console.warn('⚠️ Skill not immediately discoverable (may need agent restart)');
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Print success message with next steps
|
|
180
|
+
*/
|
|
181
|
+
function printSuccess(targetDir: string, files: string[]): void {
|
|
182
|
+
console.log('\n' + '='.repeat(60));
|
|
183
|
+
console.log('✅ Successfully copied /mr skill to global scope!');
|
|
184
|
+
console.log('='.repeat(60));
|
|
185
|
+
console.log(`\n📁 Location: ${targetDir}`);
|
|
186
|
+
console.log(`📄 Files copied: ${files.length}`);
|
|
187
|
+
console.log(`\n🔄 Next steps:`);
|
|
188
|
+
console.log(`1. The skill is now available globally across all projects`);
|
|
189
|
+
console.log(`2. Use /mr in any project to create pull requests`);
|
|
190
|
+
console.log(`3. Run "codemie skill list" to verify it's loaded`);
|
|
191
|
+
console.log(`4. Run "codemie skill reload" to refresh if needed`);
|
|
192
|
+
console.log(`\n💡 Tip: Project-level skills (if present) take priority over global skills.\n`);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Print error message with troubleshooting tips
|
|
197
|
+
*/
|
|
198
|
+
function printError(error: unknown): void {
|
|
199
|
+
console.error('\n' + '='.repeat(60));
|
|
200
|
+
console.error('❌ Failed to copy /mr skill');
|
|
201
|
+
console.error('='.repeat(60));
|
|
202
|
+
console.error(`\nError: ${error instanceof Error ? error.message : String(error)}`);
|
|
203
|
+
if (error instanceof Error && error.stack) {
|
|
204
|
+
console.error(`\nStack trace:\n${error.stack}`);
|
|
205
|
+
}
|
|
206
|
+
console.error(`\n🔍 Troubleshooting:`);
|
|
207
|
+
console.error(`- Check source exists: .codemie/skills/mr/SKILL.md`);
|
|
208
|
+
console.error(`- Check permissions: ~/.claude/skills/`);
|
|
209
|
+
console.error(`- Check disk space: df -h ~`);
|
|
210
|
+
console.error(`- Validate frontmatter: codemie skill validate\n`);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Main execution function
|
|
215
|
+
*/
|
|
216
|
+
async function main(): Promise<void> {
|
|
217
|
+
try {
|
|
218
|
+
console.log('\n🚀 Starting /mr skill copy to global scope...\n');
|
|
219
|
+
|
|
220
|
+
// Phase 1: Validate source
|
|
221
|
+
console.log('Phase 1: Validating source skill...');
|
|
222
|
+
const sourceDir = path.join(process.cwd(), '.codemie', 'skills', 'mr');
|
|
223
|
+
await validateSourceSkill(sourceDir);
|
|
224
|
+
|
|
225
|
+
// Phase 2: Check target
|
|
226
|
+
console.log('\nPhase 2: Checking target location...');
|
|
227
|
+
const targetDir = resolveHomeDir('.claude/skills/mr');
|
|
228
|
+
await checkTargetConflict(targetDir);
|
|
229
|
+
|
|
230
|
+
// Phase 3: Prepare directories
|
|
231
|
+
console.log('\nPhase 3: Preparing directories...');
|
|
232
|
+
await prepareDirectories(targetDir);
|
|
233
|
+
|
|
234
|
+
// Phase 4: Copy files
|
|
235
|
+
console.log('\nPhase 4: Copying skill files...');
|
|
236
|
+
const files = await copySkillFiles(sourceDir, targetDir);
|
|
237
|
+
|
|
238
|
+
// Phase 5: Validate
|
|
239
|
+
console.log('\nPhase 5: Validating copied skill...');
|
|
240
|
+
await validateCopiedSkill(path.join(targetDir, 'SKILL.md'));
|
|
241
|
+
await testDiscovery();
|
|
242
|
+
|
|
243
|
+
// Phase 6: Success feedback
|
|
244
|
+
printSuccess(targetDir, files);
|
|
245
|
+
} catch (error) {
|
|
246
|
+
printError(error);
|
|
247
|
+
process.exit(1);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// Run main function
|
|
252
|
+
main();
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Demo script for testing hooks in codemie-code
|
|
3
|
+
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
GREEN='\033[0;32m'
|
|
7
|
+
BLUE='\033[0;34m'
|
|
8
|
+
YELLOW='\033[1;33m'
|
|
9
|
+
RED='\033[0;31m'
|
|
10
|
+
NC='\033[0m'
|
|
11
|
+
|
|
12
|
+
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
13
|
+
echo -e "${BLUE} CodeMie Hooks Demo${NC}"
|
|
14
|
+
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
15
|
+
echo ""
|
|
16
|
+
|
|
17
|
+
# Check if config exists
|
|
18
|
+
if [ ! -f ~/.codemie/codemie-cli.config.json ]; then
|
|
19
|
+
echo -e "${RED}✗ Configuration file not found${NC}"
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
# Show configured hooks
|
|
24
|
+
echo -e "${GREEN}✓ Configuration loaded${NC}"
|
|
25
|
+
echo ""
|
|
26
|
+
echo "Configured Hooks:"
|
|
27
|
+
echo "━━━━━━━━━━━━━━━━"
|
|
28
|
+
|
|
29
|
+
# PreToolUse
|
|
30
|
+
echo -e "${YELLOW}PreToolUse:${NC}"
|
|
31
|
+
echo " • Matcher: Bash"
|
|
32
|
+
echo " • Action: Block 'rm -rf' commands"
|
|
33
|
+
echo " • Script: ~/.codemie/test-hooks/pre-tool-hook.sh"
|
|
34
|
+
|
|
35
|
+
echo ""
|
|
36
|
+
echo -e "${YELLOW}PostToolUse:${NC}"
|
|
37
|
+
echo " • Matcher: * (all tools)"
|
|
38
|
+
echo " • Action: Log all tool usage"
|
|
39
|
+
echo " • Script: ~/.codemie/test-hooks/post-tool-hook.sh"
|
|
40
|
+
|
|
41
|
+
echo ""
|
|
42
|
+
echo -e "${YELLOW}UserPromptSubmit:${NC}"
|
|
43
|
+
echo " • Action: Add context to prompts"
|
|
44
|
+
echo " • Script: ~/.codemie/test-hooks/prompt-hook.sh"
|
|
45
|
+
|
|
46
|
+
echo ""
|
|
47
|
+
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
48
|
+
echo ""
|
|
49
|
+
|
|
50
|
+
# Clear logs for clean test
|
|
51
|
+
rm -f ~/.codemie/hook-test.log
|
|
52
|
+
rm -f ~/.codemie/tool-usage.log
|
|
53
|
+
echo -e "${GREEN}✓ Logs cleared for clean test${NC}"
|
|
54
|
+
echo ""
|
|
55
|
+
|
|
56
|
+
# Show test scenarios
|
|
57
|
+
echo -e "${BLUE}Test Scenarios:${NC}"
|
|
58
|
+
echo "━━━━━━━━━━━━━━━━"
|
|
59
|
+
echo ""
|
|
60
|
+
|
|
61
|
+
echo -e "${YELLOW}Scenario 1: PreToolUse Hook Blocks Dangerous Command${NC}"
|
|
62
|
+
echo " Try: \"run the command: rm -rf /tmp/test\""
|
|
63
|
+
echo " Expected: Hook blocks it with error"
|
|
64
|
+
echo ""
|
|
65
|
+
|
|
66
|
+
echo -e "${YELLOW}Scenario 2: PreToolUse Hook Allows Safe Command${NC}"
|
|
67
|
+
echo " Try: \"run the command: echo 'Hello World'\""
|
|
68
|
+
echo " Expected: Command executes normally"
|
|
69
|
+
echo ""
|
|
70
|
+
|
|
71
|
+
echo -e "${YELLOW}Scenario 3: PostToolUse Hook Logs Tools${NC}"
|
|
72
|
+
echo " Try: \"read package.json and show me the name\""
|
|
73
|
+
echo " Expected: Tool usage logged to ~/.codemie/tool-usage.log"
|
|
74
|
+
echo ""
|
|
75
|
+
|
|
76
|
+
echo -e "${YELLOW}Scenario 4: UserPromptSubmit Hook Adds Context${NC}"
|
|
77
|
+
echo " Try any prompt and check if context is added"
|
|
78
|
+
echo " Expected: Agent has context about working directory"
|
|
79
|
+
echo ""
|
|
80
|
+
|
|
81
|
+
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
82
|
+
echo ""
|
|
83
|
+
|
|
84
|
+
echo -e "${GREEN}Monitoring:${NC}"
|
|
85
|
+
echo " Watch hooks in real-time:"
|
|
86
|
+
echo " ${BLUE}tail -f ~/.codemie/logs/debug-\$(date +%Y-%m-%d).log | grep -i hook${NC}"
|
|
87
|
+
echo ""
|
|
88
|
+
echo " Check hook logs after test:"
|
|
89
|
+
echo " ${BLUE}cat ~/.codemie/hook-test.log${NC}"
|
|
90
|
+
echo " ${BLUE}cat ~/.codemie/tool-usage.log${NC}"
|
|
91
|
+
echo ""
|
|
92
|
+
|
|
93
|
+
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
94
|
+
echo ""
|
|
95
|
+
|
|
96
|
+
# Ask if user wants to set API key
|
|
97
|
+
echo -e "${YELLOW}⚠ Important: You need a valid API key to run codemie-code${NC}"
|
|
98
|
+
echo ""
|
|
99
|
+
echo "Options:"
|
|
100
|
+
echo " 1. Set CODEMIE_API_KEY environment variable"
|
|
101
|
+
echo " 2. Update ~/.codemie/codemie-cli.config.json with your key"
|
|
102
|
+
echo " 3. Run: codemie setup"
|
|
103
|
+
echo ""
|
|
104
|
+
|
|
105
|
+
read -p "Do you have an API key configured? (y/n) " -n 1 -r
|
|
106
|
+
echo
|
|
107
|
+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
108
|
+
echo ""
|
|
109
|
+
echo -e "${YELLOW}Please configure your API key first:${NC}"
|
|
110
|
+
echo " export CODEMIE_API_KEY='your-key-here'"
|
|
111
|
+
echo ""
|
|
112
|
+
echo "Then run:"
|
|
113
|
+
echo " ${BLUE}codemie-code${NC}"
|
|
114
|
+
echo ""
|
|
115
|
+
exit 0
|
|
116
|
+
fi
|
|
117
|
+
|
|
118
|
+
echo ""
|
|
119
|
+
echo -e "${GREEN}Starting codemie-code with hooks enabled...${NC}"
|
|
120
|
+
echo ""
|
|
121
|
+
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
122
|
+
echo ""
|
|
123
|
+
|
|
124
|
+
# Start codemie-code
|
|
125
|
+
codemie-code
|