{"id":40235351,"url":"https://github.com/snomiao/agent-yes","last_synced_at":"2026-07-02T04:01:12.185Z","repository":{"id":303206748,"uuid":"1013972687","full_name":"snomiao/agent-yes","owner":"snomiao","description":"Run AI coding agents (Claude, Codex, Gemini …) unattended — auto-answer prompts, auto-retry on rate limits, and list/tail/steer every agent locally or from agent-yes.com","archived":false,"fork":false,"pushed_at":"2026-06-29T11:29:33.000Z","size":2741,"stargazers_count":26,"open_issues_count":1,"forks_count":11,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-29T12:26:02.618Z","etag":null,"topics":["agentic","ai-agents","automation","claude-code","cli","codex","llm","tui"],"latest_commit_sha":null,"homepage":"https://agent-yes.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snomiao.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-07-04T19:47:35.000Z","updated_at":"2026-06-29T11:29:35.000Z","dependencies_parsed_at":"2026-03-01T01:05:23.542Z","dependency_job_id":null,"html_url":"https://github.com/snomiao/agent-yes","commit_stats":null,"previous_names":["snomiao/yes-claude","snomiao/claude-yes","snomiao/auto-claude","snomiao/agent-yes"],"tags_count":281,"template":false,"template_full_name":null,"purl":"pkg:github/snomiao/agent-yes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snomiao%2Fagent-yes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snomiao%2Fagent-yes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snomiao%2Fagent-yes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snomiao%2Fagent-yes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snomiao","download_url":"https://codeload.github.com/snomiao/agent-yes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snomiao%2Fagent-yes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35032145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic","ai-agents","automation","claude-code","cli","codex","llm","tui"],"created_at":"2026-01-19T23:05:59.892Z","updated_at":"2026-07-02T04:01:12.178Z","avatar_url":"https://github.com/snomiao.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agent-Yes! for Claude/Codex/Gemini/Cursor/Copilot/Qwen/Auggie\n\nA wrapper tool that automates interactions with various AI CLI tools by automatically handling common prompts and responses. Originally designed for Claude CLI, now supports multiple AI coding assistants. Rewritten in Rust for improved performance and reliability.\n\n⚠️ **Important Security Warning**: Only run this on trusted repositories. This tool automatically responds to prompts and can execute commands without user confirmation. Be aware of potential prompt injection attacks where malicious code or instructions could be embedded in files or user inputs to manipulate the automated responses.\n\n## Install\n\nOne-liner (installs Bun if needed, then the `ay` / `cy` / `claude-yes` … CLIs):\n\n```bash\n# macOS / Linux\ncurl -fsSL https://agent-yes.com/setup.sh | sh\n```\n\n```powershell\n# Windows (works in both PowerShell and cmd)\npowershell -c \"irm https://agent-yes.com/setup.ps1 | iex\"\n```\n\nOr with a package manager you already have:\n\n```bash\nbun add -g agent-yes      # or: npm install -g agent-yes\n```\n\nThen: `ay claude` (run an agent with auto-yes) · `ay serve --share` (web console + shareable link) · live console at https://agent-yes.com\n\n## Features\n\n- **Multi-CLI Support**: Works with Claude, Gemini, Codex, Copilot, and Cursor CLI tools\n- **Auto-Response**: Automatically responds to common prompts like \"Yes, proceed\" and \"Yes\"\n- **Continuous Operation**: Keeps the AI assistant running until your task is done, waiting for your next prompt\n- **Interactive Control**: You can still queue more prompts or cancel executing tasks with `ESC` or `Ctrl+C`\n- **Crash Recovery**: Automatically restarts crashed processes (where supported)\n- **Idle Detection**: Optional auto-exit when the AI becomes idle\n- **Named Pipe Input (Linux)**: On Linux systems, automatically creates a FIFO (named pipe) at `/tmp/agent-yes-YYYYMMDDHHMMSSXXX.stdin` for additional input streams\n- **Isolated Processes**: Each `ay \u003ccli\u003e` is an independent wrapper — no central daemon owns the agents. They coordinate through files (`pids.jsonl` index, per-pid FIFO for stdin, per-cwd `.raw.log` for output), so one process crashing (even `ay serve`) never takes down the others. See [docs/architecture.md](docs/architecture.md#process-model--ipc).\n\n## Agent Clis\n\nInstall the AI CLI tool(s) you want to use:\n\n### Claude\n\n```bash\nnpm install -g @anthropic-ai/claude-code\n```\n\nLearn more: https://www.anthropic.com/claude-code\n\n### Gemini\n\n```bash\n# Install Gemini CLI (if available)\n# Check Google's documentation for installation instructions\n```\n\n### Codex\n\n```bash\n# Install Codex CLI (if available)\n# Check Microsoft's documentation for installation instructions\n```\n\n### GitHub Copilot\n\n```bash\n# Install GitHub Copilot CLI\n# Check GitHub's documentation for installation instructions\n```\n\n### Cursor\n\n```bash\n# Install Cursor agent CLI\n# Check Cursor's documentation for installation instructions\n```\n\n### Grok\n\n```bash\nnpm install -g @vibe-kit/grok-cli\n```\n\nLearn more: https://github.com/vibe-kit/grok-cli\n\n### Auggie\n\n```bash\nnpm install -g @augmentcode-inc/auggie-cli\n```\n\nLearn more: https://www.augmentcode.com/\n\nThen install this project:\n\n```bash\nnpm install agent-yes -g\n```\n\n## Usage\n\n### Command Line Interface\n\n```bash\nclaude-yes [--exit-on-idle=60s] [tool-command] [prompts]\n```\n\n#### Examples\n\n**Claude (default):**\n\n```bash\nclaude-yes -- run all tests and commit current changes\nbunx claude-yes \"Solve TODO.md\"\n```\n\n**Other AI tools:**\n\n```bash\n# Use Codex directly\ncodex-yes -- refactor this function\n\n# Use Grok directly\ngrok-yes -- help me with this code\n\n# Use Copilot directly\ncopilot-yes -- generate unit tests\n\n# Use Cursor directly\ncursor-yes -- optimize performance\n\n# Use Gemini directly\ngemini-yes -- debug this code\n\n# Use Auggie directly\nauggie-yes -- analyze code patterns\n\n# Use GLM (Z.AI) directly — runs Claude Code against Z.AI's\n# Anthropic-compatible endpoint. Set ZAI_API_KEY first\n# (https://z.ai/manage-apikey/apikey-list).\nZAI_API_KEY=... glm-yes -- help me with this code\n\n# Use OpenRouter directly — runs Claude Code against OpenRouter's\n# Anthropic-compatible endpoint. Set OPENROUTER_API_KEY first\n# (https://openrouter.ai/keys). `orcy` is the short alias\n# (openrouter-claude-yes) and defaults to the z-ai/glm-5.2 model\n# (override via ANTHROPIC_DEFAULT_*_MODEL or ~/.claude/settings.json).\nOPENROUTER_API_KEY=... orcy -- help me with this code\n\n# Use Pi directly — minimal multi-provider coding agent\n# (https://github.com/earendil-works/pi)\npi-yes -- refactor this module\n\nclaude-yes \"help me with this code\"\nclaude-yes \"optimize performance\"\n```\n\n**Auto-exit when idle (useful for automation):**\n\n```bash\nclaude-yes --exit-on-idle=60s \"run all tests and commit current changes\"\n```\n\n**Alternative with claude-code-execute:**\n\n```bash\nclaude-code-execute claude-yes \"your task here\"\n```\n\n### Inspect and message running agents (`cy ls / read / send`)\n\nFrom any terminal you can list and interact with agents that are already\nrunning on the machine — both TS- and Rust-spawned ones:\n\n```bash\ncy ls                                  # list all running agents\ncy ls codex                            # filter (matches pid, cwd, cli, or prompt)\ncy tail \u003ckeyword\u003e                      # render last 96 lines via @xterm/headless\ncy read \u003ckeyword\u003e                      # full rendered log\ncy send \u003ckeyword\u003e \"next: run tests\"    # append a prompt to that agent's stdin\ncy send \u003ckeyword\u003e \"\" --code=ctrl-c     # send a Ctrl+C\ncy attach \u003ckeyword\u003e                    # interactive attach (detach: Ctrl-\\)\ncy stop \u003ckeyword\u003e                      # graceful shutdown (claude/codex: /exit)\n```\n\n#### Tips\n\n- A **single** `--code=ctrl-c` does not stop `claude` / `codex` — they treat it\n  as \"cancel current turn\" rather than \"quit\". Prefer `cy stop \u003ckeyword\u003e` (which\n  sends `/exit` for claude/codex and `/quit` for gemini), or send Ctrl+C twice\n  in quick succession. The `cy send … --code=ctrl-c` output prints a one-line\n  hint pointing at this when it detects one of those CLIs.\n\n`cy` (and `ay` / `agent-yes`) writes to a shared registry at\n`~/.agent-yes/pids.jsonl` and a per-pid FIFO at `~/.agent-yes/fifo/\u003cpid\u003e.stdin`,\nso subcommands work whether the target agent is the TS or Rust runtime.\nDetailed reference (Japanese): [`docs/cy-subcommands.md`](./docs/cy-subcommands.md).\n\n### Docker Usage\n\nYou can run `agent-yes` in a Docker container with all AI CLI tools pre-installed.\n\n**Pull the image:**\n\n```bash\n# From GitHub Container Registry (recommended)\ndocker pull ghcr.io/snomiao/agent-yes:latest\n\n# Or from Docker Hub\ndocker pull snomiao/agent-yes:latest\n```\n\n**Basic usage:**\n\n```bash\n# Run with Claude (default)\ndocker run --rm -v $(pwd):/workspace -w /workspace \\\n  ghcr.io/snomiao/agent-yes:latest \\\n  -- run all tests\n\n# Run with other AI tools\ndocker run --rm -v $(pwd):/workspace -w /workspace \\\n  ghcr.io/snomiao/agent-yes:latest \\\n  --cli=gemini -- debug this code\n```\n\n**Persisting credentials:**\n\nTo persist API keys and configuration across container runs, mount the config directories:\n\n```bash\n# For Claude\ndocker run --rm \\\n  -v $(pwd):/workspace \\\n  -v ~/.config/claude:/root/.config/claude \\\n  -v ~/.anthropic:/root/.anthropic \\\n  -w /workspace \\\n  ghcr.io/snomiao/agent-yes:latest \\\n  -- help me with this code\n\n# For multiple AI tools (mount all config directories)\ndocker run --rm \\\n  -v $(pwd):/workspace \\\n  -v ~/.config:/root/.config \\\n  -v ~/.anthropic:/root/.anthropic \\\n  -v ~/.openai:/root/.openai \\\n  -v ~/.cursor:/root/.cursor \\\n  -w /workspace \\\n  ghcr.io/snomiao/agent-yes:latest \\\n  --cli=claude -- optimize performance\n```\n\n**Complete example with environment variables:**\n\n```bash\n# Pass API keys via environment variables\ndocker run --rm \\\n  -v $(pwd):/workspace \\\n  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \\\n  -e OPENAI_API_KEY=$OPENAI_API_KEY \\\n  -e GOOGLE_API_KEY=$GOOGLE_API_KEY \\\n  -w /workspace \\\n  ghcr.io/snomiao/agent-yes:latest \\\n  -- refactor this module\n\n# Or use an env file\ndocker run --rm \\\n  -v $(pwd):/workspace \\\n  --env-file .env \\\n  -w /workspace \\\n  ghcr.io/snomiao/agent-yes:latest \\\n  --exit-on-idle=60s -- run all tests and commit\n```\n\n**Docker Compose example:**\n\n```yaml\nversion: \"3.8\"\nservices:\n  agent-yes:\n    image: ghcr.io/snomiao/agent-yes:latest\n    volumes:\n      - .:/workspace\n      - ~/.config/claude:/root/.config/claude\n      - ~/.anthropic:/root/.anthropic\n    working_dir: /workspace\n    environment:\n      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}\n    command: [\"--\", \"help me solve all todos\"]\n```\n\n**Available platforms:**\n\n- `linux/amd64` (x86_64)\n- `linux/arm64` (aarch64)\n\n**Cloud deployment:**\n\nFor deploying to cloud platforms like Google Cloud Run, AWS, Azure, see [Cloud Deployment Guide](./docs/clouds.md).\n\n### Supported CLI Tools\n\n| Tool    | CLI Name  | Description                       | Installation/Update                                 |\n| ------- | --------- | --------------------------------- | --------------------------------------------------- |\n| Claude  | `claude`  | Anthropic's Claude Code (default) | `npm install -g @anthropic-ai/claude-code@latest`   |\n| Gemini  | `gemini`  | Google's Gemini CLI               | `npm install -g @google/gemini-cli@latest`          |\n| Codex   | `codex`   | OpenAI's Codex CLI                | `npm install -g @openai/codex-cli@latest`           |\n| Copilot | `copilot` | GitHub Copilot CLI                | `npm install -g @github/copilot@latest`             |\n| Cursor  | `cursor`  | Cursor agent CLI                  | See https://cursor.com/ja/docs/cli/installation     |\n| Grok    | `grok`    | Vibe Kit's Grok CLI               | `npm install -g @vibe-kit/grok-cli@latest`          |\n| Qwen    | `qwen`    | Alibaba's Qwen Code CLI           | `npm install -g @qwen-code/qwen-code@latest`        |\n| Auggie  | `auggie`  | Augment Code's Auggie CLI         | `npm install -g @augmentcode-inc/auggie-cli@latest` |\n\nThe tool will:\n\n1. Run the specified AI CLI tool\n2. Automatically respond \"Yes\" to common yes/no prompts\n3. Handle tool-specific patterns and responses\n4. When using `--exit-on-idle` flag, automatically exit when the tool becomes idle\n\n## CLI Tools Comparison\n\n### Pros \u0026 Cons Analysis\n\n#### Claude Code CLI (Anthropic)\n\n**Pros:**\n\n- Industry-leading performance on SWE-bench (72.5%) and Terminal-bench (43.2%)\n- Advanced checkpointing feature for code state management\n- Deep terminal integration with Unix philosophy support\n- Enterprise-ready with AWS/GCP deployment options\n- Excellent at complex refactoring and debugging tasks\n\n**Cons:**\n\n- Higher cost compared to alternatives ($5+ per session)\n- Terminal-based interface may not suit all developers\n- Closed ecosystem with limited community plugins\n- Requires API subscription for full features\n\n#### Gemini CLI (Google)\n\n**Pros:**\n\n- Free tier with generous limits (60 requests/min, 1,000/day)\n- Fully open source (Apache 2.0 license)\n- 1 million token context window\n- MCP integration for extensibility\n- GitHub Actions integration at no cost\n\n**Cons:**\n\n- Currently in preview with potential stability issues\n- Shared quotas between CLI and Code Assist\n- May produce factually incorrect outputs\n- Limited to English language support\n\n#### Codex CLI (OpenAI/Microsoft)\n\n**Pros:**\n\n- Cloud-based scalability for team collaboration\n- Powers GitHub Copilot ecosystem\n- Supports multimodal input (images, diagrams)\n- Strong GitHub integration\n- Flexible API for custom implementations\n\n**Cons:**\n\n- Requires more setup and technical knowledge\n- Internet dependency for all operations\n- Less mature/polished than competitors\n- Higher computational requirements\n\n#### Copilot CLI (GitHub)\n\n**Pros:**\n\n- Seamless GitHub integration\n- Terminal-native development experience\n- Wide language and model support\n- Command explanation and suggestion features\n- Enterprise policy controls available\n\n**Cons:**\n\n- Requires active subscription\n- English-only support\n- May struggle with complex/uncommon commands\n- Organization admin approval needed for business users\n\n#### Cursor CLI\n\n**Pros:**\n\n- Superior performance in setup and deployment\n- Multi-model support from various providers\n- Excellent context awareness with RAG system\n- Enterprise features for CI/CD integration\n- Can run multiple agents in parallel\n\n**Cons:**\n\n- Steeper learning curve\n- UI/UX can be clunky with cramped interface\n- Manual context management required\n- Screen real estate limitations\n\n#### Grok CLI (xAI/Vibe Kit)\n\n**Pros:**\n\n- Open source and free for basic use\n- Cost-effective premium tier ($30/month)\n- Real-time data access via X integration\n- Strong community support\n- Cross-platform compatibility\n\n**Cons:**\n\n- Requires API key for advanced features\n- Internet dependency for AI features\n- Additional setup and authentication needed\n- Newer with less mature ecosystem\n\n#### Qwen Code CLI (Alibaba)\n\n**Pros:**\n\n- Fully open source (Apache 2.0)\n- Exceptional benchmark performance (87.9 on MultiPL-E)\n- 256K-1M token context support\n- No subscription required\n- Enterprise-ready with full infrastructure control\n\n**Cons:**\n\n- Newer entrant with developing ecosystem\n- Geopolitical considerations for adoption\n- Less established tooling and integrations\n- Regional trust and security concerns\n\n#### Auggie CLI (Augment Code)\n\n**Pros:**\n\n- AI-powered code assistant with context awareness\n- Supports multiple programming languages\n- Real-time code suggestions and completions\n- Integration with popular IDEs\n- Team collaboration features\n\n**Cons:**\n\n- Requires subscription for full features\n- Newer product with evolving feature set\n- Limited documentation compared to established tools\n- May require configuration for optimal performance\n\n### Choosing the Right Tool\n\n- **For Solo Developers:** Claude Code (complex tasks) or Grok CLI (cost-conscious)\n- **For Teams:** Codex CLI (cloud collaboration) or Cursor CLI (parallel agents)\n- **For Enterprises:** Claude Code (performance) or Qwen Code (self-hosted)\n- **For Budget-Conscious:** Gemini CLI (free tier) or Qwen Code (open source)\n- **For GitHub Users:** Copilot CLI (native integration)\n\n\u003c!-- TODO: add usage As lib: call await claudeYes() and it returns render result --\u003e\n\n## Options\n\n- `--cli=\u003ctool\u003e`: Specify which AI CLI tool to use (claude, gemini, codex, copilot, cursor, grok, qwen, auggie). Defaults to `claude`.\n- `--exit-on-idle=\u003cseconds\u003e`: Automatically exit when the AI tool becomes idle for the specified duration. Useful for automation scripts.\n- `--use-skills`: Automatically discover and prepend SKILL.md headers from the directory hierarchy (walks from current directory up to git root). Multiple SKILL.md files are merged with most specific first. Particularly useful to bring Claude Skills-like context to non-Claude agents such as Codex or Gemini. Supports nested skills for monorepos.\n\n## Advanced Features\n\n### Named Pipe Input (Linux Only)\n\nOn Linux systems, `agent-yes` automatically creates a named pipe (FIFO) for additional input streams. This allows you to send input to the CLI from multiple sources simultaneously.\n\n**How it works:**\n\n- When started on Linux, a FIFO is created at `/tmp/agent-yes-YYYYMMDDHHMMSSXXX.stdin`\n- The FIFO path is displayed in the console output\n- You can write to this FIFO from another terminal or script\n- Input from both the FIFO and standard stdin are merged together\n\n**Example usage:**\n\n```bash\n# Terminal 1: Start the CLI\nclaude-yes \"help me with my code\"\n# Output will show: [claude-yes] Created FIFO at /tmp/agent-yes-20260109123456abc.stdin\n\n# Terminal 2: Send additional input via the FIFO\necho \"also check the tests\" \u003e /tmp/agent-yes-20260109123456abc.stdin\n```\n\nThis feature is useful for:\n\n- Scripting complex interactions\n- Sending input from multiple sources\n- Integrating with other tools and automation systems\n\n## Library Usage\n\nYou can also use this as a library in your Node.js projects:\n\n```typescript\nimport claudeYes from \"claude-yes\";\n\n// Use Claude\nawait claudeYes({\n  prompt: \"help me solve all todos in my codebase\",\n  cli: \"claude\",\n  cliArgs: [\"--verbose\"],\n  exitOnIdle: 30000, // exit after 30 seconds of idle\n  continueOnCrash: true,\n  logFile: \"claude.log\",\n});\n\n// Use other tools\nawait claudeYes({\n  prompt: \"debug this function\",\n  cli: \"gemini\",\n  exitOnIdle: 60000,\n});\n\n// Use Auggie\nawait claudeYes({\n  prompt: \"analyze code patterns\",\n  cli: \"auggie\",\n  exitOnIdle: 60000,\n});\n```\n\n## Implementation\n\nThe tool uses `node-pty` to spawn and manage AI CLI processes, with a sophisticated pattern-matching system that:\n\n1. **Detects Ready States**: Recognizes when each CLI tool is ready to accept input\n2. **Auto-Responds**: Automatically sends \"Yes\" responses to common prompts\n3. **Handles Fatal Errors**: Detects and responds to fatal error conditions\n4. **Manages Process Lifecycle**: Handles crashes, restarts, and graceful exits\n\nEach supported CLI has its own configuration defining:\n\n- **Ready patterns**: Regex patterns that indicate the tool is ready for input\n- **Enter patterns**: Patterns that trigger automatic \"Yes\" responses\n- **Fatal patterns**: Patterns that indicate fatal errors requiring exit\n- **Binary mapping**: Maps logical names to actual executable names\n- **Argument handling**: Special argument processing (e.g., adding `--search` to Codex)\n\n## Dependencies\n\n- `node-pty` or `bun-pty` - For spawning and managing AI CLI processes\n- `from-node-stream` - Stream processing utilities\n- `sflow` - Functional stream processing\n- `terminal-render` - Terminal rendering and text processing\n- `phpdie` - Error handling utilities\n\n## Inspiration\n\nThis project was inspired by: [Claude Code full auto while I sleep : r/ClaudeAI](https://www.reddit.com/r/ClaudeAI/comments/1klk6aw/claude_code_full_auto_while_i_sleep/)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnomiao%2Fagent-yes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnomiao%2Fagent-yes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnomiao%2Fagent-yes/lists"}