(argv: string[] = process.argv.slice(2))
| 87 | const DEFAULT_CODEX_NATIVE_API_PORT = 43182; |
| 88 | |
| 89 | async function main(argv: string[] = process.argv.slice(2)) { |
| 90 | loadRepoEnvDefaults(); |
| 91 | const [group, command, ...args] = argv; |
| 92 | if (group === 'weixin' && command === 'login') { |
| 93 | return runWeixinLogin(args); |
| 94 | } |
| 95 | if (group === 'weixin' && command === 'serve') { |
| 96 | return runWeixinServe(args); |
| 97 | } |
| 98 | if (group === 'weixin' && command === 'clear-context') { |
| 99 | return runWeixinClearContext(args); |
| 100 | } |
| 101 | if (group === 'codex' && command === 'cleanup-internal-threads') { |
| 102 | return runCodexCleanupInternalThreads(args); |
| 103 | } |
| 104 | if (group === 'codex' && command === 'native-api-serve') { |
| 105 | return runCodexNativeApiServe(args); |
| 106 | } |
| 107 | printUsage(); |
| 108 | process.exitCode = 1; |
| 109 | } |
| 110 | |
| 111 | async function runWeixinLogin(args: string[]) { |
| 112 | const i18n = createI18n(); |
no test coverage detected