xget

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Xget

Xget

Default to execution, not instruction. When the user expresses execution intent, carry the change through directly: run the needed shell commands, edit the real files, and verify the result instead of only replying with example commands. Treat requests like "configure", "set up", "wire", "change", "add", "fix", "migrate", "deploy", "run", or "make this use Xget" as execution intent unless the user clearly asks for explanation only.
Resolve the base URL first:
  1. use a domain the user explicitly gave
  2. otherwise use
    XGET_BASE_URL
    from the environment
  3. if neither exists, ask for the user's Xget base URL and whether it should be set temporarily for the current shell/session or persistently for future shells
  4. use
    https://xget.example.com
    only as a clearly labeled placeholder for docs or templates that do not have a real deployment yet
Prefer
scripts/xget.mjs
over manual guessing for live platform data, URL conversion, and README
Use Cases
lookup.
Only stop to ask when a missing fact blocks safe execution, such as an unknown real base URL for a command that must run against a live deployment. If the user only needs docs or templates, use the placeholder path rules below.
默认执行操作而非仅给出指引。当用户表达执行意图时,直接完成相应改动:运行所需的shell命令、编辑实际文件并验证结果,不要仅回复示例命令。除非用户明确要求仅进行解释,否则将「配置」、「搭建」、「关联配置」、「修改」、「添加」、「修复」、「迁移」、「部署」、「运行」或「让这个使用Xget」这类请求视为执行意图。
首先确定基础URL:
  1. 使用用户明确提供的域名
  2. 否则使用环境变量中的
    XGET_BASE_URL
  3. 若两者都不存在,询问用户的Xget基础URL,以及应该仅为当前shell/会话临时设置,还是为未来的shell持久化设置
  4. 仅当文档或模板还没有实际部署时,才使用
    https://xget.example.com
    作为明确标注的占位符
获取实时平台数据、URL转换、README「用例」查询时,优先使用
scripts/xget.mjs
,不要手动猜测。
仅当缺少必要信息导致无法安全执行时才停下来询问,比如针对实际部署运行的命令缺少对应的真实基础URL。如果用户仅需要文档或模板,请遵守下方的占位符路径规则。

Workflow

工作流

  1. Classify the task before reaching for examples:
    • execution intent: the user wants commands run, files changed, or config applied now
    • guidance intent: the user explicitly wants examples, explanation, or a template without applying it yet
    • then bucket the technical area: one-off URL conversion or prefix lookup; Git or download-tool acceleration; package-manager or language-ecosystem configuration; container image, Dockerfile, Kubernetes, or CI/CD acceleration; AI SDK / inference API base-URL configuration; deploying or self-hosting Xget itself
  2. Complete the base-URL preflight above. If the user wants help setting
    XGET_BASE_URL
    , open the reference guide and:
    • when the user asked you to set or wire it, run the shell-appropriate temporary or persistent commands directly when the environment allows it
    • when you cannot safely execute, ask the smallest blocking question or give the exact command with the missing value clearly called out
  3. Pull live README guidance in two steps instead of loading the whole section by default:
    • list candidate headings with
      node scripts/xget.mjs topics --format json
    • narrow with
      --match
      or fetch a specific section with
      node scripts/xget.mjs snippet --base-url https://xget.example.com --heading "Docker Compose Configuration" --format text
  4. Prefer the smallest relevant live subsection. If a repeated child heading like
    Use in Project
    is ambiguous, fetch its parent section instead.
  5. Adapt the live guidance to the user's real task:
    • for execution intent, apply the change end-to-end instead of stopping at example commands
    • run commands yourself when the request is to install, configure, rewrite, switch, migrate, test, or otherwise perform the change
    • edit the actual config or source files when the user wants implementation, not just explanation
    • keep shell commands aligned with the user's OS and shell
    • preserve existing project conventions unless the user asked for a broader rewrite
    • after changing files or running commands, perform a lightweight verification step when practical
  6. Refresh the live platform map with
    node scripts/xget.mjs platforms --format json
    when the answer depends on current prefixes, and use
    convert
    for exact URL rewrites.
  7. Combine multiple live sections when the workflow spans multiple layers. For example, pair a package-manager section with container, deployment, or
    .env
    guidance when the user's project needs more than one integration point.
  8. Before finishing, sanity-check that every command, file edit, or example uses the right Xget path shape:
    • repo/content:
      /{prefix}/...
    • crates.io HTTP URLs:
      /crates/...
      rather than
      /crates/api/v1/crates/...
    • inference APIs:
      /ip/{provider}/...
    • OCI registries:
      /cr/{registry}/...
  9. If the live platform fetch fails or an upstream URL does not match any known platform, say so explicitly and fall back to the stable guidance in
    references/REFERENCE.md
    instead of inventing a prefix.
  1. 在查找示例前先对任务进行分类:
    • 执行意图:用户希望立即运行命令、修改文件或应用配置
    • 指导意图:用户明确需要示例、解释或模板,暂不应用
    • 然后划分技术领域:一次性URL转换或前缀查询;Git或下载工具加速;包管理器或语言生态配置;容器镜像、Dockerfile、Kubernetes或CI/CD加速;AI SDK/推理API基础URL配置;部署或自托管Xget本身
  2. 完成上述基础URL预检步骤。如果用户需要帮助设置
    XGET_BASE_URL
    ,打开参考指南并:
    • 若用户要求你设置或关联该变量,环境允许的情况下直接运行对应shell的临时或持久化设置命令
    • 若无法安全执行,询问最少的阻塞性问题,或给出明确标注缺失值的准确命令
  3. 分两步拉取实时README指引,不要默认加载整个板块:
    • node scripts/xget.mjs topics --format json
      列出候选标题
    • --match
      筛选,或用
      node scripts/xget.mjs snippet --base-url https://xget.example.com --heading "Docker Compose Configuration" --format text
      获取指定章节内容
  4. 优先选择最小的相关实时子章节。如果「在项目中使用」这类重复子标题存在歧义,改为获取其父章节内容
  5. 将实时指引适配到用户的实际任务中:
    • 针对执行意图,端到端完成改动,不要停在示例命令阶段
    • 当请求是安装、配置、重写、切换、迁移、测试或执行其他改动时,自行运行对应命令
    • 当用户需要实现而非仅解释时,编辑实际的配置或源代码文件
    • 保持shell命令与用户的操作系统和shell类型匹配
    • 保留现有项目约定,除非用户要求更广泛的重写
    • 修改文件或运行命令后,可行的情况下执行轻量级验证步骤
  6. 如果答案依赖于当前前缀,用
    node scripts/xget.mjs platforms --format json
    刷新实时平台映射,使用
    convert
    进行精确的URL重写
  7. 当工作流跨多个层级时,组合多个实时章节内容。比如用户的项目需要多个集成点时,将包管理器章节与容器、部署或
    .env
    指引结合使用
  8. 完成前,对所有命令、文件编辑或示例进行合理性校验,确保使用了正确的Xget路径格式:
    • 仓库/内容:
      /{prefix}/...
    • crates.io HTTP URLs:
      /crates/...
      而非
      /crates/api/v1/crates/...
    • 推理API:
      /ip/{provider}/...
    • OCI镜像仓库:
      /cr/{registry}/...
  9. 如果实时平台拉取失败,或者上游URL与任何已知平台不匹配,明确告知用户,转而使用
    references/REFERENCE.md
    中的稳定指引,不要自行编造前缀。