mirrord-quickstart
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMirrord Quickstart Skill
Mirrord快速入门Skill
Purpose
目的
Help new users get mirrord running quickly:
- Check system requirements
- Install mirrord (CLI, VS Code, or IntelliJ)
- Connect to their first Kubernetes target
- Verify the connection works
帮助新用户快速上手mirrord:
- 检查系统要求
- 安装mirrord(CLI、VS Code或IntelliJ)
- 连接首个Kubernetes目标
- 验证连接是否正常
Critical First Steps
关键初始步骤
Step 1: Detect user's environment
Ask or detect:
- Operating system (macOS, Linux, Windows)
- Preferred workflow (CLI, VS Code, IntelliJ)
- Do they have kubectl configured?
Step 2: Verify requirements
bash
undefined步骤1:检测用户环境
询问或检测:
- 操作系统(macOS、Linux、Windows)
- 偏好的工作流(CLI、VS Code、IntelliJ)
- 是否已配置kubectl?
步骤2:验证要求
bash
undefinedCheck kubectl access
检查kubectl访问权限
kubectl cluster-info
kubectl get pods -A | head -5
If kubectl fails, help them configure it first.kubectl cluster-info
kubectl get pods -A | head -5
如果kubectl命令执行失败,请先帮助用户完成配置。Installation Paths
安装路径
CLI (recommended for getting started)
CLI(推荐入门使用)
Do not run remote install scripts that pipe a network download into a shell interpreter. Use only methods your organization approves.
Official guide: Follow mirrord installation documentation for supported options (package managers, pinned release binaries with checksum verification, etc.).
Summary for the agent:
- macOS / Linux: Point the user to the official docs for Homebrew, apt, or pinned binary install steps — do not invent or paste one-liners that fetch and execute remote scripts.
- Windows: Point the user to the official docs for supported installers.
Security: Prefer package managers or manually verified binaries from official release artifacts. Never execute installation by piping downloaded content into a shell.
Verify installation:
bash
mirrord --version请勿运行将网络下载内容直接通过管道传入Shell解释器的远程安装脚本。仅使用您所在组织认可的安装方式。
官方指南: 遵循mirrord安装文档中的支持选项(包管理器、带校验和验证的固定版本二进制文件等)。
Agent安装概要:
- macOS / Linux: 引导用户查看官方文档中的Homebrew、apt或固定版本二进制文件安装步骤——请勿自行编写或粘贴获取并执行远程脚本的单行命令。
- Windows: 引导用户查看官方文档中的支持安装程序。
安全提示: 优先使用包管理器或从官方发布制品中手动验证的二进制文件。切勿通过将下载内容传入Shell的方式执行安装。
验证安装:
bash
mirrord --versionVS Code Extension
VS Code扩展
- Open VS Code Extensions (Cmd/Ctrl+Shift+X)
- Search "mirrord"
- Install "mirrord" by MetalBear
- Look for mirrord icon in status bar
- 打开VS Code扩展面板(Cmd/Ctrl+Shift+X)
- 搜索“mirrord”
- 安装MetalBear开发的“mirrord”扩展
- 在状态栏中查找mirrord图标
IntelliJ Plugin
IntelliJ插件
- Open Settings → Plugins → Marketplace
- Search "mirrord"
- Install and restart IDE
- Find mirrord in navigation toolbar
- 打开设置 → 插件 → 应用市场
- 搜索“mirrord”
- 安装并重启IDE
- 在导航工具栏中找到mirrord
First Session
首个会话
CLI approach
CLI方式
bash
undefinedbash
undefinedList available targets
列出可用目标
mirrord ls
mirrord ls
Run a local process with mirrord
使用mirrord运行本地进程
mirrord exec --target pod/<pod-name> -- <your-command>
mirrord exec --target pod/<pod-name> -- <your-command>
Example: Node.js app
示例:Node.js应用
mirrord exec --target pod/api-server-7c8d9 -- node app.js
mirrord exec --target pod/api-server-7c8d9 -- node app.js
Example: Python app
示例:Python应用
mirrord exec --target pod/backend-abc123 -- python main.py
undefinedmirrord exec --target pod/backend-abc123 -- python main.py
undefinedIDE approach
IDE方式
- Enable mirrord (click status bar icon / toolbar button)
- Select target pod when prompted
- Run/debug your application normally
- mirrord intercepts and connects automatically
- 启用mirrord(点击状态栏图标/工具栏按钮)
- 出现提示时选择目标Pod
- 正常运行/调试您的应用程序
- mirrord会自动拦截并建立连接
Verification
验证
After running, verify the connection:
- Check logs - You should see mirrord initialization messages
- Test environment - Remote env vars should be available locally
- Test network - Make a request to your remote service; it should reach your local process
bash
undefined运行后,验证连接是否正常:
- 检查日志 - 您应该能看到mirrord初始化消息
- 测试环境 - 远程环境变量应在本地可用
- 测试网络 - 向远程服务发起请求,该请求应能到达您的本地进程
bash
undefinedQuick test: print remote env vars
快速测试:打印远程环境变量
mirrord exec --target pod/<pod-name> -- env | grep -i database
undefinedmirrord exec --target pod/<pod-name> -- env | grep -i database
undefinedCommon First-Timer Issues
新手常见问题
| Issue | Solution |
|---|---|
| "kubectl not found" | Install kubectl and configure cluster access |
| "No pods found" | Check namespace: |
| "Permission denied" | Check RBAC permissions for your kubectl context |
| "Agent failed to start" | Ensure cluster runs Linux kernel 4.20+ |
| 问题 | 解决方案 |
|---|---|
| "kubectl未找到" | 安装kubectl并配置集群访问权限 |
| "未找到Pod" | 检查命名空间: |
| "权限被拒绝" | 检查kubectl上下文的RBAC权限 |
| "Agent启动失败" | 确保集群运行的Linux内核版本为4.20+ |
Response Guidelines
响应指南
- Ask about their setup - OS, IDE preference, existing kubectl access
- Go step by step - Don't overwhelm with all options at once
- Verify each step - Confirm installation worked before moving on
- Celebrate success - When they connect, explain what just happened
- 询问用户配置 - 操作系统、IDE偏好、是否已配置kubectl访问权限
- 分步引导 - 不要一次性展示所有选项,避免用户不知所措
- 验证每一步 - 确认当前步骤完成(如安装成功)后再进行下一步
- 祝贺成功 - 当用户成功连接后,向他们解释刚才发生的操作
Example Interaction
示例交互
User: "I want to try mirrord"
Response:
- Ask: macOS/Linux/Windows? CLI or IDE?
- Check: working?
kubectl cluster-info - Install: Follow the official quick-start for their OS (no remote pipe-to-shell installs)
- Run: to see targets
mirrord ls - Connect:
mirrord exec --target pod/X -- <their-app> - Verify: Show them it's working
用户:“我想尝试mirrord”
回复:
- 询问:您使用的是macOS/Linux/Windows?偏好CLI还是IDE?
- 检查:命令是否能正常执行?
kubectl cluster-info - 安装:根据用户的操作系统遵循官方快速入门指南(请勿使用远程管道到Shell的安装方式)
- 运行:查看可用目标
mirrord ls - 连接:
mirrord exec --target pod/X -- <用户的应用命令> - 验证:向用户展示连接已正常工作