{"_id":"@bagusardin25/sherlock-cli","_rev":"2-55259ef5db4a2de8a2a30e952b6ba1db","name":"@bagusardin25/sherlock-cli","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@bagusardin25/sherlock-cli","version":"1.0.0","keywords":["sherlock","incident-response","ai","ibm-bob","cli","devops","sre"],"author":{"name":"Bagus Ardin"},"license":"MIT","_id":"@bagusardin25/sherlock-cli@1.0.0","maintainers":[{"name":"bagusardinprayoga","email":"bagusardinp@gmail.com"}],"homepage":"https://github.com/bagusardin25/Sherlock-AI-Incident-Response-Co-pilot#readme","bugs":{"url":"https://github.com/bagusardin25/Sherlock-AI-Incident-Response-Co-pilot/issues"},"bin":{"sherlock":"dist/index.js"},"dist":{"shasum":"a9b1e405cdb9d630a448a5b7e06ba20a9635ff00","tarball":"https://registry.npmjs.org/@bagusardin25/sherlock-cli/-/sherlock-cli-1.0.0.tgz","fileCount":37,"integrity":"sha512-yIYVQzkDL6pjFceVlXZLB/ZuR180xkxqpvS1wbFoN+vuLAjoZq+Dwqm12hqI785S53jnzULYohbqQqsU/lvfWA==","signatures":[{"sig":"MEQCIAeFB/xr7gYjk/cMeaedm0EgmIM/eg15z6cjMe597XfCAiAbP8iYEmGyFA/uYHTtQqQDSAEgKkDIgFlEGvN7JqezRw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":95802},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"66d207adef8255cefc2341a06827449479d50282","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"bagusardinprayoga","email":"bagusardinp@gmail.com"},"repository":{"url":"git+https://github.com/bagusardin25/Sherlock-AI-Incident-Response-Co-pilot.git","type":"git"},"_npmVersion":"10.9.3","description":"Sherlock AI Incident Response Co-pilot CLI — from alert to fix PR in seconds","directories":{},"_nodeVersion":"22.18.0","dependencies":{"ora":"8.1.1","axios":"1.7.9","chalk":"5.4.1","dotenv":"^17.4.2","commander":"12.1.0","eventsource":"2.0.2","@inquirer/prompts":"^8.4.3"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"5.7.2","@types/node":"22.10.2","@types/eventsource":"1.1.15"},"_npmOperationalInternal":{"tmp":"tmp/sherlock-cli_1.0.0_1778946540241_0.44884310411866624","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@bagusardin25/sherlock-cli","version":"1.0.2","description":"Sherlock AI Incident Response Co-pilot CLI — from alert to fix PR in seconds","author":{"name":"Bagus Ardin"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bagusardin25/Sherlock-AI-Incident-Response-Co-pilot.git"},"keywords":["sherlock","incident-response","ai","ibm-bob","cli","devops","sre"],"main":"dist/index.js","bin":{"sherlock-cli":"dist/index.js","sherlock":"dist/index.js"},"scripts":{"build":"tsc","dev":"tsc --watch","start":"node dist/index.js","postinstall":"node scripts/postinstall.js","prepublishOnly":"npm run build"},"dependencies":{"@inquirer/prompts":"^8.4.3","axios":"1.7.9","chalk":"5.4.1","commander":"12.1.0","dotenv":"^17.4.2","eventsource":"2.0.2","ora":"8.1.1"},"devDependencies":{"@types/eventsource":"1.1.15","@types/node":"22.10.2","typescript":"5.7.2"},"type":"module","_id":"@bagusardin25/sherlock-cli@1.0.2","gitHead":"36321b8f1bd8d08578c395b2fb89ee233aca6a6e","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/bagusardin25/Sherlock-AI-Incident-Response-Co-pilot/issues"},"homepage":"https://github.com/bagusardin25/Sherlock-AI-Incident-Response-Co-pilot#readme","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-f3HDiXMYUeUrjSnrkrz6q9YWnMlzBR735LwPW4nPs+Qf/G6QWqVe3biW3lzl1YVDuNYwT8qFDglTrIKcbHUgiA==","shasum":"ccc6dbdce9f181148d8590f0fc0765cf063fbfbc","tarball":"https://registry.npmjs.org/@bagusardin25/sherlock-cli/-/sherlock-cli-1.0.2.tgz","fileCount":38,"unpackedSize":98901,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDAmq+LI+XQ5DZqK5VSH6Q3bmuOqn2avO8BselTcALbDAiEA6D/96qld/23c9dD1uf7vKVGbw5nIkUo6ctfexgxaMhA="}]},"_npmUser":{"name":"bagusardinprayoga","email":"bagusardinp@gmail.com"},"directories":{},"maintainers":[{"name":"bagusardinprayoga","email":"bagusardinp@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sherlock-cli_1.0.2_1778971464598_0.46535974263656343"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-16T15:49:00.149Z","modified":"2026-05-16T22:44:24.915Z","1.0.0":"2026-05-16T15:49:00.373Z","1.0.2":"2026-05-16T22:44:24.757Z"},"bugs":{"url":"https://github.com/bagusardin25/Sherlock-AI-Incident-Response-Co-pilot/issues"},"author":{"name":"Bagus Ardin"},"license":"MIT","homepage":"https://github.com/bagusardin25/Sherlock-AI-Incident-Response-Co-pilot#readme","keywords":["sherlock","incident-response","ai","ibm-bob","cli","devops","sre"],"repository":{"type":"git","url":"git+https://github.com/bagusardin25/Sherlock-AI-Incident-Response-Co-pilot.git"},"description":"Sherlock AI Incident Response Co-pilot CLI — from alert to fix PR in seconds","maintainers":[{"name":"bagusardinprayoga","email":"bagusardinp@gmail.com"}],"readme":"# Sherlock CLI\r\n\r\n> Interactive incident-response shell for the Sherlock AI co-pilot.\r\n> Powered by IBM Bob repository intelligence.\r\n\r\n```\r\n╔════════════════════════════════════════════════════════╗\r\n║ Sherlock Incident Response Shell                       ║\r\n║ Powered by IBM Bob repository intelligence             ║\r\n╚════════════════════════════════════════════════════════╝\r\n\r\nConnected to local backend (http://localhost:8000)\r\nWorkspace      production\r\nAuthenticated  yes\r\n\r\nType /help for available commands\r\n\r\nsherlock ›\r\n```\r\n\r\nThe CLI is the on-call surface of Sherlock. Paste an alert, type `/resolve`,\r\nand watch a five-agent pipeline (triage → forensics → analyst → fix →\r\npostmortem) reason through your repository and produce a fix PR + postmortem.\r\n\r\n---\r\n\r\n## Quick start\n\n```bash\nnpm install -g @bagusardin25/sherlock-cli\nsherlock-cli\n```\n\nFirst login:\n\n```bash\nsherlock-cli auth login\n```\n\nThis opens the Sherlock web login. Create an API key in Settings > API Keys,\nthen paste the key back into the CLI. The `sherlock` alias is also available.\n\n### Mock mode (no backend needed)\n\n```bash\nSHERLOCK_MOCK=true sherlock-cli\n```\n\r\nMock mode runs a deterministic ~24-second pipeline with realistic pacing,\r\nvaried confidence scores, and a sample fix patch. Ideal for demos.\r\n\r\n---\r\n\r\n## Interactive shell\r\n\r\nRun `sherlock-cli` with no arguments. The shell shows a session header with\nyour workspace, auth state, and connection mode, then drops you at the\r\n`sherlock ›` prompt.\r\n\r\nAfter `/resolve` succeeds, the prompt switches to:\r\n\r\n```\r\nsherlock(inc-6x2rxd) ›\r\n```\r\n\r\n…and `/fix`, `/postmortem`, and `/open` automatically use that incident.\r\nNo need to retype the ID.\r\n\r\n### Slash commands\r\n\r\n| Command | Description |\r\n| --- | --- |\r\n| `/resolve <file>` | Run the full incident pipeline on an alert file or raw text |\r\n| `/status [id]` | List recorded incidents, or show full detail for one |\r\n| `/fix [id]` | Show the generated patch, files modified, regression test status |\r\n| `/postmortem [id]` | Render the incident report (markdown) |\r\n| `/open [id]` | Open the incident in the web dashboard (default browser) |\r\n| `/history` | Recent incidents resolved in this session |\r\n| `/auth login` | Open web login and save an API key |\n| `/auth status` | Show current auth state and endpoint |\r\n| `/auth logout` | Remove stored credentials |\r\n| `/clear` | Clear the screen |\r\n| `/help` | Show the slash command reference |\r\n| `/exit` | Leave the shell (also `Ctrl+D`) |\r\n\r\n### Demo flow (3 minutes)\r\n\r\n```\r\nsherlock ›  /resolve fixtures/alerts/alert_race_condition.json\r\n\r\n[TRIAGE] Critical severity detected\r\n    TypeError on async inventory access during checkout\r\n  Severity      HIGH\r\n  Service       checkout-service\r\n  Error type    race_condition\r\n  Confidence: 95%\r\n\r\n[FORENSICS] Suspicious commit detected\r\n  Evidence:\r\n    • 12 commits within incident time window\r\n    • checkout.ts modified 3 days before first occurrence\r\n    • no corresponding test changes in the same PR\r\n  Suspect commit  8f3ab21 — refactor async payment validation (alice)\r\n\r\n[ANALYST] Root cause identified\r\n  Hypothesis:\r\n    Race condition introduced during async checkout refactor — inventory\r\n    fetch is not awaited before decrement, returning a Promise instead of\r\n    inventory data.\r\n  Evidence:\r\n    • stack trace correlation: TypeError on undefined.quantity\r\n    • commit timeline analysis: 8f3ab21 removed `await` keyword\r\n    • dependency graph: getInventory() returns Promise<Inventory>\r\n    • no failing test guards this async boundary\r\n  Confidence: 87%\r\n\r\n[FIX] Patch generated\r\n  PR title  fix: await inventory fetch in checkout flow\r\n  Files     src/cart/checkout.ts, src/cart/checkout.test.ts\r\n  Tests     regression test included\r\n  Patch:\r\n    @@ -39,7 +39,7 @@\r\n    -  const inventory = getInventory(productId);\r\n    +  const inventory = await getInventory(productId);\r\n\r\n[POSTMORTEM] Incident report completed\r\n\r\n✓ Investigation complete · incident inc-6x2rxd · 24.1s\r\n  Root cause in 4.5s · patch in 3.8s\r\n\r\nActive incident: inc-6x2rxd\r\nNext: /fix · /postmortem\r\n\r\nsherlock(inc-6x2rxd) ›  /open\r\nOpening inc-6x2rxd in dashboard…\r\nhttps://sherlockai-ibm.vercel.app/incidents/inc-6x2rxd\n✓ Launched.\r\n```\r\n\r\n---\r\n\r\n## One-shot mode\r\n\r\nUseful in CI/CD pipelines or scripts:\r\n\r\n```bash\r\nsherlock resolve crash.log --repo https://github.com/org/service\r\nsherlock status                       # list\r\nsherlock status inc-a1b2c3d4          # detail\r\nsherlock fix inc-a1b2c3d4 --output fix.patch\r\nsherlock postmortem inc-a1b2c3d4 --output incident.md\r\nsherlock auth login\r\n```\r\n\r\nEvery one-shot command uses the same renderer as the interactive shell, so\r\noutput is consistent regardless of how it is invoked.\r\n\r\n---\r\n\r\n## Authentication\r\n\r\nCredentials live in `~/.sherlock/config.json`. Get an API key from the\r\ndashboard (Settings → API Keys), then:\r\n\r\n```bash\r\nsherlock auth login\r\n# or, inside the shell:\r\nsherlock ›  /auth login\r\n```\r\n\r\nKeys are masked in display:\r\n\r\n```\r\nSherlock CLI · Auth Status\r\n──────────────────────────\r\n\r\n✓ Authenticated\r\nKey       sk_sherlock_••••••••••••••••••••••••••••••••\r\nEndpoint  http://localhost:8000\r\nConfig    ~/.sherlock/config.json\r\nStatus    Connected to local backend (http://localhost:8000)\r\n```\r\n\r\n---\r\n\r\n## Configuration\r\n\r\n| Environment variable | Purpose | Default |\r\n| --- | --- | --- |\r\n| `SHERLOCK_API_URL` | Backend URL | `http://localhost:8000` |\r\n| `SHERLOCK_API_KEY` | Auth key (overrides config file) | — |\r\n| `SHERLOCK_MOCK` | `true` to force mock mode | `false` |\r\n| `SHERLOCK_DASHBOARD_URL` | URL `/open` launches | `https://sherlockai-ibm.vercel.app` |\n| `SHERLOCK_WORKSPACE` | Label shown in session header | `production` |\r\n\r\nThe CLI also accepts `--mock` on the command line for one-shot calls.\r\n\r\n---\r\n\r\n## Architecture\r\n\r\n```\r\nsrc/\r\n├── index.ts                # Entry point: shell when no args, Commander otherwise\r\n├── commands/               # Commander wrappers (one-shot mode)\r\n│   ├── auth.ts             # Login/status/logout + reusable helpers\r\n│   ├── investigate.ts      # `sherlock resolve <file>`\r\n│   ├── status.ts\r\n│   ├── fix.ts\r\n│   └── postmortem.ts\r\n├── shell/                  # Interactive shell\r\n│   ├── repl.ts             # readline loop, banner, dynamic prompt\r\n│   ├── session.ts          # workspace, mode, active incident, history\r\n│   ├── commands.ts         # Slash command dispatcher\r\n│   ├── pipeline.ts         # Reusable streaming runner (mock or SSE)\r\n│   ├── render.ts           # [AGENT] tags, hypothesis/evidence renderer\r\n│   └── views.ts            # Shared incident list/detail/fix/postmortem views\r\n├── services/\r\n│   ├── api.ts              # Backend HTTP client\r\n│   ├── mock.ts             # Deterministic pipeline for offline demos\r\n│   └── client.ts           # Mock-vs-backend resolver\r\n└── utils/\r\n    └── opener.ts           # Cross-platform browser launcher\r\n```\r\n\r\nThe same `runResolvePipeline` and `view*` functions back both the shell and\r\nthe one-shot commands — visual output is identical.\r\n\r\n---\r\n\r\n## Design principles\r\n\r\n- **Banner only for cinematic surfaces**: bare `sherlock`, `sherlock --help`,\r\n  `sherlock resolve`. Auth and admin commands stay clean.\r\n- **Slash commands inside the shell**: `/resolve`, `/fix`, `/auth login` —\r\n  AI-native UX, similar to Claude Code, Codex, or Gemini CLI.\r\n- **Persistent session context**: active incident travels with the prompt;\r\n  `/fix` and `/open` use it automatically.\r\n- **One renderer, two modes**: shell and one-shot share `views.ts` so\r\n  output is consistent for both demos and automation.\r\n- **Reasoning over noise**: `[AGENT]` tags, then Hypothesis / Evidence /\r\n  Confidence — no boxy panels, no emoji clutter.\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT — built for the IBM Bob Hackathon 2026.\r\n","readmeFilename":"README.md"}