{"id":46410133,"url":"https://github.com/angristan/codex-wakatime","last_synced_at":"2026-03-05T13:12:28.006Z","repository":{"id":330123253,"uuid":"1121245054","full_name":"angristan/codex-wakatime","owner":"angristan","description":"Codex plugin for Wakatime","archived":false,"fork":false,"pushed_at":"2026-01-25T22:52:31.000Z","size":581,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-26T14:07:51.400Z","etag":null,"topics":["codex","codex-cli","codex-plugin","coding-agent","wakatime"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/codex-wakatime","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angristan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2025-12-22T17:04:56.000Z","updated_at":"2026-01-26T09:50:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/angristan/codex-wakatime","commit_stats":null,"previous_names":["angristan/codex-wakatime"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/angristan/codex-wakatime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Fcodex-wakatime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Fcodex-wakatime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Fcodex-wakatime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Fcodex-wakatime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angristan","download_url":"https://codeload.github.com/angristan/codex-wakatime/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Fcodex-wakatime/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30127436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T12:40:50.676Z","status":"ssl_error","status_checked_at":"2026-03-05T12:39:32.209Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","codex-cli","codex-plugin","coding-agent","wakatime"],"created_at":"2026-03-05T13:12:27.420Z","updated_at":"2026-03-05T13:12:27.997Z","avatar_url":"https://github.com/angristan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# codex-wakatime\n\n[![npm version](https://img.shields.io/npm/v/codex-wakatime)](https://www.npmjs.com/package/codex-wakatime)\n[![npm downloads](https://img.shields.io/npm/dm/codex-wakatime)](https://www.npmjs.com/package/codex-wakatime)\n[![CI](https://github.com/angristan/codex-wakatime/actions/workflows/workflow.yml/badge.svg)](https://github.com/angristan/codex-wakatime/actions/workflows/workflow.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nWakaTime integration for [OpenAI Codex CLI](https://github.com/openai/codex). Track AI coding activity and time spent.\n\n\u003e [!TIP]\n\u003e Also check out [opencode-wakatime](https://github.com/angristan/opencode-wakatime) for OpenCode!\n\n## Features\n\n- Automatic time tracking for Codex CLI sessions\n- File-level activity detection via message parsing\n- 60-second heartbeat rate limiting\n- Automatic WakaTime CLI installation and updates\n- Cross-platform support (macOS, Linux, Windows)\n\n## Prerequisites\n\n1. [WakaTime account](https://wakatime.com) and API key\n2. WakaTime API key configured in `~/.wakatime.cfg`:\n   ```ini\n   [settings]\n   api_key = your-api-key-here\n   ```\n3. [Codex CLI](https://github.com/openai/codex) installed\n\n## Installation\n\n```bash\n# Install the package\nnpm install -g codex-wakatime\n\n# Configure the notification hook\ncodex-wakatime --install\n```\n\nThis adds `notify = [\"codex-wakatime\"]` to your `~/.codex/config.toml`.\nIf you already have a `notify` command configured, codex-wakatime replaces it\nbecause Codex supports a single notify command.\n\n## How It Works\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                     Codex CLI Session                        │\n└─────────────────────────┬───────────────────────────────────┘\n                          │\n                          ▼\n┌─────────────────────────────────────────────────────────────┐\n│              agent-turn-complete event                       │\n│   Codex sends notification with:                             │\n│   - thread-id, turn-id                                       │\n│   - cwd (working directory)                                  │\n│   - last-assistant-message                                   │\n└─────────────────────────┬───────────────────────────────────┘\n                          │\n                          ▼\n┌─────────────────────────────────────────────────────────────┐\n│                   codex-wakatime                             │\n│   1. Parse notification JSON from CLI argument               │\n│   2. Extract file paths from assistant message               │\n│   3. Check 60-second rate limit                              │\n│   4. Send heartbeat(s) to WakaTime                           │\n└─────────────────────────┬───────────────────────────────────┘\n                          │\n                          ▼\n┌─────────────────────────────────────────────────────────────┐\n│                   WakaTime Dashboard                         │\n│   View your AI coding metrics at wakatime.com                │\n└─────────────────────────────────────────────────────────────┘\n```\n\n### Notification Hook\n\n| Event | Purpose |\n|-------|---------|\n| `agent-turn-complete` | Triggered after each Codex turn completes |\n\n### File Detection Patterns\n\nThe plugin extracts file paths from the assistant's response using these patterns:\n\n- **Code block headers**: ` ```typescript:src/index.ts `\n- **Backtick paths**: `` `src/file.ts` ``\n- **Action patterns**: `Created src/file.ts`, `Modified package.json`\n- **Quoted paths**: `\"src/file.ts\"` or `'src/file.ts'`\n\nIf no files are detected, a project-level heartbeat is sent using the working directory.\n\n## Configuration\n\nThe plugin auto-configures `~/.codex/config.toml` on installation:\n\n```toml\nnotify = [\"codex-wakatime\"]\n```\n\n### Debug Mode\n\nEnable debug logging by adding to `~/.wakatime.cfg`:\n\n```ini\n[settings]\ndebug = true\n```\n\nLogs are written to `~/.wakatime/codex.log`.\n\n## Files \u0026 Locations\n\n| File | Purpose |\n|------|---------|\n| `~/.wakatime/codex.json` | Rate limiting state |\n| `~/.wakatime/codex.log` | Debug logs |\n| `~/.wakatime/codex-cli-state.json` | CLI version tracking |\n| `~/.codex/config.toml` | Codex configuration |\n| `~/.wakatime.cfg` | WakaTime API key and settings |\n\n## Development\n\n```bash\n# Clone the repository\ngit clone https://github.com/angristan/codex-wakatime\ncd codex-wakatime\n\n# Install dependencies\nnpm install\n\n# Build\nnpm run build\n\n# Run tests\nnpm test\n\n# Type check\nnpm run typecheck\n\n# Lint\nnpm run check\n```\n\n### Project Structure\n\n```\ncodex-wakatime/\n├── src/\n│   ├── index.ts          # Main entry point\n│   ├── install.ts        # Hook installation\n│   ├── extractor.ts      # File path extraction\n│   ├── wakatime.ts       # CLI invocation\n│   ├── dependencies.ts   # CLI management\n│   ├── state.ts          # Rate limiting\n│   ├── logger.ts         # Logging\n│   ├── options.ts        # Config parsing\n│   ├── types.ts          # TypeScript interfaces\n│   └── __tests__/        # Test files\n├── package.json\n├── tsconfig.json\n└── biome.json\n```\n\n## Uninstall\n\n```bash\n# Remove the notification hook\ncodex-wakatime --uninstall\n\n# Uninstall the package\nnpm uninstall -g codex-wakatime\n```\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `codex-wakatime --install` | Add notification hook to Codex config |\n| `codex-wakatime --uninstall` | Remove notification hook from Codex config |\n| `codex-wakatime '{\"type\":\"agent-turn-complete\",...}'` | Process a notification (called by Codex) |\n\n## Troubleshooting\n\n### No heartbeats being sent\n\n1. Check that your API key is configured in `~/.wakatime.cfg`\n2. Verify the notify hook is set in `~/.codex/config.toml`\n3. Enable debug mode and check `~/.wakatime/codex.log`\n\n### Rate limiting\n\nHeartbeats are rate-limited to once per 60 seconds. If you're testing, wait at least 60 seconds between Codex turns.\n\n### CLI not found\n\nThe plugin automatically downloads `wakatime-cli` if not found. If this fails:\n\n1. Check your internet connection\n2. Manually install: https://github.com/wakatime/wakatime-cli/releases\n3. Ensure `wakatime-cli` is in your PATH\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangristan%2Fcodex-wakatime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangristan%2Fcodex-wakatime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangristan%2Fcodex-wakatime/lists"}