A collection of console terminals in serveral operation systems.

No need to remember commands using AI

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"

Useful shortcuts with texts in the terminal

Only for macOS (Windows/Linux isn’t checked yet)

Firstly, turn option as meta key, otherwise, Alt+D won’t work!

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)

Terminals

Windows

Install cmder (drop-down by Ctr + \\) and I use this personal setting files.

👉 Note: WSL on Windows

Linux