@@ -15,11 +15,20 @@ IMPORTANT RULES:
15151. Provide 3-5 alternative command suggestions
16162. Order suggestions from most likely to least likely
17173. Make commands safe and appropriate
18- 4. Use the context (git info, history, cwd) to make intelligent suggestions
18+ 4. Use the context (git info, history, cwd, OS, package manager ) to make intelligent suggestions
19195. If the input is already complete, suggest improvements or alternatives
20206. For ambiguous or typo inputs, interpret user intent and suggest corrections
21- 7. Prefer standard Unix/Linux commands
22- 8. Keep commands concise but complete
21+ 7. Keep commands concise but complete
22+
23+ OS-SPECIFIC COMMANDS:
24+ - ALWAYS use commands appropriate for the user's operating system and package manager
25+ - For package installation on Linux with apt: use "sudo apt install <package>"
26+ - For package installation on Linux with yum/dnf: use "sudo yum install <package>" or "sudo dnf install <package>"
27+ - For package installation on Linux with pacman: use "sudo pacman -S <package>"
28+ - For package installation on macOS with brew: use "brew install <package>"
29+ - For package installation on Windows: use appropriate Windows commands or PowerShell
30+ - Adjust file paths, command options, and syntax based on the OS
31+ - Use native commands when available (e.g., 'open' on macOS vs 'xdg-open' on Linux)
2332
2433RESPONSE FORMAT:
2534One suggestion per line in this exact format:
@@ -38,6 +47,15 @@ func buildSuggestUserPrompt(ctx *core.ContextEnvelope) string {
3847 // Add the current line (what the user is typing)
3948 parts = append (parts , fmt .Sprintf ("Current input: %s" , ctx .Line ))
4049
50+ // Add system information
51+ parts = append (parts , fmt .Sprintf ("\n Operating System: %s" , ctx .OS ))
52+ if ctx .Distribution != "" {
53+ parts = append (parts , fmt .Sprintf ("Distribution: %s" , ctx .Distribution ))
54+ }
55+ if ctx .PackageManager != "" {
56+ parts = append (parts , fmt .Sprintf ("Package Manager: %s" , ctx .PackageManager ))
57+ }
58+
4159 // Add shell and working directory
4260 parts = append (parts , fmt .Sprintf ("\n Shell: %s" , ctx .Shell ))
4361 parts = append (parts , fmt .Sprintf ("Working directory: %s" , ctx .CWD ))
@@ -94,6 +112,12 @@ func buildExplainUserPrompt(ctx *core.ContextEnvelope) string {
94112 // Add the command to explain
95113 parts = append (parts , fmt .Sprintf ("Explain this command: %s" , ctx .Line ))
96114
115+ // Add system information
116+ parts = append (parts , fmt .Sprintf ("\n Operating System: %s" , ctx .OS ))
117+ if ctx .Distribution != "" {
118+ parts = append (parts , fmt .Sprintf ("Distribution: %s" , ctx .Distribution ))
119+ }
120+
97121 // Add context
98122 parts = append (parts , fmt .Sprintf ("\n Shell: %s" , ctx .Shell ))
99123 parts = append (parts , fmt .Sprintf ("Working directory: %s" , ctx .CWD ))
0 commit comments