用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tylerbutler/tools-monorepo --skill oclif-command-guide命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | oclif-command-guide |
| description | Reference for OCLIF command patterns, base classes, and conventions used in CLI packages |
| user-invocable | false |
Reference for working with OCLIF commands in this monorepo's CLI packages (cli, dill-cli, repopo, sort-tsconfig).
CommandWithConfig — For commands that load config files. Provides --config flag and config resolution.GitCommand — For git operations. Provides this.git (simple-git instance) and git-aware error handling. Extends CommandWithConfig.Always extend one of these base classes, not raw OCLIF Command.
import { Args, Flags } from "@oclif/core";
import { GitCommand } from "@tylerbu/cli-api";
export default class MyCommand extends GitCommand<typeof > {
description = ;
flags = {
: .({ : }),
....,
};
args = {
: .({ : , : }),
};
(): <> {
{ args, flags } = ;
}
}
Commands go in src/commands/. Directory structure defines topics:
src/commands/download.ts → tbu downloadsrc/commands/git/squish.ts → tbu git squishsrc/commands/git/merge-train/preview.ts → tbu git merge-train previewAlways run these steps after changing commands:
pnpm nx run <pkg>:build:compile — Compile TypeScriptpnpm nx run <pkg>:build:manifest — Regenerate oclif.manifest.jsonpnpm nx run <pkg>:build:readme — Regenerate README command docs./packages/<pkg>/bin/dev.js snapshot:generate — Update test snapshots (if applicable)Or just run pnpm nx run <pkg>:build to execute all of these via orchestration.
./bin/dev.js <command> — runs from TypeScript source, no compile needed./bin/run.js <command> — runs from compiled esm/CLI packages declare plugins in package.json → oclif.plugins. Common ones:
@oclif/plugin-help, @oclif/plugin-autocomplete, @oclif/plugin-commands@oclif/plugin-command-snapshot — for snapshot testing@oclif/plugin-command-snapshottest/commands/__snapshots__/commands.json./bin/dev.js snapshot:generate./bin/dev.js snapshot:compare (runs during test:snapshots)