# MP Sentinel — Commands Cheat Sheet

## `create-skills` — Generate agent/IDE skill files

| Flag | Description | Default |
|------|-------------|---------|
| `--agent <ids>` | Comma-separated: claude,cursor,codex,windsurf,antigravity,cline,aider,continue,roo,copilot,zed,jetbrains,generic | Auto-detect |
| `--all-agents` | Generate for all 12 registered non-generic adapters | false |
| `--force` | Overwrite existing files | false |
| `--skip-index-refresh` | Use existing index cache; fail if absent | false |
| `--dry-run` | Preview output without writing | false |
| `--check` | Verify files are up-to-date (exit 0/1) | false |
| `--no-ai-enrich` | Disable AI enrichment | false |
| `--no-code-samples` | Skip code sample loading in AI enrichment | false |
| `--format <fmt>` | Output: `console` or `json` | console |
| `--explain-agents` | Diagnostic: show detected agents | false |
| `--doctor` | Diagnostic: comprehensive health check | false |

### Exit codes

| Code | Meaning |
|------|---------|
| 0 | Success (or all up-to-date in --check mode) |
| 1 | Skipped (--force not set) / stale (--check) |
| 2 | Runtime error |

## `indexing` — Build source index

| Flag | Description | Default |
|------|-------------|---------|
| `--force` | Rebuild from scratch | false |
| `--health` | Index health diagnostics | false |
| `--recovered` | List files parsed via fallback | false |
| `--parse-errors` | List files with hard parse errors | false |
| `--agent-context <file>` | Per-file diagnostics | - |
| `--explain-index <file>` | Full parser diagnostics | - |
| `--find-symbol <name>` | Locate symbol in index | - |
| `--find-import <pkg>` | Find files importing a package | - |
| `--find-code <query>` | Search indexed code snippets | - |
| `--stats` | Aggregate index statistics | false |
| `--index-format <fmt>` | Output: `console` or `json` | console |
| `--full-index` | JSON export: hydrate sidecar payloads (codeSearch, calls) instead of printing the compact core | off |

## `review` — Review changes

| Flag | Description | Default |
|------|-------------|---------|
| `--files <paths>` | Explicit file paths to review | auto |
| `--local` | Review local changes | false |
| `--interactive` | Interactive review | false |
| `--format <fmt>` | Output: `console`, `json`, `markdown`, `sarif` | console |
| `--bypass-keyword <kw>` | Staging bypass keyword | skip: |
| `--severity-threshold <lvl>` | FAIL threshold: `CRITICAL`, `WARNING`, `INFO` | WARNING |

## Root CLI

| Flag | Description |
|------|-------------|
| `--explain-context` | Review context diagnostics |
| `--format json` | JSON output for all modes |
| `--quiet` | Suppress non-JSON output |
| `--verbose` | Detailed logging |

## `init` — Scaffold .mp-sentinelrc.json

| Flag | Description |
|------|-------------|
| `--force` | Overwrite an existing config |
| `--non-interactive` | Skip prompts; use proposed defaults |
| `--format json` | Machine-readable summary |

Detects tech stack via `detectTechProfile`, picks a provider from env vars (`ANTHROPIC_API_KEY`/`GEMINI_API_KEY`/`OPENAI_API_KEY`), enables the GitHub MCP preset if `GITHUB_TOKEN` is set, and writes a config that passes `ProjectConfigSchema`. Refuses to overwrite without `--force` (exit 1).

## Config (.mp-sentinelrc.json)

### createSkills.policies

```json
{
  "createSkills": {
    "policies": {
      "maxFileLines": 500,
      "warnFileLines": 350,
      "maxFunctionLines": 80,
      "maxParams": 5,
      "maxCyclomaticHint": 12,
      "forbidDefaultExports": false
    }
  }
}
```

### createSkills.ai

```json
{
  "createSkills": {
    "ai": {
      "enabled": true,
      "provider": "openai",
      "model": "gpt-5.2",
      "temperature": 0.2,
      "maxTokens": 4096
    }
  }
}
```
