{"id":51573998,"url":"https://github.com/khoazero123/ai-local-toolkit","last_synced_at":"2026-07-10T22:31:57.640Z","repository":{"id":363950090,"uuid":"1265687283","full_name":"khoazero123/ai-local-toolkit","owner":"khoazero123","description":"Cursor \u0026 Codex hooks: webhooks on chat + auto-continue when keywords match","archived":false,"fork":false,"pushed_at":"2026-06-23T07:00:20.000Z","size":119,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-23T07:14:30.330Z","etag":null,"topics":["codex","cursor","cursor-ide","hooks","installer","webhook"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khoazero123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-11T02:05:00.000Z","updated_at":"2026-06-23T07:00:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/khoazero123/ai-local-toolkit","commit_stats":null,"previous_names":["khoazero123/agent-webhook-tracking-continues","khoazero123/ai-local-toolkit"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/khoazero123/ai-local-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khoazero123%2Fai-local-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khoazero123%2Fai-local-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khoazero123%2Fai-local-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khoazero123%2Fai-local-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khoazero123","download_url":"https://codeload.github.com/khoazero123/ai-local-toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khoazero123%2Fai-local-toolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35345661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-10T02:00:06.465Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codex","cursor","cursor-ide","hooks","installer","webhook"],"created_at":"2026-07-10T22:31:57.452Z","updated_at":"2026-07-10T22:31:57.628Z","avatar_url":"https://github.com/khoazero123.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Local Toolkit\n\nLocal automation utilities for **Cursor** and **Codex** on your machine.\n\nEach feature has its own installer and installs into its own folder under `tools/`.\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eAgent Webhook + Auto Continue\u003c/strong\u003e\u003c/summary\u003e\n\nSends webhooks when the user or agent chats, and automatically sends a continue follow-up when keywords are detected in the last 1000 characters of the agent response.\n\n### Windows (PowerShell)\n\n```powershell\nirm \"https://raw.githubusercontent.com/khoazero123/ai-local-toolkit/main/packages/agent-webhook/install.ps1\" | iex\n```\n\n### Linux / macOS\n\n```bash\ncurl -fsSL \"https://raw.githubusercontent.com/khoazero123/ai-local-toolkit/main/packages/agent-webhook/install.sh\" | bash\n```\n\nOr with `wget`:\n\n```bash\nwget -qO- \"https://raw.githubusercontent.com/khoazero123/ai-local-toolkit/main/packages/agent-webhook/install.sh\" | bash\n```\n\nAppend `?v=\u003ccommit\u003e` to the URL if your shell cached an older installer script.\n\n### Install from a local clone\n\n```powershell\ncd path\\to\\ai-local-toolkit\\packages\\agent-webhook\n.\\install.ps1\n```\n\n```bash\ncd ai-local-toolkit/packages/agent-webhook\nbash install.sh\n```\n\n### Requirements\n\n| Platform | Installer | Runtime hooks |\n|----------|-----------|---------------|\n| Windows | PowerShell 5.1+ | `.cmd` + `.ps1` in `packages/agent-webhook/runtime/windows/` |\n| Linux / macOS | `bash` | `bash` scripts in `packages/agent-webhook/runtime/unix/` |\n\n**Linux / macOS also needs:** `curl`, `jq`\n\n### Codex — trust hooks\n\nAfter installing, open Codex and run:\n\n```\n/hooks\n```\n\n### Files created\n\n| App | Tool folder | Registry |\n|-----|-------------|----------|\n| Cursor | `~/.cursor/tools/agent-webhook/` | `~/.cursor/hooks.json` |\n| Codex | `~/.codex/tools/agent-webhook/` | `~/.codex/hooks.json` |\n\nLegacy installs at `~/.cursor/hooks/` or `~/.codex/hooks/` are migrated automatically on reinstall.\n\n\u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCodex Usage + Reset Watch\u003c/strong\u003e\u003c/summary\u003e\n\nCheck Codex rate-limit usage from the CLI and run a background watcher that sends a prompt shortly after each quota reset (no Codex desktop app required).\n\n**Install folder:** `~/.codex/tools/codex-usage/`\n\n- `codex-usage.mjs` — print usage table from `/backend-api/wham/usage`\n- `codex-reset-watch.mjs` — PM2 daemon: poll usage, schedule prompt after reset + delay\n- `ecosystem.config.cjs` — PM2 config (`windowsHide: true`)\n- `codex-reset-watch-startup.ps1` — boot/logon helper\n- `register-codex-reset-watch-task.ps1` — Task Scheduler registration\n\nCodex app data (`auth.json`, `.sandbox-bin/`, `session_index.jsonl`) stays at `~/.codex/` root.\n\n### Windows — one-line install\n\n```powershell\nirm \"https://raw.githubusercontent.com/khoazero123/ai-local-toolkit/main/packages/codex-usage/install.ps1\" | iex\n```\n\nAppend `?v=\u003ccommit\u003e` to the URL if your shell cached an older installer script.\n\n### Windows — from local clone\n\n```powershell\ncd path\\to\\ai-local-toolkit\\packages\\codex-usage\n.\\install.ps1\n```\n\nThe installer will:\n\n1. Check **Node.js** — if missing, ask to install via **nvm-windows**\n2. Check **PM2** — if missing, ask to install with `npm install -g pm2`\n3. Copy runtime files to `~/.codex/tools/codex-usage/`\n4. Prompt for **webhook URL** (pre-filled from existing config if available)\n5. Optionally start the PM2 watcher\n6. Optionally register **Task Scheduler** `CodexResetWatchPM2` (boot + logon)\n\n### Manual commands (after install)\n\nCheck usage:\n\n```powershell\nnode $env:USERPROFILE\\.codex\\tools\\codex-usage\\codex-usage.mjs\n```\n\nPM2 watcher:\n\n```powershell\npm2 start $env:USERPROFILE\\.codex\\tools\\codex-usage\\ecosystem.config.cjs --only codex-reset-watch\npm2 save\npm2 status codex-reset-watch\npm2 logs codex-reset-watch\n```\n\nRegister boot task (no login required — uses SYSTEM if Windows account has no password):\n\n```powershell\npowershell -NoProfile -ExecutionPolicy Bypass -File $env:USERPROFILE\\.codex\\tools\\codex-usage\\register-codex-reset-watch-task.ps1\n```\n\nView watcher log:\n\n```powershell\nGet-Content $env:USERPROFILE\\.codex\\tools\\codex-usage\\codex-reset-watch.log -Tail 20\n```\n\n### Config\n\nEdit `~/.codex/tools/codex-usage/codex-reset-watch.config.json`:\n\n| Key | Default | Meaning |\n|-----|---------|---------|\n| `prompt` | `hi` | Message sent after reset |\n| `resetDelayMs` | `180000` | Wait 3 min after reset before send |\n| `checkIntervalMs` | `900000` | Re-check usage every 15 min |\n| `resetWindow` | `primary` | Rate-limit window to track |\n| `threadSelection` | `latest` | Resume latest Codex thread |\n| `webhookUrl` | `\"\"` | Webhook URL (empty = use `~/.codex/tools/agent-webhook/hook-config.json`) |\n| `notifyOnReset` | `true` | POST webhook when quota window resets |\n\n### Reset webhook payload\n\nWhen the rate-limit window rolls over, watcher sends:\n\n```json\n{\n  \"source\": \"codex\",\n  \"direction\": \"token_reset\",\n  \"event\": \"rate_limit_reset\",\n  \"session_id\": \"...\",\n  \"text\": \"Codex rate limit reset. Usage now 12%. Next reset at ...\",\n  \"completed_reset_at\": \"2026-06-23T06:12:03.000Z\",\n  \"next_reset_at\": \"2026-06-23T11:12:03.000Z\",\n  \"used_percent\": 12,\n  \"timestamp\": \"...\"\n}\n```\n\nSkipped when `webhookUrl` is empty and no URL in agent-webhook `hook-config.json`, or `notifyOnReset` is `false`.\n\n### Requirements\n\n- Windows (installer is PowerShell-only for now)\n- Node.js 18+ (installer can install via nvm-windows)\n- PM2\n- Codex signed in once (`~/.codex/auth.json` exists)\n- Codex CLI at `~/.codex/.sandbox-bin/codex.exe` (created by Codex app)\n\n### Notes\n\n- Watcher uses `codex exec resume` — **Codex desktop app does not need to stay open**\n- If the PC was off during a scheduled send, the watcher catches up on next start (`missed-after-offline`)\n- Do **not** run `pm2 start codex-reset-watch.pm2.cjs` directly — use `ecosystem.config.cjs` only\n- Files previously installed flat in `~/.codex/` are migrated to `tools/codex-usage/` on reinstall\n\n\u003c/details\u003e\n\n---\n\n## Repository layout\n\n```\npackages/\n  agent-webhook/\n    install.ps1                          # Windows installer\n    install.sh                           # Linux/macOS installer\n    config.defaults.json                 # Webhook locale defaults\n    scripts/locale_defaults.sh           # Locale detection (Unix installer)\n    runtime/windows/                     # Windows hook runtime\n    runtime/unix/                        # Unix hook runtime\n  codex-usage/\n    install.ps1                          # Windows installer\n    runtime/                             # Codex usage + reset watch scripts\n```\n\n## Installed layout (example)\n\n```\n~/.codex/\n  auth.json                              # Codex app data (not from toolkit)\n  hooks.json                             # points to tools/agent-webhook/\n  tools/\n    agent-webhook/                       # webhook hooks + hook-config.json\n    codex-usage/                         # usage CLI + reset watcher\n\n~/.cursor/\n  hooks.json                             # points to tools/agent-webhook/\n  tools/\n    agent-webhook/                       # webhook hooks + hook-config.json\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhoazero123%2Fai-local-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhoazero123%2Fai-local-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhoazero123%2Fai-local-toolkit/lists"}