xget
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseXget
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:
- use a domain the user explicitly gave
- otherwise use from the environment
XGET_BASE_URL - 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
- use only as a clearly labeled placeholder for docs or templates that do not have a real deployment yet
https://xget.example.com
Prefer over manual guessing for live platform data, URL
conversion, and README lookup.
scripts/xget.mjsUse CasesOnly 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:
- 使用用户明确提供的域名
- 若没有,则使用环境变量中的
XGET_BASE_URL - 若两者都不存在,则询问用户的Xget基准URL,以及是否要为当前Shell/会话临时设置,或是为未来的Shell持久设置
- 仅在文档或模板尚未部署真实环境时,才将作为明确标记的占位符使用
https://xget.example.com
对于实时平台数据、URL转换和README「使用场景」查询,优先使用而非手动猜测。
scripts/xget.mjs仅当缺失的信息会阻碍安全执行时才停止并询问,例如针对实时部署运行命令时未知的真实基准URL。如果用户仅需要文档或模板,请遵循以下占位符路径规则。
Workflow
工作流
- 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
- Complete the base-URL preflight above. If the user wants help setting
, open the reference guide and:
XGET_BASE_URL- 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
- 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 or fetch a specific section with
--matchnode scripts/xget.mjs snippet --base-url https://xget.example.com --heading "Docker Compose Configuration" --format text
- list candidate headings with
- Prefer the smallest relevant live subsection. If a repeated child heading
like is ambiguous, fetch its parent section instead.
Use in Project - 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
- Refresh the live platform map with
when the answer depends on current prefixes, and use
node scripts/xget.mjs platforms --format jsonfor exact URL rewrites.convert - Combine multiple live sections when the workflow spans multiple layers. For
example, pair a package-manager section with container, deployment, or guidance when the user's project needs more than one integration point.
.env - Before finishing, sanity-check that every command, file edit, or example uses
the right Xget path shape:
- repo/content:
/{prefix}/... - crates.io HTTP URLs: rather than
/crates/.../crates/api/v1/crates/... - inference APIs:
/ip/{provider}/... - OCI registries:
/cr/{registry}/...
- repo/content:
- 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.
- 在查找示例前先对任务进行分类:
- 执行意图:用户希望立即运行命令、修改文件或应用配置
- 指导意图:用户明确希望获取示例、解释或模板,暂不应用
- 然后划分技术领域:一次性URL转换或前缀查询;Git或下载工具加速;包管理器或语言生态系统配置;容器镜像、Dockerfile、Kubernetes或CI/CD加速;AI SDK/推理API基准URL配置;部署或自托管Xget本身
- 完成上述基准URL预检。如果用户需要帮助设置,打开参考指南并:
XGET_BASE_URL- 当用户要求设置或连接它时,若环境允许,直接运行适用于当前Shell的临时或持久化命令
- 若无法安全执行,则提出最关键的阻塞性问题,或给出明确标注缺失值的精确命令
- 通过两步操作获取实时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
- 使用
- 优先选择最小的相关实时子章节。如果像「在项目中使用」这类重复的子标题存在歧义,则获取其父章节。
- 根据用户的真实任务调整实时指导:
- 对于执行意图,端到端完成变更,而非仅停留在示例命令阶段
- 当请求为安装、配置、重写、切换、迁移、测试或其他变更操作时,自行运行命令
- 当用户需要实现而非仅解释时,编辑实际的配置或源文件
- 确保Shell命令与用户的操作系统和Shell兼容
- 除非用户要求进行更广泛的重写,否则保留现有项目约定
- 在修改文件或运行命令后,若可行,执行轻量级验证步骤
- 当答案依赖于当前前缀时,使用刷新实时平台映射,并使用
node scripts/xget.mjs platforms --format json进行精确的URL重写。convert - 当工作流涉及多个层级时,组合多个实时章节。例如,当用户的项目需要多个集成点时,将包管理器章节与容器、部署或指导结合使用。
.env - 完成前,检查所有命令、文件编辑或示例是否使用正确的Xget路径格式:
- 仓库/内容:
/{prefix}/... - crates.io HTTP URL:而非
/crates/.../crates/api/v1/crates/... - 推理API:
/ip/{provider}/... - OCI镜像源:
/cr/{registry}/...
- 仓库/内容:
- 若实时平台获取失败或上游URL与任何已知平台不匹配,请明确说明,并转而使用references/REFERENCE.md中的稳定指导,而非自行创建前缀。