|
| 1 | +## modapi analytics policies |
| 2 | + |
| 3 | +Get the most flagged policies |
| 4 | + |
| 5 | +### Synopsis |
| 6 | + |
| 7 | +Get the policy labels that flagged the most content in a time window, largest first, with the count in the window before. |
| 8 | + |
| 9 | +``` |
| 10 | +modapi analytics policies [flags] |
| 11 | +``` |
| 12 | + |
| 13 | +### Examples |
| 14 | + |
| 15 | +``` |
| 16 | + modapi analytics policies |
| 17 | +``` |
| 18 | + |
| 19 | +### Options |
| 20 | + |
| 21 | +``` |
| 22 | + -c, --channel string string value |
| 23 | + -h, --help help for policies |
| 24 | + -l, --limit int integer value (default 8) |
| 25 | + -p, --project-id string The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. |
| 26 | + -r, --range string The time window. '24h' is the last 24 hours, in hourly buckets. '7d', '30d' and '90d' are whole UTC days that end with today, in daily buckets. (options: 24h, 7d, 30d, 90d) (default "30d") |
| 27 | +``` |
| 28 | + |
| 29 | +### Options inherited from parent commands |
| 30 | + |
| 31 | +``` |
| 32 | + --agent-mode Enable structured errors and default TOON output for AI coding agents. Automatically enabled when a known agent environment is detected (CLAUDECODE, CURSOR_AGENT, etc.). Use --agent-mode=false to disable. |
| 33 | + --color string Control colored output: auto (color when output is a TTY), always, or never. Respects NO_COLOR and FORCE_COLOR env vars. (default "auto") |
| 34 | + -d, --debug Log request and response diagnostics to stderr |
| 35 | + --dry-run Preview API requests without sending them (no network, no OS keychain). Human preview on stderr; with -o json or --jq, one JSON object per request on stdout. Local mutation commands (auth login, auth logout and configure) make no request: they skip prompts and writes and report a no-op (stderr, or one JSON object on stdout in the machine form) |
| 36 | + -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. |
| 37 | + --include-headers Include HTTP response headers in the output |
| 38 | + --interactive Prompt for missing inputs and open guided configure/auth forms (forms fall back to line prompts on stdin off-TTY) (default true) |
| 39 | + -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') |
| 40 | + --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) |
| 41 | + --no-keyring Never read or write the OS keychain; store secrets in the config file instead (env: MODAPI_NO_KEYRING) |
| 42 | + -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") |
| 43 | + --raw-output Write --jq string results as raw text instead of JSON strings (like jq -r); non-string results stay JSON |
| 44 | + --secret-key string HTTP Bearer |
| 45 | + --server string Select a server by index (for indexed servers) or name (for named servers) |
| 46 | + --server-url string Override the default server URL |
| 47 | + --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) |
| 48 | + --usage Print the CLI Usage schema in KDL format |
| 49 | +``` |
| 50 | + |
| 51 | +### SEE ALSO |
| 52 | + |
| 53 | +* [modapi analytics](modapi_analytics.md) - Operations for analytics |
| 54 | + |
| 55 | +### Machine interface |
| 56 | + |
| 57 | +* `modapi analytics policies --usage` — this command's flags, defaults and env vars as machine-readable KDL |
| 58 | +* `modapi analytics policies --dry-run` — preview the request without OS-keychain access or a network call (human preview on stderr) |
| 59 | +* `--dry-run --output-format json` (or a caller-explicit `--jq`) writes one preview object per request as NDJSON on stdout; jq is not applied to previews |
| 60 | +* `--output-format json` or `--jq <expr>` for machine-readable live output; in agent mode errors are a JSON envelope on stderr |
| 61 | + |
| 62 | +Exit codes: 0 ok · 1 runtime · 2 usage · 3 authentication/authorization |
0 commit comments