From cf029df850e466b5b07477efc05b57f2b820b777 Mon Sep 17 00:00:00 2001 From: Nilton Teixeira <9078708+niltonfrederico@users.noreply.github.com> Date: Tue, 31 Mar 2026 11:24:10 -0300 Subject: [PATCH] fix(issue,53): fixed duplicated required options in export and import --- src/commands/export.ts | 11 +++++------ src/commands/import.ts | 9 ++++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/commands/export.ts b/src/commands/export.ts index b952d7e..75cd826 100644 --- a/src/commands/export.ts +++ b/src/commands/export.ts @@ -11,8 +11,8 @@ import { exportToCopilotString, exportToOpenCodeString, exportToCursorString, -exportToGeminiString, -exportToCodexString, + exportToGeminiString, + exportToCodexString, } from '../adapters/index.js'; import { exportToLyzrString } from '../adapters/lyzr.js'; import { exportToGitHubString } from '../adapters/github.js'; @@ -25,8 +25,7 @@ interface ExportOptions { export const exportCommand = new Command('export') .description('Export agent to other formats') -.requiredOption('-f, --format ', 'Export format (system-prompt, claude-code, openai, crewai, openclaw, nanobot, lyzr, github, copilot, opencode, cursor, gemini)') -.requiredOption('-f, --format ', 'Export format (system-prompt, claude-code, openai, crewai, openclaw, nanobot, lyzr, github, copilot, opencode, cursor, codex)') + .requiredOption('-f, --format ', 'Export format (system-prompt, claude-code, openai, crewai, openclaw, nanobot, lyzr, github, copilot, opencode, cursor, gemini, codex)') .option('-d, --dir ', 'Agent directory', '.') .option('-o, --output ', 'Output file path') .action(async (options: ExportOptions) => { @@ -72,13 +71,13 @@ export const exportCommand = new Command('export') case 'cursor': result = exportToCursorString(dir); break; -case 'gemini': + case 'gemini': result = exportToGeminiString(dir); break; default: error(`Unknown format: ${options.format}`); info('Supported formats: system-prompt, claude-code, openai, crewai, openclaw, nanobot, lyzr, github, copilot, opencode, cursor, gemini'); -case 'codex': + case 'codex': result = exportToCodexString(dir); info('Supported formats: system-prompt, claude-code, openai, crewai, openclaw, nanobot, lyzr, github, copilot, opencode, cursor, codex'); process.exit(1); diff --git a/src/commands/import.ts b/src/commands/import.ts index fa07732..9aff0e8 100644 --- a/src/commands/import.ts +++ b/src/commands/import.ts @@ -451,7 +451,7 @@ function importFromGemini(sourcePath: string, targetDir: string): void { else if (approvalMode === 'default') hitl = 'conditional'; else if (approvalMode === 'yolo') hitl = 'none'; else if (approvalMode === 'auto_edit') hitl = 'advisory'; - + if (hitl) { agentYaml.compliance = { supervision: { @@ -521,8 +521,7 @@ function parseSections(markdown: string): [string, string][] { export const importCommand = new Command('import') .description('Import from other agent formats') -.requiredOption('--from ', 'Source format (claude, cursor, crewai, opencode, gemini)') -.requiredOption('--from ', 'Source format (claude, cursor, crewai, opencode, codex)') + .requiredOption('--from ', 'Source format (claude, cursor, crewai, opencode, gemini, codex)') .argument('', 'Source file or directory path') .option('-d, --dir ', 'Target directory', '.') .action((sourcePath: string, options: ImportOptions) => { @@ -546,13 +545,13 @@ export const importCommand = new Command('import') case 'opencode': importFromOpenCode(sourcePath, targetDir); break; -case 'gemini': + case 'gemini': importFromGemini(sourcePath, targetDir); break; default: error(`Unknown format: ${options.from}`); info('Supported formats: claude, cursor, crewai, opencode, gemini'); -case 'codex': + case 'codex': importFromCodex(sourcePath, targetDir); info('Supported formats: claude, cursor, crewai, opencode, codex'); process.exit(1);