Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/akashmahlaz_copilot-minimax.json
T

1 line
1.7 KiB
JSON

{"repo": "akashmahlaz/copilot-minimax", "files": {"packages/copilot-minimax-cli/src/cli.js": {"302d8173bd9fd1b5f1be56145356cad4170a23e5": {"t": 1785674015.1500936, "n": 1441, "h": "cb24727e8fa0af5d", "c": "import { patchCommand, restoreCommand, statusCommand } from './commands.js';\n\nconst HELP = `copilot-minimax\n\nUsage:\n copilot-minimax status\n copilot-minimax patch [--key API_KEY]\n copilot-minimax restore\n\nExamples:\n npx copilot-minimax status\n npx copilot-minimax patch --key sk-cp-...\n`;\n\nfunction parseOptions(args) {\n const options = {};\n for (let index = 0; index < args.length; index += 1) {\n const arg = args[index];\n if (arg === '--key') {\n const apiKey = args[index + 1];\n if (!apiKey) {\n throw new Error('Missing value for --key');\n }\n options.apiKey = apiKey;\n index += 1;\n } else if (arg.startsWith('--key=')) {\n const apiKey = arg.slice('--key='.length);\n if (!apiKey) {\n throw new Error('Missing value for --key');\n }\n options.apiKey = apiKey;\n } else {\n throw new Error(`Unknown option: ${arg}\\n\\n${HELP}`);\n }\n }\n return options;\n}\n\nexport async function main(args) {\n const [command, ...restArgs] = args;\n\n if (!command || command === '--help' || command === '-h') {\n console.log(HELP);\n return;\n }\n\n if (command === 'status') {\n console.log(statusCommand());\n return;\n }\n\n if (command === 'patch') {\n console.log(patchCommand(parseOptions(restArgs)));\n return;\n }\n\n if (command === 'restore') {\n console.log(restoreCommand());\n return;\n }\n\n throw new Error(`Unknown command: ${command}\\n\\n${HELP}`);\n}\n"}}}}