Skip to content

Commit 2c2bad7

Browse files
committed
fix: resolve duplicate requiredOption and broken switch fallthrough (#53)
2 parents 24ed359 + a8d561d commit 2c2bad7

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

src/commands/export.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import {
1111
exportToCopilotString,
1212
exportToOpenCodeString,
1313
exportToCursorString,
14-
exportToGeminiString,
15-
exportToCodexString,
14+
exportToGeminiString,
15+
exportToCodexString,
1616
} from '../adapters/index.js';
1717
import { exportToLyzrString } from '../adapters/lyzr.js';
1818
import { exportToGitHubString } from '../adapters/github.js';
@@ -25,8 +25,7 @@ interface ExportOptions {
2525

2626
export const exportCommand = new Command('export')
2727
.description('Export agent to other formats')
28-
.requiredOption('-f, --format <format>', 'Export format (system-prompt, claude-code, openai, crewai, openclaw, nanobot, lyzr, github, copilot, opencode, cursor, gemini)')
29-
.requiredOption('-f, --format <format>', 'Export format (system-prompt, claude-code, openai, crewai, openclaw, nanobot, lyzr, github, copilot, opencode, cursor, codex)')
28+
.requiredOption('-f, --format <format>', 'Export format (system-prompt, claude-code, openai, crewai, openclaw, nanobot, lyzr, github, copilot, opencode, cursor, gemini, codex)')
3029
.option('-d, --dir <dir>', 'Agent directory', '.')
3130
.option('-o, --output <output>', 'Output file path')
3231
.action(async (options: ExportOptions) => {
@@ -72,15 +71,15 @@ export const exportCommand = new Command('export')
7271
case 'cursor':
7372
result = exportToCursorString(dir);
7473
break;
75-
case 'gemini':
74+
case 'gemini':
7675
result = exportToGeminiString(dir);
7776
break;
77+
case 'codex':
78+
result = exportToCodexString(dir);
79+
break;
7880
default:
7981
error(`Unknown format: ${options.format}`);
80-
info('Supported formats: system-prompt, claude-code, openai, crewai, openclaw, nanobot, lyzr, github, copilot, opencode, cursor, gemini');
81-
case 'codex':
82-
result = exportToCodexString(dir);
83-
info('Supported formats: system-prompt, claude-code, openai, crewai, openclaw, nanobot, lyzr, github, copilot, opencode, cursor, codex');
82+
info('Supported formats: system-prompt, claude-code, openai, crewai, openclaw, nanobot, lyzr, github, copilot, opencode, cursor, gemini, codex');
8483
process.exit(1);
8584
}
8685

src/commands/import.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ function importFromGemini(sourcePath: string, targetDir: string): void {
451451
else if (approvalMode === 'default') hitl = 'conditional';
452452
else if (approvalMode === 'yolo') hitl = 'none';
453453
else if (approvalMode === 'auto_edit') hitl = 'advisory';
454-
454+
455455
if (hitl) {
456456
agentYaml.compliance = {
457457
supervision: {
@@ -521,8 +521,7 @@ function parseSections(markdown: string): [string, string][] {
521521

522522
export const importCommand = new Command('import')
523523
.description('Import from other agent formats')
524-
.requiredOption('--from <format>', 'Source format (claude, cursor, crewai, opencode, gemini)')
525-
.requiredOption('--from <format>', 'Source format (claude, cursor, crewai, opencode, codex)')
524+
.requiredOption('--from <format>', 'Source format (claude, cursor, crewai, opencode, gemini, codex)')
526525
.argument('<path>', 'Source file or directory path')
527526
.option('-d, --dir <dir>', 'Target directory', '.')
528527
.action((sourcePath: string, options: ImportOptions) => {
@@ -546,15 +545,15 @@ export const importCommand = new Command('import')
546545
case 'opencode':
547546
importFromOpenCode(sourcePath, targetDir);
548547
break;
549-
case 'gemini':
548+
case 'gemini':
550549
importFromGemini(sourcePath, targetDir);
551550
break;
551+
case 'codex':
552+
importFromCodex(sourcePath, targetDir);
553+
break;
552554
default:
553555
error(`Unknown format: ${options.from}`);
554-
info('Supported formats: claude, cursor, crewai, opencode, gemini');
555-
case 'codex':
556-
importFromCodex(sourcePath, targetDir);
557-
info('Supported formats: claude, cursor, crewai, opencode, codex');
556+
info('Supported formats: claude, cursor, crewai, opencode, gemini, codex');
558557
process.exit(1);
559558
}
560559

0 commit comments

Comments
 (0)