跳到正文
DEV Community· THANO·· 4 小時前AI 評分61

ToSnip 如何把螢幕截圖交給 CLI 使用

Your CLI still can't see a screenshot. This fixes that.

AI 導讀

ToSnip 提供兩種把螢幕截圖交給 CLI 使用的方式:在 Windows 本機終端截圖後按 Ctrl+V,或透過 https://tosnip.com/web/ 上傳圖片並取得短連結,供另一部電腦上的 CLI 或 AI 開啟。

正文

THANO

You know the annoying bit. You snip the screen, the CLI says it can't see the clipboard, and now you're saving a file just so you can type the path back in.

ToSnip is the thing I point people to for that. Print Screen, or Win+Shift+S, then Ctrl+V. You don't name the file. You don't go hunting for it in Downloads.

Two ways, and both are the right one in a different case.

If the CLI is on another machine, or you're handing the picture to an AI, paste it on https://tosnip.com/web/. You get a short link like https://tosnip.com/v/a1b2c3. Open the link, it's the image. It dies after 5 minutes, which is what you want for a screenshot of your screen. No account. PNG, JPEG, GIF, and WebP. It shrinks the width to 1000 pixels so the file stays small enough to send.

If the CLI is already open on your own Windows PC, don't upload it. Install this once:


powershell
irm https://tosnip.com/install.ps1 | iex

Read the script first if you don't run random irm lines. It's here: https://github.com/tana360/tosnip/blob/main/public/install.ps1

Then click the terminal and press Ctrl+V. It types something like C:\ToSnip\a1b2c3.jpg. The CLI opens that file and sees the snip. The JPEG never leaves the PC, and it's deleted after 5 minutes.

That's the whole thing. The link when someone else has to open it. The path when the terminal is sitting right there.

https://tosnip.com https://github.com/tana360/tosnip

來源:DEV Community · dev.to