Skip to content

Commit 09f84b4

Browse files
committed
support iflow-cli
1 parent 8386b91 commit 09f84b4

File tree

5 files changed

+72
-0
lines changed

5 files changed

+72
-0
lines changed

src/core/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const AI_TOOLS: AIToolOption[] = [
2525
{ name: 'Crush', value: 'crush', available: true, successLabel: 'Crush' },
2626
{ name: 'Cursor', value: 'cursor', available: true, successLabel: 'Cursor' },
2727
{ name: 'Factory Droid', value: 'factory', available: true, successLabel: 'Factory Droid' },
28+
{ name: 'iFlow', value: 'iflow', available: true, successLabel: 'iFlow' },
2829
{ name: 'OpenCode', value: 'opencode', available: true, successLabel: 'OpenCode' },
2930
{ name: 'Kilo Code', value: 'kilocode', available: true, successLabel: 'Kilo Code' },
3031
{ name: 'Qoder (CLI)', value: 'qoder', available: true, successLabel: 'Qoder' },

src/core/configurators/iflow.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import path from "path";
2+
import { ToolConfigurator } from "./base.js";
3+
import { FileSystemUtils } from "../../utils/file-system.js";
4+
import { TemplateManager } from "../templates/index.js";
5+
import { OPENSPEC_MARKERS } from "../config.js";
6+
7+
export class IflowConfigurator implements ToolConfigurator {
8+
name = "iFlow";
9+
configFileName = "IFLOW.md";
10+
isAvailable = true;
11+
12+
async configure(projectPath: string, openspecDir: string): Promise<void> {
13+
const filePath = path.join(projectPath, this.configFileName);
14+
const content = TemplateManager.getClaudeTemplate();
15+
16+
await FileSystemUtils.updateFileWithMarkers(
17+
filePath,
18+
content,
19+
OPENSPEC_MARKERS.start,
20+
OPENSPEC_MARKERS.end
21+
);
22+
}
23+
}

src/core/configurators/registry.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ClineConfigurator } from './cline.js';
44
import { CodeBuddyConfigurator } from './codebuddy.js';
55
import { CostrictConfigurator } from './costrict.js';
66
import { QoderConfigurator } from './qoder.js';
7+
import { IflowConfigurator } from './iflow.js';
78
import { AgentsStandardConfigurator } from './agents.js';
89
import { QwenConfigurator } from './qwen.js';
910

@@ -16,6 +17,7 @@ export class ToolRegistry {
1617
const codeBuddyConfigurator = new CodeBuddyConfigurator();
1718
const costrictConfigurator = new CostrictConfigurator();
1819
const qoderConfigurator = new QoderConfigurator();
20+
const iflowConfigurator = new IflowConfigurator();
1921
const agentsConfigurator = new AgentsStandardConfigurator();
2022
const qwenConfigurator = new QwenConfigurator();
2123
// Register with the ID that matches the checkbox value
@@ -24,6 +26,7 @@ export class ToolRegistry {
2426
this.tools.set('codebuddy', codeBuddyConfigurator);
2527
this.tools.set('costrict', costrictConfigurator);
2628
this.tools.set('qoder', qoderConfigurator);
29+
this.tools.set('iflow', iflowConfigurator);
2730
this.tools.set('agents', agentsConfigurator);
2831
this.tools.set('qwen', qwenConfigurator);
2932
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { SlashCommandConfigurator } from './base.js';
2+
import { SlashCommandId } from '../../templates/index.js';
3+
4+
const FILE_PATHS: Record<SlashCommandId, string> = {
5+
proposal: '.iflow/commands/openspec-proposal.md',
6+
apply: '.iflow/commands/openspec-apply.md',
7+
archive: '.iflow/commands/openspec-archive.md'
8+
};
9+
10+
const FRONTMATTER: Record<SlashCommandId, string> = {
11+
proposal: `---
12+
name: /openspec-proposal
13+
id: openspec-proposal
14+
category: OpenSpec
15+
description: Scaffold a new OpenSpec change and validate strictly.
16+
---`,
17+
apply: `---
18+
name: /openspec-apply
19+
id: openspec-apply
20+
category: OpenSpec
21+
description: Implement an approved OpenSpec change and keep tasks in sync.
22+
---`,
23+
archive: `---
24+
name: /openspec-archive
25+
id: openspec-archive
26+
category: OpenSpec
27+
description: Archive a deployed OpenSpec change and update specs.
28+
---`
29+
};
30+
31+
export class IflowSlashCommandConfigurator extends SlashCommandConfigurator {
32+
readonly toolId = 'iflow';
33+
readonly isAvailable = true;
34+
35+
protected getRelativePath(id: SlashCommandId): string {
36+
return FILE_PATHS[id];
37+
}
38+
39+
protected getFrontmatter(id: SlashCommandId): string {
40+
return FRONTMATTER[id];
41+
}
42+
}

src/core/configurators/slash/registry.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { ClineSlashCommandConfigurator } from './cline.js';
1515
import { CrushSlashCommandConfigurator } from './crush.js';
1616
import { CostrictSlashCommandConfigurator } from './costrict.js';
1717
import { QwenSlashCommandConfigurator } from './qwen.js';
18+
import { IflowSlashCommandConfigurator } from './iflow.js';
1819

1920
export class SlashCommandRegistry {
2021
private static configurators: Map<string, SlashCommandConfigurator> = new Map();
@@ -36,6 +37,7 @@ export class SlashCommandRegistry {
3637
const crush = new CrushSlashCommandConfigurator();
3738
const costrict = new CostrictSlashCommandConfigurator();
3839
const qwen = new QwenSlashCommandConfigurator();
40+
const iflow = new IflowSlashCommandConfigurator();
3941

4042
this.configurators.set(claude.toolId, claude);
4143
this.configurators.set(codeBuddy.toolId, codeBuddy);
@@ -53,6 +55,7 @@ export class SlashCommandRegistry {
5355
this.configurators.set(crush.toolId, crush);
5456
this.configurators.set(costrict.toolId, costrict);
5557
this.configurators.set(qwen.toolId, qwen);
58+
this.configurators.set(iflow.toolId, iflow);
5659
}
5760

5861
static register(configurator: SlashCommandConfigurator): void {

0 commit comments

Comments
 (0)