Skip to content

feat(cli): --cloud flag renders through OpenScreenShot Cloud - #19

Merged
PGHQdev merged 2 commits into
mainfrom
devin/1792279978-cli-cloud-flag
Oct 17, 2026
Merged

PGHQdev merged 2 commits into
mainfrom
devin/1792279978-cli-cloud-flag

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a --cloud flag to openscreenshot shot plus an auth login/logout flow so the CLI can render through OpenScreenShot Cloud's public API instead of driving a local Chrome — useful on machines/CI without a browser. Cloud is reached only over its public HTTP API per AGENTS.md.

openscreenshot auth login --email you@x.com            # sends the email code
openscreenshot auth login --email you@x.com --code 123456   # verifies, mints + stores a key
openscreenshot shot https://example.com --cloud --out shot.png
openscreenshot shot https://example.com --cloud --format pdf --key osc_live_…
  • New captureCloud() in mcp/src/cli.ts: POST {base}/v1/screenshot with Authorization: Bearer <key>; --format selects png/jpeg/webp/pdf/html/markdown and the default output filename gets the right extension.
  • Key resolution order: --key → OPENSCREENSHOT_API_KEY → key stored by auth login (~/.openscreenshot.json, mode 0600). Base URL: --cloud <url> or OPENSCREENSHOT_CLOUD_URL (default https://cloud.openscreenshot.app).
  • auth login is a two-step email-code flow against the cloud web app: POST /api/auth/email-otp/send-verification-otp, then POST /api/auth/sign-in/email-otp + POST /api/cli-key (new endpoint in the companion openscreenshot-cloud PR) which returns a one-time osc_live_ plaintext that gets stored.
  • Non-2xx surfaces the API problem message (error.message/error.code), e.g. cloud render failed: over quota. Bare --cloud doesn't swallow the next flag as a base URL.
  • Tests: bearer+body shape, missing-key failure before fetch, problem-code error, auth two-step. The one failing test on this box (shot writes a png file) needs a real Chrome — fails identically on clean main, unrelated.

Local capture is unchanged when --cloud is absent.

Link to Devin session: https://app.devin.ai/sessions/4206df0ee04f4da7a00a9a1b42c2c8cf
Open in Devin Desktop: https://app.devin.ai/desktop/session/4206df0ee04f4da7a00a9a1b42c2c8cf?variant=devin
Requested by: @PGHQdev

Co-Authored-By: padmanabh <pghqdev@proton.me>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

…key for --cloud

Co-Authored-By: padmanabh <pghqdev@proton.me>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
openscreenshot a7e7fa6 Commit Preview URL

Branch Preview URL
Oct 17 2026, 11:34 PM

@PGHQdev
PGHQdev merged commit 4c98b47 into main Oct 17, 2026
4 checks passed
@PGHQdev
PGHQdev deleted the devin/1792279978-cli-cloud-flag branch October 20, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant