# Major Domo - CLI Reference ## Invocation **Wrapper**: `majordomo` (alias, uses `uv run`) **Full path** (for Claude Code): ```bash python3 ~/.claude/skills/major-domo/cli.py ``` ## Flag Ordering `--env`, `--json`, `--verbose` are **top-level flags** (BEFORE subcommand). `--season` is a **subcommand flag** (AFTER subcommand). ```bash # Correct: python3 ~/.claude/skills/major-domo/cli.py --json team get CLS python3 ~/.claude/skills/major-domo/cli.py --env dev team roster CAN # Wrong (will error): python3 ~/.claude/skills/major-domo/cli.py team get CLS --json ``` ## Commands ### Status ```bash cli.py status # Current season/week cli.py health # API health check ``` ### Players ```bash cli.py player get "Mike Trout" # Get player info cli.py player search "trout" # Fuzzy search cli.py player move "Name" TEAM # Move single player cli.py player move --batch "N1:T1,N2:T2" # Batch moves ``` ### Teams ```bash cli.py team list [--active] # List teams cli.py team get CAR # Team details cli.py team roster CAR # Roster breakdown (Active/Injured List/Minor League) ``` ### Standings ```bash cli.py standings [--division ALE] # League standings ``` ### Transactions ```bash cli.py transactions --team CLS --week 9 # Team transactions cli.py transactions list --week-start 1 --week-end 4 # Week range cli.py transactions --player "Mike Trout" # Player transactions cli.py transactions simulate CLS "Stott:CLSMiL,Walker:CLS" # Compliance check (dry run) ``` ### Injuries ```bash cli.py injuries list --team CLS --active # Active injuries for team cli.py injuries list --sort return-asc # Sort by return date ``` ### Statistics ```bash cli.py stats batting --sort woba --min-pa 100 --limit 25 # Batting leaders cli.py stats pitching --sort era --min-outs 100 --limit 25 # Pitching leaders cli.py stats batting --team CLS # Team batting ``` ### Results & Schedule ```bash cli.py results --team CLS --week 9 # Team results cli.py results list --week-start 1 --week-end 4 # Range cli.py schedule --team CLS --week 10 # Team schedule cli.py schedule list --week-start 10 --week-end 12 # Range ``` ### Admin (write operations) ```bash cli.py admin recalculate-standings # Recalculate standings cli.py admin refresh-batting # Refresh batting view cli.py admin refresh-pitching # Refresh pitching view cli.py admin refresh-stats # Refresh both views cli.py admin refresh-batting --season 11 # Specific season ``` ## Key Notes - `team get` shows salary_cap in formatted output; use `--json` for all fields - `team roster` shows Active/Injured List/Minor League with WARA values for Active only - For individual player lookups, use `player get "Name"` — bulk queries can timeout - `transactions simulate` validates compliance without making changes - `stats` commands support standard baseball stats sorting (woba, obp, slg, era, whip, fip, etc.) ## Transaction Compliance Workflow ```bash # 1. Simulate proposed moves (dry run) cli.py transactions simulate CLS "Stott:CLSMiL,Walker:CLS,Castellanos:FA,Martin:CLS" # Validates: roster count = 26, total sWAR <= salary_cap, all players exist ``` **Manual verification** (if needed): 1. `cli.py team roster ABBREV` → note count and WARA 2. `cli.py --json team get ABBREV` → read `salary_cap` 3. `cli.py player get "Name"` for each incoming player 4. Calculate: current sWAR ± changes <= cap, roster = 26 5. `cli.py player move --batch "Name1:Team1,Name2:Team2"`