This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Clocktopus is a CLI-based time-tracking automation tool for Clockify with idle monitoring, Jira integration, and Google Calendar sync. Built with TypeScript (ESM), Hono web framework, better-sqlite3, and PM2 for daemon management.
- Build:
bun run build(runsbunx tsc, output indist/) - Lint:
bun run lint(eslint with TypeScript parser + Prettier integration) - Start CLI:
bun run clock start - Monitor daemon:
bun run monitor(PM2-managed background process) - Monitor control:
bun run monitor:stop,bun run monitor:restart,bun run monitor:status,bun run monitor:logs - DB cleanup:
bun run db:cleanup - Google auth:
bun run google-auth - Calendar logging:
bun run log-calendar
The clocktopus function cd's to the project and runs bun run. Key aliases:
cbuild/cstart/cstop— build, start clock, stop clockmstart/mstop/mrestart/mstatus/mlogs— PM2 monitor controlcgcalauth/cgcal— Google Calendar auth and logging
- Husky pre-commit hook auto-runs
eslint --fixandprettier --writeon staged files - TypeScript strict mode enabled
- ESM modules (
"type": "module"in package.json)
- Requires
.envindata/with API keys:CLOCKIFY_API_KEY,JIRA_API_KEY, Google OAuth credentials - macOS-specific: uses
desktop-idleandmacos-notification-statefor idle detection - Linux requires
libxss-devandpkg-configfordesktop-idle
- SQLite database stored in
data/directory - Project configuration in
data/projects.json
Uses Bun as the package manager and runtime. Use bun / bunx instead of yarn / npx.