Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion internal/llm/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ For shell command requests, respond with:
"command": "the shell command to run",
"description": "brief explanation of what it does",
"risk": "safe or risky",
"certainty": 90
"certainty": 90,
"explanation": "(optional) step-by-step breakdown of the command's flags and arguments"
}
]
}

Rules for commands:
- "risk" must be "safe" (read-only, informational) or "risky" (modifies files, processes, system state)
- "certainty" is 0-100, your confidence this is the correct command for what the user asked
- "explanation" is optional and only required when explicitly requested
- For multi-step tasks, return multiple commands in order. Use shell constructs like $(...) or pipes to chain when possible
- Generate commands appropriate for the detected OS and shell
- Never generate commands that could cause irreversible damage without clear user intent
Expand Down
1 change: 1 addition & 0 deletions internal/llm/prompt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func TestBuildSystemPrompt_ContainsJSONInstructions(t *testing.T) {
`"type": "commands"`,
`"risk"`,
`"certainty"`,
`"explanation"`,
`"type": "config"`,
"valid JSON",
}
Expand Down