Communitygithub.com

am-will/gemini-computer-use

使用 Playwright 构建并运行 Gemini 2.5 计算机使用浏览器控制代理。适用于用户希望通过 Gemini 计算机使用模型自动化浏览器任务、需要代理循环(截图→函数调用→操作→函数响应)或要求为风险 UI 操作集成安全确认的场景。

gemini-computer-use 是什么?

该技能利用 Gemini 2.5 的“计算机使用”能力,结合 Playwright 浏览器自动化框架,实现了一个完整的浏览器控制代理。它遵循“截图→函数调用→操作→函数响应”的循环机制,让 AI 模型能够像人类一样观察浏览器屏幕截图并执行相应的 UI 操作(如点击、输入、导航等)。其核心价值在于提供了一个安全且结构化的代理循环,特别适合需要自动化复杂、多步骤 Web 任务的场景,例如数据抓取、表单填写或端到端测试。技能还内置了针对高风险操作(如删除操作或交易确认)的安全确认功能,以防止误操作。该技能支持所有基于 Playwright 的现代浏览器,并适用于 Claude Code、Cursor 或 Codex 等 AI 代理平台,开发者只需提供目标 URL 和任务描述即可快速集成。

兼容平台~Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/am-will/codex-skills/tree/main/skills/gemini-computer-use

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

gemini-computer-use 是做什么的?

使用 Playwright 构建并运行 Gemini 2.5 计算机使用浏览器控制代理。适用于用户希望通过 Gemini 计算机使用模型自动化浏览器任务、需要代理循环(截图→函数调用→操作→函数响应)或要求为风险 UI 操作集成安全确认的场景。

工作原理

该技能实现了一个循环代理,该代理:

  1. 截图:截取浏览器当前页面的截图。
  2. 调用函数:将截图发送给 Gemini 2.5 模型,模型决定下一步要执行的操作(例如 click、type、navigate)。
  3. 执行操作:使用 Playwright 在浏览器中执行所选操作。
  4. 响应函数:将操作结果(成功/失败、新截图)返回给模型。
  5. 重复:循环继续,直到任务完成或达到最大步数。

主要特性

  • Gemini 2.5 集成:利用 Google 最新的计算机使用模型进行智能浏览器控制。
  • Playwright 自动化:可靠、跨浏览器的 Web 自动化。
  • 安全确认:在执行风险操作(如删除、提交敏感表单、确认交易)前提示用户确认。
  • 可配置:可调整最大步数、截图像素大小、浏览器类型等参数。
  • 结构化代理循环:遵循可靠的 screenshot → function_call → action → function_response 模式。

快速开始

前提条件

  • Node.js v18 或更高版本
  • 一个 Gemini API 密钥(设置为 GEMINI_API_KEY 环境变量)

安装

npx am-will/gemini-computer-use --task "访问 example.com 并截图"

环境变量

变量名必需描述
GEMINI_API_KEY是你的 Gemini API 密钥
GEMINI_MODEL否模型名称(默认:gemini-2.5-pro-exp-03-25)
HEADLESS否设置为 true 以无头模式运行浏览器(默认:false)
MAX_STEPS否任务的最大代理步数(默认:50)

使用示例

基本任务

export GEMINI_API_KEY="your-api-key-here"
npx am-will/gemini-computer-use --task "搜索 'Playwright 浏览器自动化' 并返回第一个结果标题"

带有安全确认的风险操作

export GEMINI_API_KEY="your-api-key-here"
npx am-will/gemini-computer-use --task "登录我的管理面板并删除 id=5 的用户"

执行 click 删除按钮前,代理会暂停并要求用户确认。

高级配置

你可以通过创建 gcuf.config.json 文件来进一步自定义行为:

{
  "browserType": "chromium",
  "viewport": {
    "width": 1280,
    "height": 720
  },
  "screenshotQuality": 80,
  "safetyConfirmations": true,
  "maxSteps": 100
}

支持

许可证

MIT

Individual skills in this repo

This repo contains 17 individual skills — each has its own dedicated page.

am-will/agent-browser

A fast Rust-based headless browser automation CLI with Node.js fallback that enables AI agents to navigate, click, type, and snapshot pages via structured commands.

am-will/context7

Fetch up-to-date library documentation via Context7 CLI. Use PROACTIVELY when: (1) Working with ANY external library (React, Next.js, Supabase, etc.) (2) User asks about library APIs, patterns, or best practices (3) Implementing features that rely on third-party packages (4) Debugging library-specific issues (5) Need current documentation beyond training data cutoff (6) AND MOST IMPORTANTLY, when you are installing dependencies, libraries, or frameworks you should ALWAYS check the docs to see what the latest versions are. Do not rely on outdated knowledge. Always prefer this over guessing library APIs or using outdated knowledge.

am-will/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

am-will/frontend-responsive-design-standards

Build responsive, mobile-first layouts using fluid containers, flexible units, media queries, and touch-friendly design that works across all screen sizes. Use this skill when creating or modifying UI layouts, responsive grids, breakpoint styles, mobile navigation, or any interface that needs to adapt to different screen sizes. Apply when working with responsive CSS, media queries, viewport settings, flexbox/grid layouts, mobile-first styling, breakpoint definitions (mobile, tablet, desktop), touch target sizing, relative units (rem, em, %), image optimization for different screens, or testing layouts across multiple devices. Use for any task involving multi-device support, responsive design patterns, or adaptive layouts.

am-will/llm-council

Orchestrate a configurable, multi-member CLI planning council (Codex, Claude Code, Gemini, OpenCode, or custom) to produce independent implementation plans, anonymize and randomize them, then judge and merge into one final plan. Use when you need a robust, bias-resistant planning workflow, structured JSON outputs, retries, and failure handling across multiple CLI agents.

am-will/markdown-url

Route any website you need to visit through markdown.new by prefixing the URL. **WHEN TO USE:** - You would normally open a website link to read content (docs, blog posts, changelogs, GitHub issues, etc.) - You need a cleaner, Markdown-friendly view for copying notes or summarizing

am-will/openai-docs-skill

Query the OpenAI developer documentation via the OpenAI Docs MCP server using CLI (curl/jq). Use whenever a task involves the OpenAI API (Responses, Chat Completions, Realtime, etc.), OpenAI SDKs, ChatGPT Apps SDK, Codex, MCP integrations, endpoint schemas, parameters, limits, or migrations and you need up-to-date official guidance.

am-will/parallel-task

Only to be triggered by explicit /parallel-task commands.

am-will/parallel-task-spark

Only to be triggered by explicit /parallel-task-spark commands.

am-will/plan-harder

Use when user specfically says 'plan harder'.

am-will/planner

Create comprehensive, phased implementation plans with sprints and atomic tasks. Use when user says: "make a plan", "create a plan", "plan this out", "plan the implementation", "help me plan", "design a plan", "draft a plan", "write a plan", "outline the steps", "break this down into tasks", "what's the plan for", or any similar planning request. Also triggers on explicit "/planner" or "/plan" commands.

am-will/read-github

Read and search GitHub repository documentation via gitmcp.io MCP service. **WHEN TO USE:** - User provides a GitHub URL - User mentions a specific repo in owner/repo format - User asks "what does this repo do?", "read the docs for X repo", or similar - User wants to search code or docs within a repo

am-will/role-creator

Create and update Codex custom agents using standalone custom-agent TOML files.

am-will/super-swarm-spark

Only to be triggered by explicit super-swarm-spark commands.

am-will/swarm-planner

[EXPLICIT INVOCATION ONLY] Creates dependency-aware implementation plans optimized for parallel multi-agent execution.

am-will/tdd-test-writer

Writes failing tests first for test-driven development and hands off a strict implementation contract that requires agents to make those tests pass without weakening the tests. Use when users ask for test-first workflows, RED/GREEN cycles, or behavior-gating tasks with automated tests.

am-will/vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

相关技能