diff --git a/README.md b/README.md index 852cd86..d29c4da 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,13 @@ **Upload images to the blue sky** ☁️ -A fast CLI tool for uploading images to your AT Protocol PDS and getting instant CDN URLs through [images.blue](https://tangled.sh/@evan.jarrett.net/imgs.blue). +A fast CLI tool for uploading images to your AT Protocol PDS and getting instant CDN URLs through [imgs.blue](https://imgs.blue). ## Features - 📤 Upload images directly to your Bluesky/AT Protocol PDS -- 🔗 Get instant CDN URLs from images.blue +- 📸 Take screenshots and upload instantly with `blup capture` +- 🔗 Get instant CDN URLs from imgs.blue - 📋 Automatic URL copying to clipboard - 🎨 Supports JPEG, PNG, WebP, GIF formats - 🔐 Secure OAuth authentication @@ -23,41 +24,49 @@ go install tangled.sh/evan.jarrett.net/blup/cmd/blup@latest ## Quick Start ```bash -# 2. Authenticate -blup auth +# Authenticate +blup login -# 3. Upload an image +# Upload an image blup upload cat.jpg + +# Or take a screenshot and upload it +blup capture ``` ## Commands -### ```blup auth``` -Authenticate with your AT Protocol account via OAuth +### ```blup login``` +Authenticate with your AT Protocol account via OAuth. You can optionally pass `--handle` to skip the prompt. ### ```blup upload [file]``` Upload an image and get the CDN URL ```bash $ blup upload avatar.png -🚀 Uploading to alice.bsky.social... -✅ Upload complete! +https://imgs.blue/alice.bsky.social/1TpTNotr6YUww6cD6SLyWi2A2uFkH1lVEnqMXvwdjrwkAU4k +``` -📋 CDN URL (copied to clipboard): -https://images.blue/alice.bsky.social/1TpTNotr6YUww6cD6SLyWi2A2uFkH1lVEnqMXvwdjrwkAU4k +### ```blup capture``` +Take a screenshot using your desktop's screenshot dialog, upload it, and copy the URL to clipboard +```bash +$ blup capture +Opening screenshot dialog... +https://imgs.blue/alice.bsky.social/2XyZAbc123... ``` ### ```blup status``` Check your current authentication status ```bash $ blup status -✅ Authenticated as alice.bsky.social - PDS: https://bsky.social +Authenticated: Yes +Account: did:plc:abc123... +PDS: https://bsky.social ``` ### ```blup logout``` Remove stored credentials ```bash $ blup logout -✅ Logged out successfully +Logged out successfully ``` ## Usage Examples @@ -66,8 +75,8 @@ $ blup logout # Upload a profile picture blup upload profile.jpg -# Upload a screenshot -blup upload screenshot.png +# Take a screenshot and upload it +blup capture # The URL is automatically copied to your clipboard! # Just paste directly into your blog, documentation, or chat @@ -77,22 +86,23 @@ blup upload screenshot.png blup uses OAuth for secure authentication: -1. Run ```blup auth``` to authenticate +1. Run ```blup login``` to authenticate 2. Your browser will open for authorization 3. You're ready to upload! ## Building from source ```bash -git clone https://github.com/yourusername/blup.git +git clone https://tangled.sh/evan.jarrett.net/blup cd blup -go build -o blup cmd/blup/main.go +go build -o blup ./cmd/blup ``` ## Why blup? - **Dead simple** - Authenticate once, upload with a single command -- **Instant CDN URLs** - Powered by the global images.blue CDN +- **Screenshot to URL** - Capture and share screenshots instantly +- **Instant CDN URLs** - Powered by the global imgs.blue CDN - **Clipboard ready** - URL copied automatically, just paste and go - **Lightweight** - Single binary, no dependencies diff --git a/internal/auth/storage.go b/internal/auth/storage.go index 3cfdd30..fc88bb3 100644 --- a/internal/auth/storage.go +++ b/internal/auth/storage.go @@ -11,12 +11,12 @@ import ( ) const ( - keyringService = "blup" - currentSessionKey = "current-session" - sessionKeyPrefix = "session:" - authRequestPrefix = "auth-request:" - pendingAuthStateKey = "pending-auth-state" - loginIdentifierKey = "login-identifier" + keyringService = "blup" + currentSessionKey = "current-session" + sessionKeyPrefix = "session:" + authRequestPrefix = "auth-request:" + pendingAuthStateKey = "pending-auth-state" + loginIdentifierKey = "login-identifier" ) // KeyringAuthStore implements oauth.ClientAuthStore using the system keyring diff --git a/internal/schemas/image.go b/internal/schemas/image.go deleted file mode 100644 index ab538d1..0000000 --- a/internal/schemas/image.go +++ /dev/null @@ -1,16 +0,0 @@ -package schemas - -import ( - lexutil "github.com/bluesky-social/indigo/lex/util" -) - -type blupImage struct { - LexiconTypeID string `json:"$type" cborgen:"$type"` - Blob *lexutil.LexBlob `json:"blob" cborgen:"blob"` - CreatedAt string `json:"createdAt" cborgen:"createdAt"` - ExpiresAt string `json:"expiresAt" cborgen:"expiresAt"` - Filename string `json:"filename" cborgen:"filename"` - ContentType string `json:"contentType" cborgen:"contentType"` - Size int `json:"size" cborgen:"size"` - Metadata map[string]interface{} `json:"metadata,omitempty" cborgen:"metadata,omitempty"` -} diff --git a/lexgen-build.json b/lexgen-build.json new file mode 100644 index 0000000..0ed47f8 --- /dev/null +++ b/lexgen-build.json @@ -0,0 +1,8 @@ +[ + { + "package": "lexicon", + "prefix": "blue.imgs.blup", + "outdir": "./internal/lexicon", + "import": "tangled.sh/evan.jarrett.net/blup/internal/lexicon" + } +]