package main

import (
	"fmt"
	"os"

	"github.com/spf13/cobra"
)

const version = "0.1.0-dev"

var rootCmd = &cobra.Command{
	Use:   "qvm",
	Short: "QVM - QEMU Development VM Manager",
	Long: `QVM is a lightweight CLI tool for running commands in an isolated 
NixOS VM with persistent state and shared caches.

Provides VM isolation with transparent workspace mounting and shared build caches.`,
	Version: version,
}

func init() {
	rootCmd.AddCommand(startCmd)
	rootCmd.AddCommand(stopCmd)
	rootCmd.AddCommand(statusCmd)
	rootCmd.AddCommand(sshCmd)
	rootCmd.AddCommand(runCmd)
	rootCmd.AddCommand(rebuildCmd)
	rootCmd.AddCommand(resetCmd)
	rootCmd.AddCommand(cleanCmd)
}

func main() {
	if err := rootCmd.Execute(); err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
}
