// {{ display_name }} MCP server — generated by mcpify. Do not hand-edit.

import type { Command } from 'commander';

import { main } from '../index.js';

export function registerHttpCommand(program: Command): void {
  program
    .command('http')
    .description('Start the Harness Server over HTTP (for agent hosts)')
    .option('--host <host>', 'bind address')
    .option('--port <port>', 'bind port')
    .option('--cors-allow <origin>', 'CORS allowed origin')
    .action(async (options: { host?: string; port?: string; corsAllow?: string }) => {
      process.env['{{ tool_prefix_env }}_TRANSPORT'] = 'http';
      if (options.host) process.env['{{ tool_prefix_env }}_HOST'] = options.host;
      if (options.port) process.env['{{ tool_prefix_env }}_PORT'] = options.port;
      if (options.corsAllow) process.env['{{ tool_prefix_env }}_CORS_ALLOW'] = options.corsAllow;
      await main();
    });
}
