Skip to content

Commit cf029df

Browse files
fix(issue,53): fixed duplicated required options in export and import
1 parent 24ed359 commit cf029df

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/commands/export.ts

Lines changed: 5 additions & 6 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,13 +71,13 @@ 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;
7877
default:
7978
error(`Unknown format: ${options.format}`);
8079
info('Supported formats: system-prompt, claude-code, openai, crewai, openclaw, nanobot, lyzr, github, copilot, opencode, cursor, gemini');
81-
case 'codex':
80+
case 'codex':
8281
result = exportToCodexString(dir);
8382
info('Supported formats: system-prompt, claude-code, openai, crewai, openclaw, nanobot, lyzr, github, copilot, opencode, cursor, codex');
8483
process.exit(1);

src/commands/import.ts

Lines changed: 4 additions & 5 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,13 +545,13 @@ 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;
552551
default:
553552
error(`Unknown format: ${options.from}`);
554553
info('Supported formats: claude, cursor, crewai, opencode, gemini');
555-
case 'codex':
554+
case 'codex':
556555
importFromCodex(sourcePath, targetDir);
557556
info('Supported formats: claude, cursor, crewai, opencode, codex');
558557
process.exit(1);

0 commit comments

Comments
 (0)