Skip to content

Commit 839c97f

Browse files
MrFlounderclaude
andcommitted
fix(pf): allow install/help when plugin not installed
Move the 'plugin not installed' check inside the default case so install/uninstall/help commands work before installation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent dae3344 commit 839c97f

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

src/crabcode

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5905,17 +5905,6 @@ handle_wip_for_workspace() {
59055905
handle_pf_command() {
59065906
local PLUGIN_DIR="$CONFIG_DIR/plugins/promptfoo"
59075907

5908-
# Check if plugin is installed
5909-
if [ ! -d "$PLUGIN_DIR" ] || [ ! -f "$PLUGIN_DIR/dist/cli.js" ]; then
5910-
echo -e "${CYAN}Promptfoo Target Discovery Agent${NC}"
5911-
echo ""
5912-
echo "Plugin not installed. Install with:"
5913-
echo ""
5914-
echo -e " ${GREEN}crab pf install${NC}"
5915-
echo ""
5916-
return 1
5917-
fi
5918-
59195908
case "${1:-}" in
59205909
"install")
59215910
pf_install
@@ -5931,6 +5920,16 @@ handle_pf_command() {
59315920
pf_help
59325921
;;
59335922
*)
5923+
# Check if plugin is installed before running
5924+
if [ ! -d "$PLUGIN_DIR" ] || [ ! -f "$PLUGIN_DIR/dist/cli.js" ]; then
5925+
echo -e "${CYAN}Promptfoo Target Discovery Agent${NC}"
5926+
echo ""
5927+
echo "Plugin not installed. Install with:"
5928+
echo ""
5929+
echo -e " ${GREEN}crab pf install${NC}"
5930+
echo ""
5931+
return 1
5932+
fi
59345933
# Pass all args to the Node.js CLI
59355934
node "$PLUGIN_DIR/dist/cli.js" "$@"
59365935
;;

0 commit comments

Comments
 (0)