원클릭으로
add-oclif-command
Add a new OCLIF command to a CLI package with proper base class, flags, args, and post-creation steps
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Add a new OCLIF command to a CLI package with proper base class, flags, args, and post-creation steps
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | add-oclif-command |
| description | Add a new OCLIF command to a CLI package with proper base class, flags, args, and post-creation steps |
| disable-model-invocation | true |
Guided workflow to add a command to an existing CLI package.
Ask the user for:
status or git/status (slash = topic nesting)CommandWithConfig (default) or GitCommand (for git operations) — both from @tylerbu/cli-apiCreate packages/<pkg>/src/commands/<name>.ts:
import { Args, Flags } from "@oclif/core";
import { CommandWithConfig } from "@tylerbu/cli-api";
export default class CommandName extends CommandWithConfig<typeof CommandName> {
public static override readonly description = "Description here";
public static override readonly flags = {
// Add flags here
...CommandWithConfig.flags,
};
public static override readonly args = {
// Add args here
};
public override async run(): Promise<void> {
const { args, flags } = this;
// Implementation
}
}
For git commands, use GitCommand instead — it provides this.git (simple-git instance).
# Compile
pnpm nx run <pkg>:build:compile
# Test with dev binary
./packages/<pkg>/bin/dev.js <command> --help
# Regenerate manifest
pnpm nx run <pkg>:build:manifest
# Regenerate README
pnpm nx run <pkg>:build:readme
# Regenerate command snapshots
./packages/<pkg>/bin/dev.js snapshot:generate --filepath test/commands/__snapshots__/commands.json
# Verify snapshots match
./packages/<pkg>/bin/dev.js snapshot:compare --filepath test/commands/__snapshots__/commands.json
# Full build to ensure everything links
pnpm nx run <pkg>:build
# Run tests
pnpm nx run <pkg>:test
# Policy check
./packages/repopo/bin/dev.js check
this.log() for stdout, this.warn() for warnings, this.error() for fatal errors (exits)...BaseClass.flags to inherit base flagsCreate changesets for pending changes by analyzing git diff and commit history
Audit workspace dependencies for version mismatches, unused packages, and sync issues across all packages
Fix all repository policy violations
Run Nx affected commands for the current changes
Reference for Nx task architecture, orchestration patterns, and how to add or modify build tasks
Reference for OCLIF command patterns, base classes, and conventions used in CLI packages