BYPASS SHELL BY ./RAZORGANZ
Server: nginx/1.20.1
System: Linux iZdzfnv9mwfppeZ 5.10.134-19.2.al8.x86_64 #1 SMP Wed Oct 29 22:47:09 CST 2025 x86_64
User: apache (48)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //lib/node_modules/openclaw/node_modules/openai/bin/cli
#!/usr/bin/env node

const { spawnSync } = require('child_process');

const commands = {
  migrate: {
    description: 'Run migrations to update to the latest major SDK version',
    fn: () => {
      const result = spawnSync(
        'npx',
        [
          '-y',
          'https://github.com/stainless-api/migrate-ts/releases/download/0.0.3/stainless-api-migrate-0.0.3.tgz',
          '--migrationConfig',
          require.resolve('./migration-config.json'),
          ...process.argv.slice(3),
        ],
        { stdio: 'inherit' },
      );
      if (result.status !== 0) {
        process.exit(result.status);
      }
    },
  },
};

function exitWithHelp() {
  console.log(`Usage: openai <subcommand>`);
  console.log();
  console.log('Subcommands:');

  for (const [name, info] of Object.entries(commands)) {
    console.log(`  ${name}  ${info.description}`);
  }

  console.log();
  process.exit(1);
}

if (process.argv.length < 3) {
  exitWithHelp();
}

const commandName = process.argv[2];

const command = commands[commandName];
if (!command) {
  console.log(`Unknown subcommand ${commandName}.`);
  exitWithHelp();
}

command.fn();