Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created August 8, 2025 06:35
Show Gist options
  • Select an option

  • Save velotiotech/706d2a0cf905b9f5e0fc79f37a0b4b47 to your computer and use it in GitHub Desktop.

Select an option

Save velotiotech/706d2a0cf905b9f5e0fc79f37a0b4b47 to your computer and use it in GitHub Desktop.
ai_command_widget() {
local input="$READLINE_LINE"
local cmdout
cmdout=$(echo "$input" | node "$HOME/ai-shell-helper/main.js")
READLINE_LINE="$cmdout"
READLINE_POINT=${#READLINE_LINE}
}
# Bind Ctrl+G to the function
bind -x '"\C-g": ai_command_widget'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment