Skip to content
Open
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
40 changes: 40 additions & 0 deletions domain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Domain Check
# @raycast.mode silent

# Optional parameters:
# @raycast.icon 🌐
# @raycast.argument1 { "type": "text", "placeholder": "example.com" }
# @raycast.packageName Bolt

# Documentation:
# @raycast.description Check WHOIS, DNS, nameservers, and Bolt hosting status for a domain.
# @raycast.author Jorn

# --- Config ---
LOOKUP_URL="https://domain-lookup-bolt.jorn-968.workers.dev"

# --- Clean the input ---
DOMAIN="$1"

# Strip protocol, www., paths, query strings, trailing slashes, and whitespace
DOMAIN=$(echo "$DOMAIN" \
| tr -d '[:space:]' \
| sed -E 's|^https?://||' \
| sed -E 's|^www\.||' \
| sed -E 's|/.*$||' \
| sed -E 's|\?.*$||' \
| tr '[:upper:]' '[:lower:]')

if [ -z "$DOMAIN" ]; then
echo "No domain provided."
exit 1
fi

# URL-encode the domain (safe characters only - domains rarely need encoding)
ENCODED_DOMAIN=$(python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))" "$DOMAIN" 2>/dev/null || echo "$DOMAIN")

open "${LOOKUP_URL}/?domain=${ENCODED_DOMAIN}"