Skip to content
Merged
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
9 changes: 5 additions & 4 deletions packages/notch-mod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tool and nothing else.
Nothing is installed and nothing is written to your settings:

```sh
claude --plugin-url https://github.com/sameeeeeeep/switchboard/releases/download/notch-v0.1.0/switchboard-notch.zip
claude --plugin-url https://github.com/sameeeeeeep/switchboard-notch/releases/download/v0.1.0/switchboard-notch.zip
```

Ask Claude something that makes it ask you back, or run `/notch test`.
Expand All @@ -26,10 +26,10 @@ Ask Claude something that makes it ask you back, or run `/notch test`.
In Claude Code (v2.1.275+ adds the marketplace and installs in one step):

```text
/plugin install switchboard-notch --marketplace sameeeeeeep/switchboard
/plugin install switchboard-notch --marketplace sameeeeeeep/switchboard-notch
```

Updates: `claude plugin update switchboard-notch@switchboard`.
Updates: `claude plugin update switchboard-notch@switchboard-notch`.

## Settings

Expand All @@ -53,7 +53,7 @@ steps aside and Claude Code asks as usual.
The mod's only action is to run `helper/sb-card`, a small native program that draws one card and
prints your answer. It needs no permissions, makes no network requests, and exits as soon as you
answer. The binary is signed with Developer ID (STAYOFT VENTURES PRIVATE LIMITED, 55354KFTHU) and
notarized by Apple. Its source is [`helper/sb-card.swift`](helper/sb-card.swift). To see what the mod
notarized by Apple. Its source is [`helper/sb-card.swift`](helper/sb-card.swift). Source of truth: [`packages/notch-mod`](https://github.com/sameeeeeeep/switchboard/tree/main/packages/notch-mod) in the switchboard repo. To see what the mod
hooks before you load it, run `claude plugin validate` on this directory.

## Develop
Expand All @@ -62,4 +62,5 @@ hooks before you load it, run `claude plugin validate` on this directory.
claude --plugin-dir "$PWD" # load this checkout; edits hot-reload
claude plugin test # unit tests (no session needed)
./build.sh # rebuild, sign and notarize helper/sb-card
./publish.sh # mirror to sameeeeeeep/switchboard-notch and release
```
Binary file modified packages/notch-mod/helper/sb-card
Binary file not shown.
62 changes: 62 additions & 0 deletions packages/notch-mod/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/sh
# Mirror this plugin to its own small repo, github.com/sameeeeeeep/switchboard-notch, and release it.
#
# The source of truth stays here. The small repo exists so `/plugin install ... --marketplace
# sameeeeeeep/switchboard-notch` clones ~1 MB instead of the whole switchboard repo, which can pass
# Claude Code's 120 s clone limit on slow connections.
#
# ./build.sh && ./publish.sh # bump .claude-plugin/plugin.json "version" first
set -eu
cd "$(dirname "$0")"

REPO=sameeeeeeep/switchboard-notch
VERSION=$(python3 -c 'import json; print(json.load(open(".claude-plugin/plugin.json"))["version"])')
TMP=$(mktemp -d)
trap 'rm -rf "$TMP"' EXIT

[ -f dist/switchboard-notch.zip ] || { echo "run ./build.sh first" >&2; exit 1; }

gh repo clone "$REPO" "$TMP/repo" -- -q
cd "$TMP/repo"
git rm -rq --ignore-unmatch . >/dev/null
cd - >/dev/null

# Plugin files, plus a marketplace file so the repo is its own marketplace.
cp -R .claude-plugin hooks helper tests README.md build.sh publish.sh .gitignore "$TMP/repo/"
rm -rf "$TMP/repo/.claude-plugin/types"
cp ../../LICENSE "$TMP/repo/LICENSE"
cat > "$TMP/repo/.claude-plugin/marketplace.json" <<'EOF'
{
"name": "switchboard-notch",
"description": "Claude's questions as a native card at the Mac notch.",
"owner": { "name": "sameeeeeeep", "url": "https://github.com/sameeeeeeep/switchboard" },
"plugins": [
{
"name": "switchboard-notch",
"source": "./",
"description": "Claude's questions drop from your Mac's notch as a native card. A Claude Code mod (v2.1.287+, macOS 13+)."
}
]
}
EOF

cd "$TMP/repo"
claude plugin validate --strict . >/dev/null
git add -A
if git diff --cached --quiet; then
echo "no changes to publish"
else
git commit -qm "switchboard-notch $VERSION (mirrored from sameeeeeeep/switchboard packages/notch-mod)"
git push -q origin HEAD:main
fi
cd - >/dev/null

if gh release view "v$VERSION" -R "$REPO" >/dev/null 2>&1; then
gh release upload "v$VERSION" dist/switchboard-notch.zip -R "$REPO" --clobber
else
gh release create "v$VERSION" dist/switchboard-notch.zip -R "$REPO" --title "Switchboard Notch $VERSION" \
--notes "Try for one session: \`claude --plugin-url https://github.com/$REPO/releases/download/v$VERSION/switchboard-notch.zip\`

Keep it, in Claude Code: \`/plugin install switchboard-notch --marketplace $REPO\`"
fi
echo "published $REPO v$VERSION"
Loading