47 lines
737 B
Go
47 lines
737 B
Go
package main
|
|
|
|
import (
|
|
"bufio"
|
|
"fmt"
|
|
"log"
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
func main() {
|
|
// Initialize the agent
|
|
agent := NewLinuxDiagnosticAgent()
|
|
|
|
// Start the interactive session
|
|
fmt.Println("Linux Diagnostic Agent Started")
|
|
fmt.Println("Enter a system issue description (or 'quit' to exit):")
|
|
|
|
scanner := bufio.NewScanner(os.Stdin)
|
|
for {
|
|
fmt.Print("> ")
|
|
if !scanner.Scan() {
|
|
break
|
|
}
|
|
|
|
input := strings.TrimSpace(scanner.Text())
|
|
if input == "quit" || input == "exit" {
|
|
break
|
|
}
|
|
|
|
if input == "" {
|
|
continue
|
|
}
|
|
|
|
// Process the issue
|
|
if err := agent.DiagnoseIssue(input); err != nil {
|
|
fmt.Printf("Error: %v\n", err)
|
|
}
|
|
}
|
|
|
|
if err := scanner.Err(); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
fmt.Println("Goodbye!")
|
|
}
|