[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81872":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":12,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":13,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":14,"rankGlobal":10,"rankLanguage":10,"license":15,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":18,"hasPages":16,"topics":19,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":13,"starSnapshotCount":13,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},81872,"imgclip","alexyan0431\u002Fimgclip","alexyan0431"," A tiny cross-platform CLI for clipboard ↔ image files, with watch mode to auto-save every screenshot.","",null,"Rust",21,0,40,"MIT License",false,"main",true,[20,21,22,23],"cli-tool","clipboard","rust","screenshot","2026-06-12 04:01:35","[English](#english) | [中文](#中文)\n\n---\n\n\u003Ca id=\"english\">\u003C\u002Fa>\n\n# imgclip\n\n![GitHub Release](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002Falexyan0431\u002Fimgclip?include_prereleases)\n![License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Falexyan0431\u002Fimgclip)\n![Platform](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-Windows%20%7C%20Linux%20%7C%20macOS-blue)\n![Rust](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Frust-1.70%2B-orange)\n\n![imgclip demo](docs\u002Fdemo.gif)\n\n**Demo**\n\n```\n$ imgclip --watch\nimgclip: saved ~\u002FPictures\u002Fimgclip\u002Fimgclip-1746359527000-1.png\nimgclip: saved ~\u002FPictures\u002Fimgclip\u002Fimgclip-1746359595000-2.png\n```\n\n```\n$ imgclip --interactive\nimgclip: interactive mode — watching clipboard for changes\n         [s] save  [d] discard  [q] quit\nimgclip: new image (1920x1080)  [s]ave [d]iscard [q]uit? s\nimgclip: saved ~\u002FPictures\u002Fimgclip\u002Fimgclip-1746359722000-1.png\nimgclip: new image (800x600)  [s]ave [d]iscard [q]uit? d\nimgclip: discarded\n```\n\n**How it works**\n\n```\nCopy \u002F Screenshot ──▶ Clipboard ──▶ imgclip ──▶ File \u002F stdout \u002F data URI\n                                        │\n                        ┌───────────────┼───────────────┐\n                        │               │               │\n                     One-shot        Watch          Interactive\n                    (save once)   (auto-save)    (choose per image)\n```\n\nA minimal CLI tool to extract images from the clipboard and save them as files, pipe them to stdout, or convert them to data URIs. Also copies image files **to** the clipboard. Supports a **watch mode** that automatically saves new clipboard images, and an **interactive mode** that lets you selectively save or discard each one.\n\n## Features\n\n- **Zero-config auto-start** — `imgclip --install` sets up login auto-start; clipboard images are saved automatically on every session.\n- **Single binary, zero runtime deps** — Static release build, no installer, no framework. Just drop it in your PATH.\n- **Four modes in one tool** — One-shot capture, continuous watch, interactive selective save, and file-to-clipboard copy.\n- **Flexible output** — Write to file, pipe to stdout, generate a `data:image\u002F...` URI, or create a temp file and print the path.\n- **Cross-platform** — First-class support for Windows, Linux, and macOS (x86_64 + ARM).\n- **Pipeline-friendly** — stdout mode and `--temp` make it easy to chain with `curl`, shell scripts, or any Unix pipeline.\n\n## Why imgclip?\n\n| Scenario | Other tools | imgclip |\n|----------|-------------|---------|\n| Screenshot tools (ShareX, Snipaste) | Need a GUI; heavy for quick capture | CLI-native, runs anywhere including SSH \u002F headless |\n| `xclip` \u002F `pbcopy` | General-purpose, no image watch or auto-save | Purpose-built for clipboard images with `--watch` mode |\n| Custom shell scripts | You maintain edge cases across platforms | Cross-platform, tested on CI (Windows, Linux, macOS) |\n\n## Install\n\n**Option 1: Download a prebuilt binary** (recommended)\n\n1. Open the [Releases page](https:\u002F\u002Fgithub.com\u002Falexyan0431\u002Fimgclip\u002Freleases), pick the latest release, and download an asset from **Assets** (`imgclip-\u003Ctarget>.zip` on Windows, `.tar.gz` elsewhere).\n2. Choose **`\u003Ctarget>`** for your OS\u002FCPU—e.g. `x86_64-pc-windows-msvc`, `x86_64-unknown-linux-gnu`, or `x86_64-apple-darwin` (most PCs and Intel Macs); `aarch64-pc-windows-msvc`, `aarch64-unknown-linux-gnu`, or `aarch64-apple-darwin` for ARM Windows, ARM Linux, or Apple Silicon Macs.\n3. Extract to get `imgclip.exe` or `imgclip`; on Linux\u002FmacOS run `chmod +x imgclip` if the file is not executable.\n4. Run it with the full path to the binary, or add its folder to `PATH` if you want to type `imgclip` from any terminal.\n5. Run `imgclip --version` or `--help` to verify; if Windows SmartScreen or macOS Gatekeeper blocks it, unblock in **Properties** or allow under **Privacy & Security** (macOS: `xattr -dr com.apple.quarantine path\u002Fto\u002Fimgclip` if needed).\n\n**Option 2: Build from source**\n\n**Prerequisites:** [Rust](https:\u002F\u002Frustup.rs\u002F) (1.70+)\n\n```bash\ncargo install --git https:\u002F\u002Fgithub.com\u002Falexyan0431\u002Fimgclip.git\n```\n\nOr build manually:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Falexyan0431\u002Fimgclip.git\ncd imgclip\ncargo build --release\n```\n\nThe binary will be at `target\u002Frelease\u002Fimgclip`. Copy it somewhere in your `$PATH`.\n\n**Windows users:** If you encounter clipboard errors, make sure the terminal session has clipboard access permissions.\n\n## Uninstall\n\n- **`cargo install`:** run `cargo uninstall imgclip`.\n- **Prebuilt zip\u002Fbinary or manual copy:** delete the executable (find it with `which imgclip` on Unix or `where imgclip` on Windows).\n- **`--install` auto-start:** run `imgclip --uninstall` first to remove the login startup entry, then remove the binary using either bullet above.\n\n## Quick Start\n\n```bash\n# One-time setup: install auto-start (watches clipboard on every login)\nimgclip --install\n```\n\nThat's it. After restarting (or logging in), any image you copy or screenshot will be automatically saved to `~\u002FPictures\u002Fimgclip\u002F` (or `%USERPROFILE%\\Pictures\\imgclip\\` on Windows).\n\nTo remove auto-start later: `imgclip --uninstall`. To remove imgclip entirely, see [Uninstall](#uninstall).\n\n## Usage\n\n### Watch Mode (Recommended)\n\n```bash\n# Start watching (saves to ~\u002FPictures\u002Fimgclip\u002F by default)\nimgclip --watch\n\n# Watch with JPEG output\nimgclip --watch -f jpeg -q 90\n\n# Watch with custom directory and poll interval\nimgclip --watch --dir ~\u002Fscreenshots --interval 200\n\n# Run silently in the background\nimgclip --watch --quiet\n```\n\n### One-Shot Mode\n\n```bash\n# Copy an image (screenshot, browser image, etc.), then:\n\n# Save to a file\nimgclip -o screenshot.png\n\n# Save as JPEG with quality 90\nimgclip -o photo.jpg -f jpeg -q 90\n\n# Pipe to another command (default outputs PNG to stdout)\nimgclip | some-command\n\n# Get a data URI (useful for HTML\u002FCSS embedding)\nimgclip --data-uri\n\n# Write to a temp file and print the path\nimgclip --temp\n\n# Suppress info messages\nimgclip -o out.png --quiet\n```\n\n### Interactive Mode\n\n```bash\n# Watch clipboard and prompt for each new image: [s]ave \u002F [d]iscard \u002F [q]uit\nimgclip --interactive\n\n# Interactive with JPEG output\nimgclip --interactive -f jpeg -q 90\n\n# Custom save directory\nimgclip --interactive --dir ~\u002Fscreenshots\n```\n\n### Copy File to Clipboard\n\n```bash\n# Copy an image file to the clipboard (supports PNG, JPEG, BMP, WebP, etc.)\nimgclip --copy photo.png\nimgclip --copy screenshot.jpg\n```\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `--watch` | Watch clipboard, auto-save new images |\n| `--interactive` | Watch clipboard, prompt to save or discard each image |\n| `--copy \u003CFILE>` | Copy image file to the clipboard |\n| `--install` | Install auto-start (runs `--watch` on login) |\n| `--uninstall` | Remove auto-start |\n| `-o, --output \u003CPATH>` | Write image to the specified file |\n| `-f, --format \u003CFORMAT>` | Output format: `png` (default), `jpeg`\u002F`jpg` |\n| `-q, --quality \u003C1-100>` | JPEG quality (default: 85) |\n| `--data-uri` | Output as `data:image\u002F...;base64,...` string |\n| `--temp` | Write to a temp file, print the path to stdout |\n| `--dir \u003CPATH>` | Save directory for `--watch`\u002F`--interactive` (default: ~\u002FPictures\u002Fimgclip) |\n| `--interval \u003CMS>` | Poll interval in ms for `--watch`\u002F`--interactive` (default: 500) |\n| `--quiet` | Suppress informational messages |\n| `-h, --help` | Print help |\n| `-V, --version` | Print version |\n\n## Examples\n\n```bash\n# Quick screenshot → clipboard → file\nimgclip -o shot.png\n\n# Embed image in HTML\necho \"\u003Cimg src=\\\"$(imgclip --data-uri)\\\" \u002F>\"\n\n# Convert clipboard image to JPEG and pipe to curl\nimgclip -f jpeg -q 80 | curl -T - https:\u002F\u002Fupload.example.com\n\n# Use in a script to auto-save screenshots\nimgclip --temp --quiet | xargs -I{} mv {} ~\u002Fscreenshots\u002F\n\n# Copy a file to clipboard, then paste into Slack\u002FDocs\nimgclip --copy diagram.png\n\n# Selective capture: only save the screenshots you want\nimgclip --interactive --dir ~\u002Fscreenshots\n```\n\n## Community\n\n- [linux.do](https:\u002F\u002Flinux.do) — Linux & Open Source Community\n\n## License\n\n[MIT](LICENSE)\n\n---\n\n\u003Ca id=\"中文\">\u003C\u002Fa>\n\n# imgclip\n\n![GitHub Release](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002Falexyan0431\u002Fimgclip?include_prereleases)\n![License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Falexyan0431\u002Fimgclip)\n![Platform](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-Windows%20%7C%20Linux%20%7C%20macOS-blue)\n![Rust](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Frust-1.70%2B-orange)\n\n![imgclip 演示](docs\u002Fdemo.gif)\n\n**演示**\n\n```\n$ imgclip --watch\nimgclip: saved ~\u002FPictures\u002Fimgclip\u002Fimgclip-1746359527000-1.png\nimgclip: saved ~\u002FPictures\u002Fimgclip\u002Fimgclip-1746359595000-2.png\n```\n\n```\n$ imgclip --interactive\nimgclip: interactive mode — watching clipboard for changes\n         [s] save  [d] discard  [q] quit\nimgclip: new image (1920x1080)  [s]ave [d]iscard [q]uit? s\nimgclip: saved ~\u002FPictures\u002Fimgclip\u002Fimgclip-1746359722000-1.png\nimgclip: new image (800x600)  [s]ave [d]iscard [q]uit? d\nimgclip: discarded\n```\n\n**工作原理**\n\n```\n复制 \u002F 截图 ──▶ 剪贴板 ──▶ imgclip ──▶ 文件 \u002F stdout \u002F data URI\n                                │\n                ┌───────────────┼───────────────┐\n                │               │               │\n             单次模式        监听模式        交互模式\n           (保存一次)     (自动保存)    (逐张选择保存)\n```\n\n一个轻量级命令行工具，从剪贴板提取图片并保存为文件、输出到 stdout 或转换为 data URI。也支持将图片文件复制**到**剪贴板。支持**监听模式**自动保存新图片，以及**交互模式**让你逐张选择保存或丢弃。\n\n## 功能特性\n\n- **零配置开机自启** — `imgclip --install` 一键设置登录自启，每次开机自动保存剪贴板图片。\n- **单文件、零依赖** — 静态编译的 release 产物，无需安装器、无运行时框架，放入 PATH 即可使用。\n- **四种模式合一** — 单次捕获、持续监听、交互式选择性保存、文件到剪贴板复制。\n- **灵活输出** — 写入文件、管道输出到 stdout、生成 `data:image\u002F...` URI、创建临时文件并打印路径。\n- **跨平台** — 原生支持 Windows、Linux、macOS（x86_64 + ARM）。\n- **管道友好** — stdout 模式和 `--temp` 可轻松与 `curl`、Shell 脚本或任何 Unix 管道串联。\n\n## 为什么选择 imgclip？\n\n| 场景 | 其他工具 | imgclip |\n|------|----------|---------|\n| 截图工具（ShareX、Snipaste） | 需要图形界面，快速截图偏重 | CLI 原生，可在 SSH \u002F 无头环境中运行 |\n| `xclip` \u002F `pbcopy` | 通用剪贴板工具，无图片监听和自动保存 | 专为剪贴板图片设计，内置 `--watch` 模式 |\n| 自写 Shell 脚本 | 需自行维护跨平台兼容与边界情况 | 跨平台、CI 测试（Windows、Linux、macOS） |\n\n## 安装\n\n**方式一：下载预编译二进制**（推荐）\n\n1. 打开 [Releases 页面](https:\u002F\u002Fgithub.com\u002Falexyan0431\u002Fimgclip\u002Freleases)，选择最新版本，在 **Assets** 中下载对应压缩包（Windows 为 `imgclip-\u003Ctarget>.zip`，其余平台为 `.tar.gz`）。\n2. 按系统与 CPU 选择 **`\u003Ctarget>`**—常见 PC 与 Intel Mac 用 `x86_64-pc-windows-msvc`、`x86_64-unknown-linux-gnu` 或 `x86_64-apple-darwin`；ARM Windows、ARM Linux 或 Apple Silicon Mac 用 `aarch64-pc-windows-msvc`、`aarch64-unknown-linux-gnu` 或 `aarch64-apple-darwin`。\n3. 解压得到 `imgclip.exe` 或 `imgclip`；若 Linux\u002FmacOS 上无法执行，可执行 `chmod +x imgclip`。\n4. 使用可执行文件的**完整路径**运行，或将所在文件夹加入 **PATH** 以便在终端任意目录输入 `imgclip`。\n5. 执行 `imgclip --version` 或 `--help` 自检；若遇 Windows SmartScreen 或 macOS 安全拦截，在 **属性** 中解除锁定或在 **隐私与安全性** 中允许（macOS 可用 `xattr -dr com.apple.quarantine path\u002Fto\u002Fimgclip`）。\n\n**方式二：从源码构建**\n\n**前置条件：** [Rust](https:\u002F\u002Frustup.rs\u002F) (1.70+)\n\n```bash\ncargo install --git https:\u002F\u002Fgithub.com\u002Falexyan0431\u002Fimgclip.git\n```\n\n或手动构建：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Falexyan0431\u002Fimgclip.git\ncd imgclip\ncargo build --release\n```\n\n编译产物在 `target\u002Frelease\u002Fimgclip`，将其复制到 `$PATH` 中的目录。\n\n**Windows 用户：** 如遇剪贴板错误，请确认终端会话拥有剪贴板访问权限。\n\n## 卸载\n\n- **通过 `cargo install` 安装：** 执行 `cargo uninstall imgclip`。\n- **下载的压缩包或手动拷贝的二进制：** 删除该可执行文件（Unix 可用 `which imgclip`，Windows 可用 `where imgclip` 查看路径）。\n- **曾执行过 `--install`：** 先运行 `imgclip --uninstall` 移除开机自启项，再按上两种方式之一删除程序本体。\n\n## 快速开始\n\n```bash\n# 一次性设置：安装开机自启（登录后自动监听剪贴板）\nimgclip --install\n```\n\n就这样。重启（或重新登录）后，你复制的任何图片或截图都会自动保存到 `~\u002FPictures\u002Fimgclip\u002F`（Windows 为 `%USERPROFILE%\\Pictures\\imgclip\\`）。\n\n如需移除自启：`imgclip --uninstall`。若要彻底卸载本工具，见上文 [卸载](#卸载)。\n\n## 使用\n\n### 监听模式（推荐）\n\n```bash\n# 开始监听（默认保存到 ~\u002FPictures\u002Fimgclip\u002F）\nimgclip --watch\n\n# 以 JPEG 格式监听\nimgclip --watch -f jpeg -q 90\n\n# 指定保存目录和轮询间隔\nimgclip --watch --dir ~\u002Fscreenshots --interval 200\n\n# 静默后台运行\nimgclip --watch --quiet\n```\n\n### 单次模式\n\n```bash\n# 先复制一张图片（截图、浏览器图片等），然后：\n\n# 保存到文件\nimgclip -o screenshot.png\n\n# 以质量 90 保存为 JPEG\nimgclip -o photo.jpg -f jpeg -q 90\n\n# 通过管道传递给其他命令（默认向 stdout 输出 PNG）\nimgclip | some-command\n\n# 获取 data URI（用于 HTML\u002FCSS 内嵌）\nimgclip --data-uri\n\n# 写入临时文件并打印路径\nimgclip --temp\n\n# 静默模式\nimgclip -o out.png --quiet\n```\n\n### 交互模式\n\n```bash\n# 监听剪贴板，检测到新图片时提示 [s]保存 \u002F [d]丢弃 \u002F [q]退出\nimgclip --interactive\n\n# 以 JPEG 格式交互保存\nimgclip --interactive -f jpeg -q 90\n\n# 自定义保存目录\nimgclip --interactive --dir ~\u002Fscreenshots\n```\n\n### 复制文件到剪贴板\n\n```bash\n# 将图片文件复制到剪贴板（支持 PNG、JPEG、BMP、WebP 等格式）\nimgclip --copy photo.png\nimgclip --copy screenshot.jpg\n```\n\n## 选项\n\n| 选项 | 说明 |\n|------|------|\n| `--watch` | 监听剪贴板，自动保存新图片 |\n| `--interactive` | 监听剪贴板，逐张选择保存或丢弃 |\n| `--copy \u003CFILE>` | 将图片文件复制到剪贴板 |\n| `--install` | 安装开机自启（登录时运行 `--watch`） |\n| `--uninstall` | 移除开机自启 |\n| `-o, --output \u003CPATH>` | 将图片保存到指定文件 |\n| `-f, --format \u003CFORMAT>` | 输出格式：`png`（默认）、`jpeg`\u002F`jpg` |\n| `-q, --quality \u003C1-100>` | JPEG 质量（默认 85） |\n| `--data-uri` | 输出为 `data:image\u002F...;base64,...` 字符串 |\n| `--temp` | 写入临时文件，将路径打印到 stdout |\n| `--dir \u003CPATH>` | `--watch`\u002F`--interactive` 保存目录（默认 ~\u002FPictures\u002Fimgclip） |\n| `--interval \u003CMS>` | `--watch`\u002F`--interactive` 轮询间隔（毫秒，默认 500） |\n| `--quiet` | 静默信息输出 |\n| `-h, --help` | 显示帮助 |\n| `-V, --version` | 显示版本 |\n\n## 示例\n\n```bash\n# 快速截图 → 剪贴板 → 文件\nimgclip -o shot.png\n\n# 在 HTML 中内嵌图片\necho \"\u003Cimg src=\\\"$(imgclip --data-uri)\\\" \u002F>\"\n\n# 将剪贴板图片转为 JPEG 并通过 curl 上传\nimgclip -f jpeg -q 80 | curl -T - https:\u002F\u002Fupload.example.com\n\n# 在脚本中自动保存截图\nimgclip --temp --quiet | xargs -I{} mv {} ~\u002Fscreenshots\u002F\n\n# 复制文件到剪贴板，然后粘贴到 Slack\u002F文档\nimgclip --copy diagram.png\n\n# 选择性截图：只保存想要的截图\nimgclip --interactive --dir ~\u002Fscreenshots\n```\n\n## 友链\n\n- [linux.do](https:\u002F\u002Flinux.do) — Linux 与开源技术社区\n\n## 许可证\n\n[MIT](LICENSE)\n","imgclip 是一个轻量级的跨平台命令行工具，用于在剪贴板与图像文件之间进行转换，并支持自动保存截图。它使用 Rust 语言编写，具备零配置自动启动、单个二进制文件无运行时依赖的特点，支持一次性捕获、持续监视、交互式选择保存以及文件到剪贴板复制四种模式。该工具还提供了灵活的输出选项，可以将图像保存为文件、通过标准输出传递、生成数据 URI 或创建临时文件并打印路径。imgclip 适用于需要快速处理剪贴板中的图像或自动化保存截图的各种场景，特别适合开发者在 SSH 或无头环境中使用。",2,"2026-06-11 04:07:01","CREATED_QUERY"]