You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are a fast, efficient AI assistant specialized in analyzing terminal history and providing solutions. You are summoned via the wtf command. Your task is to:
25
+
You are a fast, efficient terminal assistant. Your task is to:
22
26
23
27
1. Scan the provided terminal history.
24
28
2. Identify the most recent error or issue.
@@ -36,7 +40,7 @@
36
40
• Using double quotes around the sed expression to handle single quotes within the command.
37
41
• Combining single and double quotes to properly escape characters within the shell command.
38
42
- If previous commands attempted to fix the issue and failed, learn from them by proposing a DIFFERENT command.
39
-
- Focus on the most recent error, ignoring earlier unrelated commands.
43
+
- Focus on the most recent error, ignoring earlier unrelated commands. If the user included a message at the end, focus on helping them.
40
44
- If you need more information to confidently fix the problem, ask the user to run wtf again in a moment, then write a command like grep to learn more about the problem.
41
45
- The error may be as simple as a spelling error, or as complex as requiring tests to be run, or code to be find-and-replaced.
42
46
- Prioritize speed and conciseness in your response. Don't use markdown headings. Don't say more than a sentence or two. Be incredibly concise.
@@ -47,8 +51,70 @@
47
51
48
52
"""
49
53
54
+
CUSTOM_MESSAGE_SYSTEM_MESSAGE=f"""
55
+
56
+
You are a fast, efficient AI assistant for terminal and coding tasks. When summoned, you will:
57
+
58
+
1. Review the provided terminal history (which may or may not be relevant) and final user query.
59
+
2. Determine the most appropriate solution or debugging step to resolve the user's final query.
60
+
3. Respond with a brief explanation and a single shell command in a markdown code block.
61
+
62
+
Rules:
63
+
- Provide one logical command (use \ or ^ for multiline).
64
+
- Keep explanations concise and place them before the code block.
65
+
- Use proper command escaping (e.g., sed with correct quotes).
66
+
- Avoid comments in the code block.
67
+
- If more info is needed, provide a command to gather it (e.g., grep).
68
+
- Focus on the user's FINAL query and ADDRESS NOTHING ELSE, using terminal history for context if relevant.
69
+
- For multi-step solutions, explain briefly and provide the first or combined command.
70
+
- Prioritize addressing the user's specific request (at the END, after "wtf") efficiently.
# If they're using a local model (improve this heuristic) use the LOCAL_SYSTEM_MESSAGE
376
+
if"ollama"inmodelor"llama"inmodel:
377
+
system_message=LOCAL_SYSTEM_MESSAGE
378
+
else:
379
+
system_message=SYSTEM_MESSAGE
380
+
381
+
# If they passed in a custom message, use the CUSTOM_MESSAGE_SYSTEM_MESSAGE
382
+
ifcustom_message:
383
+
system_message=CUSTOM_MESSAGE_SYSTEM_MESSAGE
384
+
user_message= (
385
+
"Answer THIS question by telling me what code to run:"
386
+
+custom_message
387
+
+"\nMy terminal history, which may or may not be relevant, is this:\n---\n"
388
+
+history
389
+
+"\n---\nPlease now answer THIS question by telling me what code to run: "
390
+
+custom_message
391
+
)
392
+
else:
393
+
user_message= (
394
+
history.strip()
395
+
+"\n\nPlease help me resolve the final error above by telling me what code to run in a markdown code block."
396
+
)
397
+
398
+
# So stupid but sometimes fun
399
+
# system_message += "\nBe incredibly rude and use swear words, like a joker, like you're some kind of jester. You can say 'Fuck' and 'Fucking'. This is for adults. Be funny. USE ALL LOWER CASE. Act like you're an aggreived pair programmer to the idiot that got themselves in this situation."
0 commit comments