Skip to content

Commit cb18c22

Browse files
committed
feat(commands): add /update to direct command detection
1 parent 39b81ac commit cb18c22

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

shello_cli/agent/template.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
<secrets_handling>
149149
CRITICAL - Never expose secrets in plain-text commands.
150150
Store in env var first: API_KEY=$(secret_manager --name=x) then use $API_KEY
151-
If user input has asterisks (redacted), use {{secret_name}} placeholder.
151+
If user input has asterisks (redacted), use {{{{secret_name}}}} placeholder.
152152
</secrets_handling>
153153
154154
<output_management>
@@ -163,7 +163,7 @@
163163
164164
Filter Examples:
165165
✅ aws lambda list-functions | jq '.Functions[].FunctionName'
166-
✅ docker ps --format "{{.Names}}"
166+
✅ docker ps --format "{{{{.Names}}}}"
167167
✅ kubectl get pods -o name
168168
❌ aws lambda list-functions (dumps everything)
169169
❌ aws ec2 describe-instances (massive JSON)
@@ -176,7 +176,7 @@
176176
177177
Common patterns:
178178
| jq '.Items[].Name' # List names
179-
| jq '.[] | {name, status}' # Specific fields
179+
| jq '.[] | {{name, status}}' # Specific fields
180180
| jq '. | length' # Count items
181181
</json_handling>
182182

shello_cli/commands/command_detector.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,15 @@ def _is_question_structure(self, text: str, words: list) -> bool:
292292
if words[1] in self.PRONOUNS or words[1] == 'there':
293293
return True
294294

295-
# Question word in middle with auxiliary verb
295+
# Question word in middle - but only if there's additional natural language context
296+
# This prevents false positives like "env why" where "why" is just an argument
296297
for i, word in enumerate(words[1:], 1):
297298
if word in self.QUESTION_WORDS and i > 0:
298-
return True
299+
# Require additional context: auxiliary verbs, pronouns, or multiple question words
300+
if (any(w in auxiliary_verbs for w in words) or
301+
any(w in self.PRONOUNS for w in words) or
302+
sum(1 for w in words if w in self.QUESTION_WORDS) > 1):
303+
return True
299304

300305
return False
301306

0 commit comments

Comments
 (0)