commit 4b125e7feecae7aadfbb2e39be8b6f1fac34d4d4 Author: Zhongwei Li Date: Sun Nov 30 08:30:45 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..85c4f09 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,11 @@ +{ + "name": "force-bun", + "description": "Suggests using Bun instead of npm/npx commands in Bash tool calls", + "version": "0.2.0", + "author": { + "name": "kawaz" + }, + "hooks": [ + "./hooks" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..836cd88 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# force-bun + +Suggests using Bun instead of npm/npx commands in Bash tool calls diff --git a/hooks/force-bun.sh b/hooks/force-bun.sh new file mode 100755 index 0000000..25eec4b --- /dev/null +++ b/hooks/force-bun.sh @@ -0,0 +1,44 @@ +#!/bin/bash +set -euo pipefail + +suggest_deny() { + local reason="$1" + jq -cn \ + --arg reason "$reason" \ + '{ + "hookSpecificOutput": { + "hookEventName": "PreToolUse", + "permissionDecision": "deny", + "permissionDecisionReason": $reason + } + }' + exit 1 +} + +# 標準入力から JSON を読み取り +input=$(