Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/forge_main/src/built_in_commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
"command": "keyboard-shortcuts",
"description": "Display ZSH keyboard shortcuts [alias: kb]"
},
{
"command": "echo",
"description": "Echo the input text"
},
{
"command": "setup",
"description": "Setup zsh integration by updating .zshrc"
Expand Down
1 change: 1 addition & 0 deletions shell-plugin/forge.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ source "${0:A:h}/lib/actions/editor.zsh"
source "${0:A:h}/lib/actions/provider.zsh"
source "${0:A:h}/lib/actions/doctor.zsh"
source "${0:A:h}/lib/actions/keyboard.zsh"
source "${0:A:h}/lib/actions/echo.zsh"

# Main dispatcher and widget registration
source "${0:A:h}/lib/dispatcher.zsh"
Expand Down
11 changes: 11 additions & 0 deletions shell-plugin/lib/actions/echo.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env zsh

# Echo action handler

# Action handler: Echo the input text
function _forge_action_echo() {
local input_text="$1"
if [[ -n "$input_text" ]]; then
echo "$input_text"
fi
}
7 changes: 5 additions & 2 deletions shell-plugin/lib/dispatcher.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ function _forge_action_default() {
_FORGE_CONVERSATION_ID="$new_id"
fi

echo

# Only set the agent if user explicitly specified one
if [[ -n "$user_action" ]]; then
_FORGE_ACTIVE_AGENT="$user_action"
Expand Down Expand Up @@ -223,7 +221,12 @@ function forge-accept-line() {
keyboard-shortcuts|kb)
_forge_action_keyboard
;;
echo)
zle -I
_forge_action_echo "$input_text"
;;
*)
zle -I
_forge_action_default "$user_action" "$input_text"
;;
esac
Expand Down
Loading