Yeachan-Heo/oh-my-codex · error · Error
Usage: omx team api <operation> [--input <json>] [--json]\nS
Error message
Usage: omx team api <operation> [--input <json>] [--json]\nSupported operations: ${TEAM_API_OPERATIONS.join(', ')} What it means
Thrown by parseTeamApiArgs when the first argument to `omx team api` does not resolve to a known TeamApiOperation (empty or unrecognized). It's a usage error that also lists the supported operations via TEAM_API_OPERATIONS.join(', ').
Source
Thrown at src/cli/team.ts:526
export interface ParsedTeamStartArgs {
parsed: ParsedTeamArgs;
worktreeMode: WorktreeMode;
}
function resolveDefaultTeamWorktreeMode(mode: WorktreeMode): WorktreeMode {
if (mode.enabled) return mode;
return { enabled: true, detached: true, name: null };
}
function parseTeamApiArgs(args: string[]): {
operation: TeamApiOperation;
input: Record<string, unknown>;
json: boolean;
} {
const operation = resolveTeamApiOperation(args[0] || '');
if (!operation) {
throw new Error(`Usage: omx team api <operation> [--input <json>] [--json]\nSupported operations: ${TEAM_API_OPERATIONS.join(', ')}`);
}
let input: Record<string, unknown> = {};
let json = false;
for (let i = 1; i < args.length; i += 1) {
const token = args[i];
if (token === '--json') {
json = true;
continue;
}
if (token === '--input') {
const next = args[i + 1];
if (!next) throw new Error('Missing value after --input');
try {
const parsed = JSON.parse(next) as unknown;
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
throw new Error('input must be a JSON object');
}
input = parsed as Record<string, unknown>;View on GitHub (pinned to 3ad79a8a6f)
Solutions
- Run with one of the operations listed in the error message (TEAM_API_OPERATIONS).
- Check the current TEAM_API_OPERATIONS constant/source for your installed version to confirm available names.
- Update scripts/aliases that reference a renamed operation.
Example fix
# before omx team api get-member --json # after omx team api <supported-operation> --json # e.g. one of the names in the error message
Defensive patterns
Strategy: validation
Validate before calling
if (!TEAM_API_OPERATIONS.includes(args[0])) {
console.error('Supported operations: ' + TEAM_API_OPERATIONS.join(', '));
process.exit(2);
} Type guard
const isTeamApiOperation = (v: string): v is TeamApiOperation => (TEAM_API_OPERATIONS as readonly string[]).includes(v);
Try / catch
try { await teamApi(args); } catch (e) {
if (e instanceof Error && e.message.startsWith('Usage: omx team api')) { /* show help, exit 2 */ }
else throw e;
} Prevention
- Derive operation names from TEAM_API_OPERATIONS rather than hardcoding.
- Add a `--help` check or tab-completion for operations instead of guessing.
When it happens
Trigger: Running `omx team api` with no operation, or with a misspelled/unknown operation such as `omx team api list-member` when the supported set doesn't include it.
Common situations: Version drift where an operation was renamed or removed, tab-completion or scripts referencing old operation names, or forgetting the operation argument entirely.
Related errors
- --keep-policy must be one of: score_improvement, pass_only
- Unknown capabilities subcommand: ${parsed.subcommand}
- Unknown capabilities option: ${arg}
- ${flag} requires a value
- Unknown hooks subcommand: ${subcommand}
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/c13368d83a129df0.
Report an issue: GitHub.