mthds-install

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Install MTHDS method packages

安装MTHDS方法包

Install method packages from GitHub or local directories using the
mthds-agent
CLI.
使用
mthds-agent
CLI从GitHub或本地目录安装方法包。

Process

操作流程

Step 0 — CLI Check (mandatory, do this FIRST)

步骤0 — CLI检查(必须优先执行)

Run
mthds-agent --version
. The minimum required version is 0.0.13 (declared in this skill's front matter as
min_mthds_version
).
  • If the command is not found: STOP. Do not proceed. Tell the user:
The
mthds-agent
CLI is required but not installed. Install it with:
npm install -g mthds
Then re-run this skill.
  • If the version is below 0.0.13: STOP. Do not proceed. Tell the user:
This skill requires
mthds-agent
version 0.0.13 or higher (found X.Y.Z). Upgrade with:
npm install -g mthds@latest
Then re-run this skill.
  • If the version is 0.0.13 or higher: proceed to the next step.
Do not attempt manual installation. The CLI handles resolution, file placement, shim generation, and runtime setup.
No backend setup needed: This skill works without configuring inference backends or API keys. You can start building/validating methods right away. Backend configuration is only needed to run methods with live inference — use
/pipelex-setup
when you're ready.
运行
mthds-agent --version
命令,最低要求版本为0.0.13(已在本skill的前置信息中声明为
min_mthds_version
)。
  • 如果找不到该命令:立即停止操作,告知用户:
需使用
mthds-agent
CLI但尚未安装,请通过以下命令安装:
npm install -g mthds
安装完成后重新运行本skill。
  • 如果版本低于0.0.13:立即停止操作,告知用户:
本skill要求
mthds-agent
版本为0.0.13或更高(当前版本为X.Y.Z),请通过以下命令升级:
npm install -g mthds@latest
升级完成后重新运行本skill。
  • 如果版本为0.0.13或更高:继续执行下一步。
请勿尝试手动安装,CLI会自动处理依赖解析、文件放置、shim生成和运行时配置。
无需后端配置:本skill无需配置推理后端或API密钥,你可以立即开始构建/验证方法。只有在需要使用实时推理运行方法时才需要配置后端,准备就绪后可使用
/pipelex-setup
命令配置。

Step 1: Identify the Source

步骤1:确认安装源

Determine where the method package lives:
SourceSyntaxExample
GitHub (short)
org/repo
mthds-ai/contract-analysis
GitHub (full URL)
https://github.com/org/repo
https://github.com/mthds-ai/contract-analysis
Local directory
--local <path>
--local ./my-methods/
If the user provides a GitHub URL or
org/repo
string, use it as the address argument. If they point to a local directory, use
--local
.
确认方法包的存储位置:
来源语法示例
GitHub(简写)
org/repo
mthds-ai/contract-analysis
GitHub(完整URL)
https://github.com/org/repo
https://github.com/mthds-ai/contract-analysis
本地目录
--local <path>
--local ./my-methods/
如果用户提供了GitHub URL或
org/repo
格式的字符串,直接将其作为地址参数。如果用户指向本地目录,则使用
--local
参数。

Step 2: Choose Install Parameters

步骤2:选择安装参数

FlagRequiredValuesDescription
--agent
Yes
claude-code
,
cursor
,
codex
AI agent to install for
--location
Yes
local
,
global
local
= project
.claude/methods/
,
global
=
~/.claude/methods/
--method <name>
Nomethod nameInstall only one method from a multi-method package
--skills
NoAlso install the MTHDS skills plugin
--no-runner
NoSkip automatic Pipelex runtime installation
Defaults:
  • Use
    --agent claude-code
    (since this skill runs inside Claude Code)
  • Use
    --location local
    unless the user explicitly asks for global install
参数是否必填可选值说明
--agent
claude-code
,
cursor
,
codex
要为其安装方法包的AI agent
--location
local
,
global
local
= 项目
.claude/methods/
目录,
global
=
~/.claude/methods/
目录
--method <name>
方法名称从包含多个方法的包中仅安装指定的单个方法
--skills
同时安装MTHDS skills插件
--no-runner
跳过自动安装Pipelex运行时
默认值
  • 默认使用
    --agent claude-code
    (因为本skill运行在Claude Code中)
  • 默认使用
    --location local
    ,除非用户明确要求全局安装

Step 3: Run the Install

步骤3:执行安装

From GitHub:
bash
mthds-agent install <org/repo> --agent claude-code --location local
From a local directory:
bash
mthds-agent install --local <path> --agent claude-code --location local
Install a specific method from a multi-method package:
bash
mthds-agent install <org/repo> --agent claude-code --location local --method <name>
Install with skills plugin:
bash
mthds-agent install <org/repo> --agent claude-code --location local --skills
从GitHub安装
bash
mthds-agent install <org/repo> --agent claude-code --location local
从本地目录安装
bash
mthds-agent install --local <path> --agent claude-code --location local
从包含多个方法的包中安装指定方法
bash
mthds-agent install <org/repo> --agent claude-code --location local --method <name>
同时安装skills插件
bash
mthds-agent install <org/repo> --agent claude-code --location local --skills

Step 4: Present Results

步骤4:展示安装结果

On success, the CLI returns JSON:
json
{
  "success": true,
  "installed_methods": ["method-name"],
  "location": "local",
  "target_dir": "/path/to/.claude/methods",
  "installed_skills": [],
  "shim_dir": "~/.mthds/bin",
  "shims_generated": ["method-name"]
}
Present to the user:
  • Which methods were installed and where (
    target_dir
    )
  • If CLI shims were generated, note the shim directory and advise adding
    ~/.mthds/bin
    to PATH if not already present
  • If skills were installed, mention they are now available
安装成功时,CLI会返回如下JSON格式内容:
json
{
  "success": true,
  "installed_methods": ["method-name"],
  "location": "local",
  "target_dir": "/path/to/.claude/methods",
  "installed_skills": [],
  "shim_dir": "~/.mthds/bin",
  "shims_generated": ["method-name"]
}
向用户告知以下信息:
  • 安装了哪些方法,以及安装位置(
    target_dir
  • 如果生成了CLI shim,说明shim的存储目录,建议如果
    ~/.mthds/bin
    还未加入PATH则添加进去
  • 如果安装了skills,说明skills现在已经可用

Step 5: Handle Errors

步骤5:错误处理

When encountering errors, re-run with
--log-level debug
for additional context:
bash
mthds-agent --log-level debug install <org/repo> --agent claude-code --location local
Common errors:
ErrorCauseFix
--agent is required
Missing
--agent
flag
Add
--agent claude-code
--location is required
Missing
--location
flag
Add
--location local
or
--location global
Unknown agent
Invalid agent IDUse one of:
claude-code
,
cursor
,
codex
Failed to resolve methods
GitHub repo not found or no methods in repoVerify the address and that the repo contains METHODS.toml
Method "X" not found
--method
filter doesn't match any method in the package
Check available method names in the package
Failed to install pipelex runtime
Runtime install failed (network, permissions)Retry, or use
--no-runner
to skip runtime install
For all error types and recovery strategies, see Error Handling Reference.
遇到错误时,添加
--log-level debug
参数重新运行命令以获取更多上下文信息:
bash
mthds-agent --log-level debug install <org/repo> --agent claude-code --location local
常见错误:
错误信息原因解决方案
--agent is required
缺少
--agent
参数
添加
--agent claude-code
参数
--location is required
缺少
--location
参数
添加
--location local
--location global
参数
Unknown agent
无效的agent ID使用以下可选值之一:
claude-code
,
cursor
,
codex
Failed to resolve methods
找不到GitHub仓库,或仓库中没有方法验证地址是否正确,且仓库中包含METHODS.toml文件
Method "X" not found
--method
筛选条件匹配不到包中的任何方法
检查包中可用的方法名称
Failed to install pipelex runtime
运行时安装失败(网络、权限问题)重试,或使用
--no-runner
参数跳过运行时安装
完整的错误类型和修复策略请参考错误处理参考

Reference

参考资料

  • Error Handling — read when CLI returns an error to determine recovery
  • MTHDS Agent Guide — read for CLI command syntax or output format details
  • 错误处理 — CLI返回错误时查阅以确定修复方案
  • MTHDS Agent指南 — 查阅CLI命令语法或输出格式的详细说明