#!/usr/bin/env node
// Bootstrap for CLI - runs the built CLI from dist
import { fileURLToPath } from 'url';
import path from 'path';
import packageJson from '@yahoo/uds/package.json' with { type: 'json' };
import updateNotifier from 'simple-update-notifier';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const cliPath = path.join(__dirname, './dist/cli/runner.js');

// Check for updates (skip in CI)
if (process.env.CI !== '1') {
  await updateNotifier({
    pkg: packageJson,
    shouldNotifyInNpmScript: true,
  });
}

await import(cliPath);
