50 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
#!/usr/bin/env -S deno run --allow-all
 | 
						|
 | 
						|
/**
 | 
						|
 * MOXYTOOL - Proxmox Administration Tool
 | 
						|
 *
 | 
						|
 * A comprehensive CLI tool for managing Proxmox servers, including:
 | 
						|
 * - vGPU setup and configuration
 | 
						|
 * - VM management
 | 
						|
 * - Cluster configuration
 | 
						|
 * - Automated maintenance tasks
 | 
						|
 *
 | 
						|
 * Required Permissions:
 | 
						|
 * - --allow-net: Network access for downloading installers
 | 
						|
 * - --allow-read: Read configuration files
 | 
						|
 * - --allow-write: Write configuration files, logs
 | 
						|
 * - --allow-run: Execute system commands (git, bash, systemctl)
 | 
						|
 * - --allow-sys: Access system information
 | 
						|
 * - --allow-env: Read environment variables
 | 
						|
 *
 | 
						|
 * @module
 | 
						|
 */
 | 
						|
 | 
						|
import * as cli from './ts/moxytool.cli.ts';
 | 
						|
 | 
						|
/**
 | 
						|
 * Main entry point for the MOXYTOOL application
 | 
						|
 * Sets up the CLI environment and executes the requested command
 | 
						|
 */
 | 
						|
async function main(): Promise<void> {
 | 
						|
  // Set environment variable to indicate CLI call
 | 
						|
  Deno.env.set('CLI_CALL', 'true');
 | 
						|
 | 
						|
  // Execute the CLI
 | 
						|
  await cli.runCli();
 | 
						|
}
 | 
						|
 | 
						|
// Execute main and handle errors
 | 
						|
if (import.meta.main) {
 | 
						|
  try {
 | 
						|
    await main();
 | 
						|
  } catch (error) {
 | 
						|
    console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
 | 
						|
    Deno.exit(1);
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
// Export for library usage (Deno modules only)
 | 
						|
export * from './ts/moxytool.cli.ts';
 | 
						|
export { logger } from './ts/moxytool.logging.ts';
 |