diff --git a/README.md b/README.md index fe74da0..0073386 100644 --- a/README.md +++ b/README.md @@ -2,23 +2,31 @@ English | [中文](./README_CN.md) -**The missing safety layer for Claude Code, Cowork, OpenCode and all AI Agents - Your "regret pill" for AI-assisted development.** +**An Undo Button for AI on Your Local Computer** + +Nowadays, more and more people use Cowork & Claude Code to manipulate files locally. +It’s powerful — but when AI goes crazy, your workspace can be permanently messed up. + +One weekend, after playing football and heading home, an idea suddenly hit me. +I spent the whole weekend hacking together **AgentShield** — a safety shield for AI-driven agent. + +AgentShield protects your workspace in real time. When things go wrong, you can rollback everything with one click. Think of it as a **regret pill for AI.** -A workspace history version management tool that protects your workspace from unintended AI Agent modifications. ![demo](./desktop/demo.png) -## ✨ Features +### What AgentShield Does -- **⚡ Zero-Copy Backups** - Uses hardlinks for instant, space-efficient backups -- **🕵️ Real-time Protection** - Watches your workspace and automatically backs up files before changes -- **📦 Smart Exclusions** - Automatically ignores `.git`, `node_modules`, build artifacts, etc. -- **🔒 Atomic Exec Mode** - Snapshot entire workspace before running agent commands -- **⏮️ Easy Restore** - One command to roll back any file to its original state +- 🛡 Real-time file monitoring & snapshot +- ⏪ One-click rollback when AI messes things up +- 💻 Desktop app + CLI, zero-copy, low disk overhead -## 🚀 Installation +### How It Works (No Coding Required) -### Desktop Version +1. Download the desktop app [Download here](https://github.com/tomsun28/agentshield/releases) +2. Select your workspace folder and protect it +3. Let AI work freely +4. If disaster happens → Click **Rollback** Download the corresponding platform installation package from the [Releases](https://github.com/tomsun28/agentshield/releases) page and extract it to install (supports Windows, macOS, Linux). @@ -33,7 +41,14 @@ For MacOS if you see “AgentShield.app is damaged and can’t be opened”, run sudo xattr -rd com.apple.quarantine /Applications/AgentShield.app ``` -### CLI Version +### Who Is This For? + +- Cowork, Claude Code, OpenCode, Eigent and others AI Agent users +- Designers & writers using AI locally +- Non-technical users automating workflows +- Developers running multiple agents 24/7 + +### And CLI Version **Via npm installation** @@ -49,63 +64,6 @@ curl -fsSL https://github.com/tomsun28/agentshield/raw/main/install.sh | bash Or download the executable binary for your platform from the [Releases](https://github.com/tomsun28/agentshield/releases) page (supports Windows, macOS, Linux). -- `shield_cli_darwin_arm64` (macOS arm64) -- `shield_cli_darwin_x64` (macOS x64) -- `shield_cli_linux_arm64` (Linux arm64) -- `shield_cli_linux_x64` (Linux x64) -- `shield_cli_win_x64.exe` (Windows x64) - -## 📖 Usage - - -### Watch Mode (Workspace Real-time Protection) - -> Support background daemon mode `shield start` and foreground mode `shield watch`, choose one. - -```bash -# Start background watch (recommended) -shield start - -# Start background watch for specific directory -shield start ./my-project - -# Watch current directory (foreground) -shield watch - -# Watch specific directory (foreground) -shield watch ./my-project - -# Stop background process -shield stop -shield stop ./my-project - -# Check status -shield status -``` - -### Restore Files - -```bash -# List all changes and snapshot points -shield list - -# Restore a specific snapshot by ID or timestamp -shield restore -``` - -### Status and Cleanup - -```bash -# Show backup statistics and daemon status -shield status - -# Remove backups older than 7 days (default) -shield clean - -# Remove backups older than 3 days -shield clean --days=3 -``` - ## 🤝 Contributing Issues and Pull Requests are very welcome! diff --git a/README_CN.md b/README_CN.md index fdf8dbd..8b326e7 100644 --- a/README_CN.md +++ b/README_CN.md @@ -2,23 +2,30 @@ [English](./README.md) | 中文 -**给 Claude Code, Cowork, OpenCode, Eigent 等所有 AI Agent 套上一层盾牌 - 让你拥有"后悔药"。** +**给 AI 操作本地电脑加一颗"后悔药"** -一个工作区历史版本管理工具,保护你的工作区免受 AI Agent 意外修改。 +现在越来越多的人使用 Cowork 和 Claude Code 在本地操作文件。 +这很强大 — 但当 AI 发疯时,你的工作区可能会被永久搞乱。 + +一个周末,踢完足球回家后,我突然有了一个想法。 +我花了整个周末时间编写了 **AgentShield** — 一个为 AI 驱动的代理提供的安全护盾。 + +AgentShield 实时保护你的工作区。当出现问题时,你可以一键回滚所有内容。可以把它想象成 **AI 的后悔药**。 ![demo](./desktop/demo.png) -## ✨ 核心特性 +### AgentShield 的功能 -- **⚡ 零拷贝备份** - 使用硬链接实现即时、节省空间的备份 -- **🕵️ 实时保护** - 监控工作区并在文件被修改前自动备份 -- **📦 智能排除** - 自动忽略 `.git`、`node_modules`、构建产物等 -- **🔒 原子执行模式** - 支持在运行代理命令前对整个工作区进行快照 -- **⏮️ 轻松恢复** - 一个命令即可将任何文件回滚到原始状态 +- 🛡 实时文件监控和快照 +- ⏪ 当 AI 搞砸时一键回滚 +- � 桌面应用 + CLI,零拷贝,低磁盘开销 -## 🚀 安装 +### 使用方法(无需编码) -### 桌面版 +1. 下载桌面应用 [点击下载](https://github.com/tomsun28/agentshield/releases) +2. 选择你的工作区文件夹并保护它 +3. 让 AI 自由工作 +4. 如果发生灾难 → 点击 **回滚** 从 [Releases](https://github.com/tomsun28/agentshield/releases) 页面下载对应平台的安装包解压安装即可(支持 Windows, macOS, Linux)。 @@ -28,12 +35,19 @@ - `shield_desktop_linux_x64.tar.gz` (Linux x64) - `shield_desktop_win_x64.exe` (Windows x64) -MacOS 用户若遇到安装包已损坏等提示,可在终端运行以下命令解决: +MacOS 用户若遇到"AgentShield.app 已损坏且无法打开"的提示,可在终端运行以下命令: ``` sudo xattr -rd com.apple.quarantine /Applications/AgentShield.app ``` -### CLI 版 +### 适用人群 + +- Cowork、Claude Code、OpenCode、Eigent 等 AI Agent 用户 +- 在本地使用 AI 的设计师和作家 +- 自动化工作流的非技术用户 +- 24/7 运行多个代理的开发者 + +### 还有 CLI 版本 **通过 npm 安装** @@ -47,63 +61,7 @@ npm install -g agentshield curl -fsSL https://github.com/tomsun28/agentshield/raw/main/install.sh | bash ``` -或者从 [Releases](https://github.com/tomsun28/agentshield/releases) 页面下载对应平台的二进制可执行文件(支持 Windows, macOS, Linux)。 - -- `shield_cli_darwin_arm64` (macOS arm64) -- `shield_cli_darwin_x64` (macOS x64) -- `shield_cli_linux_arm64` (Linux arm64) -- `shield_cli_linux_x64` (Linux x64) -- `shield_cli_win_x64.exe` (Windows x64) - -## 📖 使用方法 - -### Watch 模式 (工作区实时保护) - -> 支持后台守护进程模式 `shield start` 和前台模式 `shield watch`,选择其一即可. - -```bash -# 监控当前目录 (后台模式) -shield start - -# 监控指定目录 (后台模式) -shield start ./my-project - -# 监控当前目录(前台模式) -shield watch - -# 监控指定目录(前台模式) -shield watch ./my-project - -# 停止后台进程 -shield stop -shield stop ./my-project - -# 检查状态 -shield status -``` - -### 恢复文件 - -```bash -# 列出所有变更及快照点 -shield list - -# 恢复文件到特定快照点 -shield restore -``` - -### 状态和清理 - -```bash -# 显示备份统计和守护进程状态 -shield status - -# 删除7天前的备份(默认) -shield clean - -# 删除3天前的备份 -shield clean --days=3 -``` +或者从 [Releases](https://github.com/tomsun28/agentshield/releases) 页面下载对应平台的可执行二进制文件(支持 Windows, macOS, Linux)。 ## 🤝 贡献