A collection of console terminals in serveral operation systems.
Iโm using Claude Code, if you use another Coding CLI service, modify the codes. Insert below codes in .bashrc or .zshrc and then source ~/.zshrc:
claude_execute() {
  emulate -L zsh
  setopt NO_GLOB
  local query="$*"
  local prompt="You are a command line expert. The user wants to run a command but they don't know how. Here is what they asked: ${query}. Return ONLY the exact shell command needed. Do not prepend with an explanation, no markdown, no code blocks - just return the raw command you think will solve their query."
  local cmd
  # use Claude Code
  cmd=$(claude --dangerously-skip-permissions --disallowedTools "Bash(*)" --model default -p "$prompt" --output-format text | tr -d '\\000-\\037' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
  if [[ -z "$cmd" ]]; then
    echo "claude_execute: No command found"
    return 1
  fi
  echo -e "$ \\033[0;36m$cmd\\033[0m"
  eval "$cmd"
}
alias ask="noglob claude_execute"
# Usage
ask "List all conda env in this computer"
Only for macOS (Windows/Linux isnโt checked yet)
Ctrl+A # go to the beginning of line
Ctrl+E # go to the end of line
Ctrl+R # search prompt history
Option+Left # back one word
Option+Right # forward one word
Ctrl+U # remove the entire line containing the cursor
Ctrl+K # delete from cursor to end of line
Crtl+W # delete a word backward (left of cursor)
Alt+D # delete a word forward (right of cursor)
Install cmder (drop-down by Ctr + \\) and I use this personal setting files.
๐ Note: WSL on Windows
๐ Using iTerms2. Download its settings.