Skip to content

Commit 5ac1e12

Browse files
mrack688stucky68
andauthored
feat: add Lingma IDE support to configuration (#864)
feat: add Lingma IDE support to configuration feat: add Lingma IDE support to configuration Co-authored-by: Marck <6992917@qq.com>
1 parent fd7ad27 commit 5ac1e12

5 files changed

Lines changed: 39 additions & 0 deletions

File tree

src/core/command-generation/adapters/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export { kiroAdapter } from './kiro.js';
2424
export { opencodeAdapter } from './opencode.js';
2525
export { piAdapter } from './pi.js';
2626
export { qoderAdapter } from './qoder.js';
27+
export { lingmaAdapter } from './lingma.js';
2728
export { qwenAdapter } from './qwen.js';
2829
export { roocodeAdapter } from './roocode.js';
2930
export { windsurfAdapter } from './windsurf.js';
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Lingma Command Adapter
3+
*
4+
* Formats commands for Lingma following its frontmatter specification.
5+
*/
6+
7+
import path from 'path';
8+
import type { CommandContent, ToolCommandAdapter } from '../types.js';
9+
10+
/**
11+
* Lingma adapter for command generation.
12+
* File path: .lingma/commands/opsx/<id>.md
13+
* Frontmatter: name, description, category, tags
14+
*/
15+
export const lingmaAdapter: ToolCommandAdapter = {
16+
toolId: 'lingma',
17+
18+
getFilePath(commandId: string): string {
19+
return path.join('.lingma', 'commands', 'opsx', `${commandId}.md`);
20+
},
21+
22+
formatFile(content: CommandContent): string {
23+
const tagsStr = content.tags.join(', ');
24+
return `---
25+
name: ${content.name}
26+
description: ${content.description}
27+
category: ${content.category}
28+
tags: [${tagsStr}]
29+
---
30+
31+
${content.body}
32+
`;
33+
},
34+
};

src/core/command-generation/registry.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { kiroAdapter } from './adapters/kiro.js';
2626
import { opencodeAdapter } from './adapters/opencode.js';
2727
import { piAdapter } from './adapters/pi.js';
2828
import { qoderAdapter } from './adapters/qoder.js';
29+
import { lingmaAdapter } from './adapters/lingma.js';
2930
import { qwenAdapter } from './adapters/qwen.js';
3031
import { roocodeAdapter } from './adapters/roocode.js';
3132
import { windsurfAdapter } from './adapters/windsurf.js';
@@ -58,6 +59,7 @@ export class CommandAdapterRegistry {
5859
CommandAdapterRegistry.register(opencodeAdapter);
5960
CommandAdapterRegistry.register(piAdapter);
6061
CommandAdapterRegistry.register(qoderAdapter);
62+
CommandAdapterRegistry.register(lingmaAdapter);
6163
CommandAdapterRegistry.register(qwenAdapter);
6264
CommandAdapterRegistry.register(roocodeAdapter);
6365
CommandAdapterRegistry.register(windsurfAdapter);

src/core/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const AI_TOOLS: AIToolOption[] = [
4040
{ name: 'OpenCode', value: 'opencode', available: true, successLabel: 'OpenCode', skillsDir: '.opencode' },
4141
{ name: 'Pi', value: 'pi', available: true, successLabel: 'Pi', skillsDir: '.pi' },
4242
{ name: 'Qoder', value: 'qoder', available: true, successLabel: 'Qoder', skillsDir: '.qoder' },
43+
{ name: 'Lingma', value: 'lingma', available: true, successLabel: 'Lingma', skillsDir: '.lingma' },
4344
{ name: 'Qwen Code', value: 'qwen', available: true, successLabel: 'Qwen Code', skillsDir: '.qwen' },
4445
{ name: 'RooCode', value: 'roocode', available: true, successLabel: 'RooCode', skillsDir: '.roo' },
4546
{ name: 'Trae', value: 'trae', available: true, successLabel: 'Trae', skillsDir: '.trae' },

src/core/legacy-cleanup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const LEGACY_SLASH_COMMAND_PATHS: Record<string, LegacySlashCommandPatter
3434
'claude': { type: 'directory', path: '.claude/commands/openspec' },
3535
'codebuddy': { type: 'directory', path: '.codebuddy/commands/openspec' },
3636
'qoder': { type: 'directory', path: '.qoder/commands/openspec' },
37+
'lingma': { type: 'directory', path: '.lingma/commands/openspec' },
3738
'crush': { type: 'directory', path: '.crush/commands/openspec' },
3839
'gemini': { type: 'directory', path: '.gemini/commands/openspec' },
3940
'costrict': { type: 'directory', path: '.cospec/openspec/commands' },

0 commit comments

Comments
 (0)