{
  "markdown": "# incidentio-cli (`incidentio`)\n\nA CLI for the [incident.io](https://incident.io/) API. incident.io has a real public API\nkeyed by Bearer tokens, so this talks to `api.incident.io` directly — no browser, no cookies.\nEvery command is **generated from incident.io's official OpenAPI specs**, so the full\ndocumented surface (~179 public endpoints across 53 resources, plus internal dashboard commands) is covered.\n\n## Install\n\n**Homebrew** (no Bun required — installs a prebuilt binary):\n\n```sh\nbrew install paymog/tap/incidentio   # provides the `incidentio` command\n```\n\n**Bun** (if you have [Bun](https://bun.sh) — installs straight from GitHub):\n\n```sh\nbun install -g github:paymog/incidentio-cli\n```\n\n**From source:**\n\n```sh\nbun install\nbun run build        # produces ./incidentio for the current platform\nbun run build:all    # cross-compile dist/ binaries (darwin/linux, arm64/x64)\n```\n\nOr run without building: `bun run src/cli.ts <command>`.\n\n## Auth\n\nTwo auth modes — the CLI picks per command automatically:\n\n- **Public API** (`api.incident.io/v*`, Bearer key): most commands. Create a key at\n  **Settings → API keys** (`app.incident.io/settings/api-keys`); scopes are fixed at creation.\n\n```sh\nincidentio auth set <api-key>     # store it (~/.config/incidentio/creds.json, chmod 600)\nincidentio auth status            # show key, session, org\nincidentio auth logout            # clear all credentials\n```\n\nResolution: `--api-key <key>` → `$INCIDENT_API_KEY` → stored. For CI, `export INCIDENT_API_KEY=<key>`.\n\n- **Dashboard / internal API** (`app.incident.io/api/*`, browser session): commands marked 🍪\n  in `list`. incident.io rejects API keys for these (\"Cannot use API keys to authenticate to\n  internal APIs\"), so they replay a logged-in browser session — saved views, insights,\n  policies, incident timelines, AI suggestions, debriefs, and more. Import one:\n\n```sh\n# In a logged-in app.incident.io tab: devtools → Network → right-click any /api/ request →\n# Copy as cURL. Then:\nincidentio auth import '<paste curl>'        # or: pbpaste | incidentio auth import\nincidentio auth import ./app.incident.io.har # from a HAR (cookies often stripped — prefer cURL)\nincidentio auth set-org 01G9XY4BZ7YGBPJ3K50NB30YXS   # x-incident-organisation-id\n```\n\nOrg id resolves `--org` → `$INCIDENT_ORG_ID` → stored. A `401` on a 🍪 command means the\nsession expired — re-import a fresh cookie.\n\n## Usage\n\n```sh\nincidentio list [filter]            # list every command (optionally filtered)\nincidentio list incidents           # all verbs for a resource\nincidentio <resource> <verb> [flags]\n```\n\n```sh\nincidentio incidents list --query page_size=50\nincidentio incidents show --id 01FDAG4SAP5TYPT98WGR2N7W91\nincidentio incidents create --body-json '{\"name\":\"...\",\"severity_id\":\"...\",\"visibility\":\"public\"}'\nincidentio users list --query email=alice@example.com\nincidentio heartbeat ping --alert-source-config-id 01FCNDV6P870EA6S7TK1DSYDG0\n```\n\n### Flags\n\n| Flag | Meaning |\n| --- | --- |\n| `--api-key <key>` | API key for this call (else `$INCIDENT_API_KEY` or stored) |\n| `--<param> <value>` | path params: `--id`, `--user-id`, `--schedule-id`, `--alert-source-config-id` |\n| `--query key=value` | query param, repeatable (incl. bracket filters like `status[one_of]=<id>`) |\n| `--body-file <path>` | JSON request body from file |\n| `--body-json '<json>'` | inline JSON request body |\n| `--set a.b=value` | set a body field, repeatable |\n| `--raw` | print the raw response, no JSON formatting |\n\nList filters use bracket keys (`status[one_of]`, `severity[gte]`, `created_at[date_range]`);\nrepeat `--query` for multi-value filters. Output is pretty-printed JSON — pipe to `jq`.\n\n## Regenerate the command catalog\n\nCommands live in `src/commands/generated.ts`, generated from incident.io's per-tag OpenAPI\nspecs:\n\n```sh\nbun run codegen\n```\n\nincident.io publishes no single OpenAPI file; instead each resource tag has a full spec at\n`docs.incident.io/openapi/tags/<tag>.json`. The generator discovers the tag set from\n`docs.incident.io/llms.txt`, fetches each tag spec, and derives a `<resource> <verb>` name per\noperation (CRUD verbs collapsed; collisions resolved, e.g. `catalog-types update-type` vs\n`update-type-schema`, `heartbeat ping` vs `ping-post`). After regenerating, rebuild.\n\nThe internal/dashboard commands live in `src/commands/generated-internal.ts`, generated\nfrom a captured browser HAR of `app.incident.io/api/*`:\n\n```sh\nbun run codegen:har ~/Downloads/app.incident.io.har  # one or more HARs\n```\n\nThese are cookie-authenticated and deduplicated against the public catalog (anything the\npublic API can do stays Bearer). The HAR only yields endpoint *shapes*; the session is\nimported separately via `auth import` (HARs from Chrome/Brave usually strip cookies, so\nprefer Copy-as-cURL).\n\n## Claude Code skill\n\nThis repo ships a [Claude Code](https://claude.com/claude-code) skill that teaches the agent\nto drive `incidentio` (auth, the command surface, bracket filters, and recipes). It lives in\n[`skills/incidentio-cli`](skills/incidentio-cli).\n\nInstall with [`npx skills`](https://github.com/vercel-labs/skills):\n\n```sh\nnpx skills add paymog/incidentio-cli            # into ./.claude/skills/\nnpx skills add paymog/incidentio-cli --global --yes\n```\n\nOr manually:\n\n```sh\ngit clone https://github.com/paymog/incidentio-cli\ncp -r incidentio-cli/skills/incidentio-cli ~/.claude/skills/incidentio-cli\n```\n\n## Release\n\nTag-driven. On a `v*` tag, GitHub Actions compiles the four binaries, attaches them to a\nGitHub Release, and updates the `incidentio` formula in `paymog/homebrew-tap` (binary\ndownload, no build deps). The tap push uses the `HOMEBREW_TAP_DEPLOY_KEY` secret.\n\n```sh\ngit tag v0.1.0\ngit push origin v0.1.0\n```\n\n## Shape\n\n- `src/cli.ts` — entry point, arg parsing, command dispatch.\n- `src/auth/store.ts` — API key storage + resolution.\n- `src/http/client.ts` — request builder, Bearer auth, error handling.\n- `src/commands/` — `Command` type and the generated catalog.\n- `src/codegen/fromOpenapi.ts` — incident.io OpenAPI specs → command catalog.\n",
  "bytes": 6070,
  "sha": "c795f06b1eca7d12378b480fb31c8e9cf0c200369ea0b6397f72511e2f3eba75",
  "repo_slug": "paymog/incidentio-cli",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/skl_paymog_incidentio_cli_incidentio_cli_acf36b63/readme"
}