diff --git a/README.md b/README.md index 1b89b7f..510dffc 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,16 @@ mo --version # Show installed version - Protect caches with `mo clean --whitelist`; defaults cover Playwright, HuggingFace, and Maven paths. - Use `mo touchid` to approve sudo with Touch ID instead of typing your password. +## Quick Launchers + +Install Raycast integration with one command: + +```bash +curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/integrations/setup-raycast.sh | bash +``` + +For Alfred and macOS Shortcuts, see [integrations/README.md](integrations/README.md). + ## Features in Detail ### Deep System Cleanup diff --git a/integrations/README.md b/integrations/README.md new file mode 100644 index 0000000..46cf4bf --- /dev/null +++ b/integrations/README.md @@ -0,0 +1,43 @@ +# Mole Integrations + +Quick launcher integrations for Mole. + +## Raycast + +One command install: + +```bash +curl -fsSL https://raw.githubusercontent.com/tw93/Mole/main/integrations/setup-raycast.sh | bash +``` + +Then open Raycast and search "Reload Script Commands". + +Available commands: `clean mac`, `dry run`, `uninstall apps` + +## Alfred + +Add a workflow with keyword `clean` and script: + +```bash +mo clean +``` + +For dry-run: `mo clean --dry-run` + +For uninstall: `mo uninstall` + +## macOS Shortcuts + +Create a shortcut with "Run Shell Script": + +```bash +mo clean +``` + +Then add to Menu Bar or assign a keyboard shortcut. + +## Uninstall + +```bash +rm -rf ~/Library/Application\ Support/Raycast/script-commands/mole-*.sh +``` diff --git a/integrations/raycast/mole-clean-dry-run.sh b/integrations/raycast/mole-clean-dry-run.sh new file mode 100755 index 0000000..a6f12be --- /dev/null +++ b/integrations/raycast/mole-clean-dry-run.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Clean Mac (Dry Run) +# @raycast.mode fullOutput +# @raycast.packageName Mole + +# Optional parameters: +# @raycast.icon 👀 +# @raycast.needsConfirmation false + +# Documentation: +# @raycast.description Preview what Mole would clean without making changes +# @raycast.author tw93 +# @raycast.authorURL https://github.com/tw93/Mole + +# Detect mo/mole installation +if command -v mo >/dev/null 2>&1; then + MO_BIN="mo" +elif command -v mole >/dev/null 2>&1; then + MO_BIN="mole" +else + echo "❌ Mole not found. Install from:" + echo " https://github.com/tw93/Mole" + exit 1 +fi + +# Run dry-run +echo "👀 Previewing cleanup..." +echo "" +"$MO_BIN" clean --dry-run diff --git a/integrations/raycast/mole-clean.sh b/integrations/raycast/mole-clean.sh new file mode 100755 index 0000000..7ee0261 --- /dev/null +++ b/integrations/raycast/mole-clean.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Clean Mac +# @raycast.mode fullOutput +# @raycast.packageName Mole + +# Optional parameters: +# @raycast.icon 🐹 +# @raycast.needsConfirmation true + +# Documentation: +# @raycast.description Deep clean your Mac using Mole +# @raycast.author tw93 +# @raycast.authorURL https://github.com/tw93/Mole + +# Detect mo/mole installation +if command -v mo >/dev/null 2>&1; then + MO_BIN="mo" +elif command -v mole >/dev/null 2>&1; then + MO_BIN="mole" +else + echo "❌ Mole not found. Install from:" + echo " https://github.com/tw93/Mole" + exit 1 +fi + +# Run cleanup +echo "🐹 Starting cleanup..." +echo "" +"$MO_BIN" clean diff --git a/integrations/raycast/mole-uninstall.sh b/integrations/raycast/mole-uninstall.sh new file mode 100755 index 0000000..8ae9b37 --- /dev/null +++ b/integrations/raycast/mole-uninstall.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Uninstall Apps +# @raycast.mode fullOutput +# @raycast.packageName Mole + +# Optional parameters: +# @raycast.icon 🗑️ +# @raycast.needsConfirmation true + +# Documentation: +# @raycast.description Completely uninstall apps using Mole +# @raycast.author tw93 +# @raycast.authorURL https://github.com/tw93/Mole + +# Detect mo/mole installation +if command -v mo >/dev/null 2>&1; then + MO_BIN="mo" +elif command -v mole >/dev/null 2>&1; then + MO_BIN="mole" +else + echo "❌ Mole not found. Install from:" + echo " https://github.com/tw93/Mole" + exit 1 +fi + +# Run uninstall +echo "🗑️ Starting app uninstaller..." +echo "" +"$MO_BIN" uninstall diff --git a/integrations/setup-raycast.sh b/integrations/setup-raycast.sh new file mode 100755 index 0000000..07e67b6 --- /dev/null +++ b/integrations/setup-raycast.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# One-line Raycast integration installer +# Usage: curl -fsSL https://raw.githubusercontent.com/tw93/Mole/main/integrations/setup-raycast.sh | bash + +set -euo pipefail + +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' + +RAYCAST_DIR="$HOME/Library/Application Support/Raycast/script-commands" +BASE_URL="https://raw.githubusercontent.com/tw93/Mole/main/integrations/raycast" + +# Check Raycast +if [[ ! -d "$HOME/Library/Application Support/Raycast" ]]; then + echo -e "${YELLOW}Raycast not found. Install from: https://raycast.com${NC}" + exit 1 +fi + +echo "Installing Mole commands for Raycast..." +mkdir -p "$RAYCAST_DIR" + +# Download scripts +for script in mole-clean.sh mole-clean-dry-run.sh mole-uninstall.sh; do + curl -fsSL "$BASE_URL/$script" -o "$RAYCAST_DIR/$script" + chmod +x "$RAYCAST_DIR/$script" +done + +echo -e "${GREEN}✓${NC} Installed! Open Raycast and search: 'Reload Script Commands'" +echo "" +echo "Then search for: 'Clean Mac'"