gemini-canvas
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGemini Canvas Skill
Gemini Canvas Skill
Overview
概述
Claude can use Gemini Canvas at gemini.google.com for collaborative document creation, code editing, and visual content development. Canvas provides a side-by-side workspace for iterative writing and coding with AI assistance.
Claude可通过gemini.google.com使用Gemini Canvas,进行协同文档创建、代码编辑以及可视化内容开发。Canvas提供了一个并排工作区,可在AI辅助下进行迭代式写作与编码。
Quick Install
快速安装
bash
curl -sSL https://canifi.com/skills/gemini-canvas/install.sh | bashOr manually:
bash
cp -r skills/gemini-canvas ~/.canifi/skills/bash
curl -sSL https://canifi.com/skills/gemini-canvas/install.sh | bash或者手动安装:
bash
cp -r skills/gemini-canvas ~/.canifi/skills/Setup
设置
Configure via canifi-env:
bash
undefined通过canifi-env进行配置:
bash
undefinedFirst, ensure canifi-env is installed:
首先,确保已安装canifi-env:
curl -sSL https://canifi.com/install.sh | bash
curl -sSL https://canifi.com/install.sh | bash
canifi-env set GOOGLE_EMAIL "your-email@gmail.com"
undefinedcanifi-env set GOOGLE_EMAIL "your-email@gmail.com"
undefinedPrivacy & Authentication
隐私与认证
Your credentials, your choice. Canifi LifeOS respects your privacy.
你的凭据,由你掌控。 Canifi LifeOS尊重你的隐私。
Option 1: Manual Browser Login (Recommended)
选项1:手动浏览器登录(推荐)
If you prefer not to share credentials with Claude Code:
- Complete the Browser Automation Setup using CDP mode
- Login to the service manually in the Playwright-controlled Chrome window
- Claude will use your authenticated session without ever seeing your password
如果你不想与Claude Code共享凭据:
- 使用CDP模式完成浏览器自动化设置
- 在Playwright控制的Chrome窗口中手动登录该服务
- Claude将使用你的已认证会话,全程不会获取你的密码
Option 2: Environment Variables
选项2:环境变量
If you're comfortable sharing credentials, you can store them locally:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"Note: Credentials stored in canifi-env are only accessible locally on your machine and are never transmitted.
如果你愿意共享凭据,可将其存储在本地:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"注意:存储在canifi-env中的凭据仅能在你的本地设备上访问,绝不会被传输至外部。
Capabilities
功能特性
- Create and edit documents in canvas view
- Write and refine long-form content
- Develop and debug code collaboratively
- Iterate on drafts with AI suggestions
- Format and structure documents
- Generate outlines and expand content
- Refactor and improve code
- Create technical documentation
- Build structured reports
- Develop creative writing pieces
- 在画布视图中创建和编辑文档
- 撰写与优化长篇内容
- 协同开发与调试代码
- 结合AI建议迭代草稿
- 格式化与结构化文档
- 生成大纲并拓展内容
- 重构与优化代码
- 创建技术文档
- 构建结构化报告
- 创作创意写作作品
Usage Examples
使用示例
Example 1: Write Document
示例1:撰写文档
User: "Use Canvas to write a project proposal"
Claude: Opens Gemini Canvas, starts document:
"Create a project proposal for [topic]"
Iterates with suggestions, refines structure,
exports final document.用户:"使用Canvas撰写一份项目提案"
Claude:打开Gemini Canvas,启动文档:
"为[主题]创建一份项目提案"
结合建议进行迭代,优化结构,
导出最终文档。Example 2: Code Development
示例2:代码开发
User: "Use Canvas to build a Python web scraper"
Claude: Opens Canvas in code mode, develops scraper:
Initial implementation, then iterates to add
error handling, logging, and documentation.用户:"使用Canvas构建一个Python网页爬虫"
Claude:在代码模式下打开Canvas,开发爬虫:
完成初始实现,随后迭代添加
错误处理、日志记录和文档。Example 3: Refine Content
示例3:优化内容
User: "Help me improve this blog post in Canvas"
Claude: Pastes content into Canvas, requests improvements:
"Improve clarity, add transitions, enhance introduction"
Returns polished version.用户:"帮我在Canvas中改进这篇博客文章"
Claude:将内容粘贴至Canvas,请求优化:
"提升清晰度,添加过渡内容,优化引言"
返回打磨后的版本。Example 4: Technical Documentation
示例4:技术文档
User: "Create API documentation for my endpoints"
Claude: Uses Canvas to structure documentation:
Endpoint descriptions, parameters, examples,
error codes. Exports formatted documentation.用户:"为我的接口创建API文档"
Claude:使用Canvas构建文档结构:
接口描述、参数、示例、
错误码。导出格式化后的文档。Authentication Flow
认证流程
- Claude navigates to gemini.google.com via Playwright MCP
- Authenticates with GOOGLE_EMAIL if needed
- Handles 2FA if prompted (notifies user via iMessage)
- Accesses Canvas feature
- Claude通过Playwright MCP导航至gemini.google.com
- 如需认证则使用GOOGLE_EMAIL
- 若提示需两步验证,则通过iMessage通知用户
- 访问Canvas功能
Canvas Workflow
Canvas工作流
1. Navigate to gemini.google.com
2. Start conversation or select Canvas mode
3. Create initial content with prompt
4. Review in side-by-side canvas view
5. Request iterations and improvements
6. Apply suggested changes
7. Export or copy final content1. 导航至gemini.google.com
2. 开启对话或选择Canvas模式
3. 通过提示创建初始内容
4. 在并排画布视图中审阅
5. 请求迭代与优化建议
6. 应用建议的更改
7. 导出或复制最终内容Selectors Reference
选择器参考
javascript
// Chat input
'[aria-label="Enter a prompt here"]' or 'rich-textarea'
// Canvas panel
'.canvas-editor' or '.canvas-content'
// Canvas toggle
'[aria-label="Canvas"]' or canvas mode button
// Code block
'.code-block' or 'pre code'
// Copy button
'[aria-label="Copy"]'
// Apply changes
'[aria-label="Apply"]'
// Undo/Redo
'[aria-label="Undo"]'
'[aria-label="Redo"]'
// Export options
'[aria-label="Export"]'javascript
// 聊天输入框
'[aria-label="Enter a prompt here"]' or 'rich-textarea'
// 画布面板
'.canvas-editor' or '.canvas-content'
// Canvas切换按钮
'[aria-label="Canvas"]' or canvas mode button
// 代码块
'.code-block' or 'pre code'
// 复制按钮
'[aria-label="Copy"]'
// 应用更改
'[aria-label="Apply"]'
// 撤销/重做
'[aria-label="Undo"]'
'[aria-label="Redo"]'
// 导出选项
'[aria-label="Export"]'Canvas Modes
Canvas模式
Writing Mode:
- Long-form documents
- Essays and articles
- Reports and proposals
- Creative writing
Code Mode:
- Python, JavaScript, etc.
- Full file development
- Debugging and refactoring
- Documentation generation写作模式:
- 长篇文档
- 论文与文章
- 报告与提案
- 创意写作
代码模式:
- Python、JavaScript等编程语言
- 完整文件开发
- 调试与重构
- 文档生成Error Handling
错误处理
- Login Failed: Retry 3 times, notify user via iMessage
- Session Expired: Re-authenticate automatically
- Canvas Not Available: Fall back to regular chat mode
- Content Too Long: Split into sections, process iteratively
- Save Failed: Copy content to clipboard as backup
- Export Failed: Copy manually, try alternative format
- 登录失败:重试3次,通过iMessage通知用户
- 会话过期:自动重新认证
- Canvas不可用:回退至常规聊天模式
- 内容过长:拆分为多个部分,迭代处理
- 保存失败:将内容复制至剪贴板作为备份
- 导出失败:手动复制,尝试其他格式
Self-Improvement Instructions
自我改进说明
When you learn a better way to use Gemini Canvas:
- Document the improvement in your response
- Suggest updating this skill file with the new approach
- Include specific prompts that produce better iterations
- Note any new Canvas features or modes
当你掌握了使用Gemini Canvas的更佳方法时:
- 在回复中记录该改进方法
- 建议使用新方法更新此技能文件
- 包含能产生更优迭代效果的具体提示词
- 记录任何新的Canvas功能或模式
Notes
注意事项
- Canvas provides visual side-by-side editing
- Useful for longer content that needs iteration
- Code mode supports syntax highlighting
- Changes can be accepted or rejected individually
- Version history may be available
- Best for content requiring multiple revision passes
- Export to various formats supported
- Canvas view requires larger screen for best experience
- Canvas提供可视化并排编辑功能
- 适用于需要多次迭代的长篇内容
- 代码模式支持语法高亮
- 可单独接受或拒绝更改
- 可能提供版本历史记录
- 最适合需要多轮修订的内容
- 支持导出为多种格式
- Canvas视图在大屏幕上使用体验最佳