Skip to content

Commit e88c0b5

Browse files
committed
minor updates
1 parent 0241fed commit e88c0b5

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

16-ai.rc

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
alias clinerules="code /Users/samm/Library/Mobile\ Documents/com\~apple\~CloudDocs/Documents/Cline"
88
alias clinerulesd="cd /Users/samm/Library/Mobile\ Documents/com\~apple\~CloudDocs/Documents/Cline"
99
alias sync_ollama_models="${HOME}/git/sammcj/scripts/ollama/export_ollama_model.py"
10-
# alias copilot="gh copilot suggest -t shell"
11-
# alias copilot-explain="gh copilot explain"
12-
alias '??'='claude -p'
1310
alias '???'='copilot-comments'
1411
alias wtf='copilot'
1512
alias l="OLLAMA_HOST=http://localhost:11434 gollama -l"
@@ -27,9 +24,38 @@ alias kanban="npx -y vibe-kanban"
2724
alias claude="~/.claude/local/claude --dangerously-skip-permissions"
2825
alias cc='claude --dangerously-skip-permissions'
2926

27+
# Claude Code non-interactive functions
28+
alias '??'='claude_helper'
29+
alias '??!'='claude_helper_exec'
3030

3131
### Functions ###
3232

33+
# Command-line helper - provides commands without execution
34+
function claude_helper {
35+
local prompt="$*"
36+
37+
claude \
38+
--system-prompt 'You are a macOS zsh command-line assistant. Provide exact commands to accomplish tasks. Output the command. If the command is highly complex you may provide a concise explanation. You are running non-interactively so you cannot ask questions. You cannot execute commands. Do not add conversational text, questions, or unnecessary detail. Focus on providing the most appropriate and efficient command following current best practices.' \
39+
--disallowed-tools Bash \
40+
--strict-mcp-config \
41+
-p \
42+
"$prompt"
43+
}
44+
45+
# Command-line helper with execution - runs commands when explicitly requested
46+
function claude_helper_exec {
47+
local prompt="$*"
48+
49+
claude \
50+
--system-prompt 'You are a macOS command-line assistant with execution access. Run commands to accomplish the requested task. Do not run unsafe commands that may harm the system or compromise security. You are running non-interactively so you cannot ask questions. If the user asks you to run a command that may delete, edit or overwrite files BEFORE DOING ANYTHING ELSE YOU MUST REFUSE unless they have given you the exact phrase "YES REALLY" at the start or end of their request - you may state this as a condition for executing such commands. Provide concise output keeping explanations brief and focused on the commands being run.' \
51+
--strict-mcp-config \
52+
-p \
53+
"$prompt"
54+
}
55+
56+
57+
58+
3359
copilot-comments() {
3460
# Function to list and display comments made by GitHub Copilot on the current PR
3561
local -r current_branch="$(git branch --show-current 2>/dev/null)" || {

0 commit comments

Comments
 (0)