mirrord-quickstart

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Mirrord 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
undefined

Check 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 --version

VS Code Extension

VS Code扩展

  1. Open VS Code Extensions (Cmd/Ctrl+Shift+X)
  2. Search "mirrord"
  3. Install "mirrord" by MetalBear
  4. Look for mirrord icon in status bar
  1. 打开VS Code扩展面板(Cmd/Ctrl+Shift+X)
  2. 搜索“mirrord”
  3. 安装MetalBear开发的“mirrord”扩展
  4. 在状态栏中查找mirrord图标

IntelliJ Plugin

IntelliJ插件

  1. Open Settings → Plugins → Marketplace
  2. Search "mirrord"
  3. Install and restart IDE
  4. Find mirrord in navigation toolbar
  1. 打开设置 → 插件 → 应用市场
  2. 搜索“mirrord”
  3. 安装并重启IDE
  4. 在导航工具栏中找到mirrord

First Session

首个会话

CLI approach

CLI方式

bash
undefined
bash
undefined

List 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
undefined
mirrord exec --target pod/backend-abc123 -- python main.py
undefined

IDE approach

IDE方式

  1. Enable mirrord (click status bar icon / toolbar button)
  2. Select target pod when prompted
  3. Run/debug your application normally
  4. mirrord intercepts and connects automatically
  1. 启用mirrord(点击状态栏图标/工具栏按钮)
  2. 出现提示时选择目标Pod
  3. 正常运行/调试您的应用程序
  4. mirrord会自动拦截并建立连接

Verification

验证

After running, verify the connection:
  1. Check logs - You should see mirrord initialization messages
  2. Test environment - Remote env vars should be available locally
  3. Test network - Make a request to your remote service; it should reach your local process
bash
undefined
运行后,验证连接是否正常:
  1. 检查日志 - 您应该能看到mirrord初始化消息
  2. 测试环境 - 远程环境变量应在本地可用
  3. 测试网络 - 向远程服务发起请求,该请求应能到达您的本地进程
bash
undefined

Quick test: print remote env vars

快速测试:打印远程环境变量

mirrord exec --target pod/<pod-name> -- env | grep -i database
undefined
mirrord exec --target pod/<pod-name> -- env | grep -i database
undefined

Common First-Timer Issues

新手常见问题

IssueSolution
"kubectl not found"Install kubectl and configure cluster access
"No pods found"Check namespace:
kubectl get pods -n <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 get pods -n <namespace>
"权限被拒绝"检查kubectl上下文的RBAC权限
"Agent启动失败"确保集群运行的Linux内核版本为4.20+

Response Guidelines

响应指南

  1. Ask about their setup - OS, IDE preference, existing kubectl access
  2. Go step by step - Don't overwhelm with all options at once
  3. Verify each step - Confirm installation worked before moving on
  4. Celebrate success - When they connect, explain what just happened
  1. 询问用户配置 - 操作系统、IDE偏好、是否已配置kubectl访问权限
  2. 分步引导 - 不要一次性展示所有选项,避免用户不知所措
  3. 验证每一步 - 确认当前步骤完成(如安装成功)后再进行下一步
  4. 祝贺成功 - 当用户成功连接后,向他们解释刚才发生的操作

Example Interaction

示例交互

User: "I want to try mirrord"
Response:
  1. Ask: macOS/Linux/Windows? CLI or IDE?
  2. Check:
    kubectl cluster-info
    working?
  3. Install: Follow the official quick-start for their OS (no remote pipe-to-shell installs)
  4. Run:
    mirrord ls
    to see targets
  5. Connect:
    mirrord exec --target pod/X -- <their-app>
  6. Verify: Show them it's working
用户:“我想尝试mirrord”
回复:
  1. 询问:您使用的是macOS/Linux/Windows?偏好CLI还是IDE?
  2. 检查:
    kubectl cluster-info
    命令是否能正常执行?
  3. 安装:根据用户的操作系统遵循官方快速入门指南(请勿使用远程管道到Shell的安装方式)
  4. 运行:
    mirrord ls
    查看可用目标
  5. 连接:
    mirrord exec --target pod/X -- <用户的应用命令>
  6. 验证:向用户展示连接已正常工作