Automated time tracking for Clockify with Jira integration
Automatically create time entries, sync with Jira tasks, and generate monthly reports.
Features β’ Installation β’ Quick Start β’ Documentation β’ Contributing
- π Automated Time Tracking: Automatically creates daily time entries in Clockify
- π Missing Entries Detection: Scans and fills gaps in your time tracking history with concurrent processing
- π― Smart Jira Integration: Uses latest assigned non-completed Jira tasks with configurable fallback descriptions
- β° Configurable Work Hours: Set custom start/end times for your workday
- π Monthly Reports: Generates PDF reports at month-end
- β‘ High Performance: Concurrent API calls with intelligent rate limiting (8x faster)
- π‘οΈ 2025 API Ready: Updated for latest Clockify and Jira API versions
- πΎ SQLite Storage: Reliable local database with automatic migrations
- π¨ Interactive Setup: CLI wizard for configuration
- βοΈ Advanced Scheduling: PM2-powered scheduler with catch-up runs and configurable schedules
- π Analytics: Time tracking analytics with financial insights
- π° Financial Tracking: Hourly rate configuration with earnings calculations and projections
- π Log Management: Log access and monitoring via CLI
- π§ Configuration Management: Config management with help and validation
# Install globally via npm
npm install -g clockify-auto-fill
# Or using yarn
yarn global add clockify-auto-fill
# Or using pnpm
pnpm add -g clockify-auto-fillRun the interactive setup wizard:
clockify-auto setupThis will guide you through:
- Clockify API configuration and workspace selection
- Jira integration setup (optional)
- Report generation preferences
# Create today's time entry (if missing) and check for gaps
clockify-auto run
# View current configuration
clockify-auto info
# Open configuration manager
clockify-auto config- Node.js 20+
- Clockify Account with API access
- Jira Cloud Account (optional, for task integration)
npm install -g clockify-auto-fill- Go to Clockify Settings > API
- Copy your API key
- Go to Atlassian Account Settings
- Create a new API token
- For 2025 compatibility, consider using scoped tokens (ATATT format)
clockify-auto setupThe wizard will:
- β Validate your Clockify API key
- π’ Fetch and let you select your workspace
- π Fetch and let you select your project
- π― Configure Jira integration (optional)
- π Set up report generation directory
- β¨ Test the complete integration
| Command | Description |
|---|---|
clockify-auto run |
Execute daily time entry process |
clockify-auto setup |
Interactive setup wizard |
clockify-auto info |
Show configuration and status |
| Command | Description |
|---|---|
clockify-auto config list |
List all configuration keys and current values |
clockify-auto config help |
Show all available configuration options |
clockify-auto config get [key] |
Get specific configuration value |
clockify-auto config set <key> <value> |
Set configuration value |
clockify-auto config wizard |
Re-run setup wizard |
clockify-auto config validate |
Validate current configuration |
clockify-auto config reset |
Reset configuration |
clockify-auto config export |
Export configuration to file |
clockify-auto config import <file> |
Import configuration from file |
| Command | Description |
|---|---|
clockify-auto schedule enable |
Enable automated scheduling with PM2 |
clockify-auto schedule disable |
Disable automated scheduling |
clockify-auto schedule status |
Check scheduler status |
clockify-auto schedule set-time "18:00" |
Set schedule time |
clockify-auto schedule set-days "[1,2,3,4,5]" |
Set schedule days |
clockify-auto schedule show-config |
Show scheduler configuration |
clockify-auto schedule history |
Show execution history |
| Command | Description |
|---|---|
clockify-auto analytics |
Show month-to-date analytics summary |
clockify-auto analytics summary |
Customizable analytics summary |
clockify-auto analytics time |
Detailed time tracking analytics |
clockify-auto analytics tasks |
Task and project analytics |
clockify-auto analytics scheduler |
Scheduler performance analytics |
| Command | Description |
|---|---|
clockify-auto logs |
Show recent scheduler logs |
clockify-auto logs show -f |
Follow logs in real-time |
clockify-auto logs show -t error |
Show error logs |
clockify-auto logs path |
Show log file locations |
clockify-auto logs clear |
Clear all log files |
| Command | Description |
|---|---|
clockify-auto tasks |
Manage task descriptions |
Configuration is stored in ~/.clockify-auto/config.json:
{
"clockifyApiKey": "your-api-key",
"workspaceId": "workspace-id",
"projectId": "project-id",
"jiraBaseUrl": "https://company.atlassian.net",
"jiraEmail": "your-email@company.com",
"jiraApiKey": "your-jira-token",
"reportDir": "/path/to/reports",
"defaultStartTime": "09:00",
"defaultEndTime": "17:00",
"scheduleTime": "18:00",
"scheduleDays": [1, 2, 3, 4, 5],
"fallbackTaskDescription": "Retro, refinement and planning",
"hourlyRate": 35.50
}You can also use environment variables:
export CLOCKIFY_API_KEY="your-api-key"
export CLOCKIFY_WORKSPACE_ID="workspace-id"
export CLOCKIFY_PROJECT_ID="project-id"
export JIRA_BASE_URL="https://company.atlassian.net"
export JIRA_EMAIL="your-email@company.com"
export JIRA_API_KEY="your-jira-token"
export REPORT_DIR="/path/to/reports"
export DEFAULT_START_TIME="09:00"
export DEFAULT_END_TIME="17:00"Configure your default work hours for automatic time entry creation:
# Set work hours using config commands
clockify-auto config set defaultStartTime "08:30"
clockify-auto config set defaultEndTime "17:30"
# View current work hours
clockify-auto config get defaultStartTime
clockify-auto config get defaultEndTimeSupported Time Formats:
- Use 24-hour format:
HH:mm(e.g., "09:00", "17:30") - Minimum duration: 1 hour
- Maximum duration: 24 hours
- Start time must be before end time
Examples:
- Standard 9-5:
"09:00"to"17:00"(8 hours) - Early bird:
"07:00"to"15:00"(8 hours) - Flexible:
"10:30"to"18:30"(8 hours) - Part-time:
"09:00"to"13:00"(4 hours)
If not configured, the default work hours are 9:00 AM to 5:00 PM.
The recommended approach is to use the built-in PM2-powered scheduler:
# Enable automated scheduling
clockify-auto schedule enable
# Configure schedule time (default: 18:00)
clockify-auto schedule set-time "18:00"
# Configure schedule days (default: weekdays)
clockify-auto schedule set-days "[1,2,3,4,5]"
# Check scheduler status
clockify-auto schedule status
# View execution history
clockify-auto schedule history
# Disable scheduling
clockify-auto schedule disableFeatures:
- Catch-up runs: Automatically runs missed schedules when system restarts
- Persistent logging: All runs logged to
~/.clockify-auto-cli/directory - Process management: Uses PM2 for reliable background execution
- Configurable timing: Flexible schedule configuration
Add to your crontab (crontab -e):
# Run every weekday at 9 AM
0 9 * * 1-5 /usr/local/bin/clockify-auto run
# Run every weekday at 6 PM (catch any missed entries)
0 18 * * 1-5 /usr/local/bin/clockify-auto runCreate .github/workflows/clockify-auto.yml:
name: Clockify Auto-Fill
on:
schedule:
# Run at 9 AM UTC, Monday to Friday
- cron: '0 9 * * 1-5'
workflow_dispatch: # Allow manual trigger
jobs:
fill-time:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Clockify Auto-Fill
run: npm install -g clockify-auto-fill
- name: Run Time Entry Process
run: clockify-auto run
env:
CLOCKIFY_API_KEY: ${{ secrets.CLOCKIFY_API_KEY }}
CLOCKIFY_WORKSPACE_ID: ${{ secrets.CLOCKIFY_WORKSPACE_ID }}
CLOCKIFY_PROJECT_ID: ${{ secrets.CLOCKIFY_PROJECT_ID }}
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }}
JIRA_API_KEY: ${{ secrets.JIRA_API_KEY }}- Open Task Scheduler
- Create Basic Task
- Set trigger (e.g., daily at 9 AM)
- Set action:
clockify-auto run
Get insights into your time tracking patterns:
# Month-to-date summary (default)
clockify-auto analytics
# Custom date ranges
clockify-auto analytics summary --days 7
clockify-auto analytics summary --from 2025-01-01 --to 2025-01-31
# Detailed time patterns
clockify-auto analytics time
# Task analytics
clockify-auto analytics tasks
# Scheduler performance
clockify-auto analytics scheduler
# Export analytics to CSV
clockify-auto analytics time --export report.csvConfigure hourly rate for earnings calculations:
# Set your hourly rate
clockify-auto config set hourlyRate 35.50
# View financial analytics
clockify-auto analytics
# Analytics will show:
# - Period earnings
# - Monthly progress (working days, hours worked)
# - Expected vs actual remuneration
# - Projected month-end earningsFinancial Analytics Include:
- Current month progress tracking
- Hours worked vs expected hours
- Remuneration earned vs expected
- Projected month-end earnings based on current pace
- Working days calculation (excludes weekends)
Monitor scheduler activity and troubleshoot issues:
# View recent scheduler logs
clockify-auto logs
# Follow logs in real-time
clockify-auto logs show -f
# View error logs
clockify-auto logs show -t error
# Show log file locations
clockify-auto logs path
# Clear logs
clockify-auto logs clearAutomatically generated on the last business day of each month:
- π Time Summary: Total hours, daily breakdowns
- π Task Details: All time entries with descriptions
- π¨ Professional Format: Clean, printable PDF layout
- π Auto-Organization: Saved to configured reports directory
Example report structure:
~/Documents/Clockify-Reports/
βββ clockify-report-2025-01.pdf
βββ clockify-report-2025-02.pdf
βββ clockify-report-2025-03.pdf
When configured, the tool will:
- π― Fetch Latest Tasks: Gets your most recently assigned non-completed Jira issues
- π Use Task Titles: Uses the issue summary as the time entry description
- π Configurable Fallback: Uses configurable fallback description when no active tasks found
Configure Fallback Description:
# Set custom fallback description
clockify-auto config set fallbackTaskDescription "Planning and meetings"
# Default fallback is "Retro, refinement and planning"Supported Jira Setups:
- Jira Cloud (2025 API v3 compatible)
- Standard API tokens
- Scoped API tokens (ATATT format)
- Custom Jira installations
Clockify API:
- β REST API v1 (latest)
- β Reports API v1
- β Proper user ID resolution
- β Rate limiting compliance
Jira API:
- β REST API v3 (latest)
- β Cloud ID resolution for scoped tokens
- β GDPR-compliant user identification
- β 2025 authentication standards
- π Authentication: Validates API credentials
- π Date Analysis: Determines business days to check
- β‘ Batch Checking: Concurrently checks multiple dates for missing entries
- π― Jira Sync: Fetches current assigned task for descriptions
- β Entry Creation: Creates missing time entries in batches
- πΎ Local Storage: Stores entries in SQLite database for reference
- π Reporting: Generates monthly PDF reports when needed
- π Concurrent API Calls: Up to 8x faster than sequential processing
- π‘οΈ Rate Limit Handling: Intelligent batching to avoid API limits
- π± Progress Feedback: Real-time progress indicators
- π Retry Logic: Automatic retry on transient failures
- πΎ Caching: Efficient data storage to minimize API calls
- Node.js 20+
- npm or yarn
# Clone the repository
git clone https://github.com/mihazs/clockify-auto-fill.git
cd clockify-auto-fill
# Install dependencies
npm install
# Build the project
npm run build
# Link for local testing
npm link
# Run tests
npm test
# Run linting
npm run lintβββ src/
β βββ commands/ # CLI command implementations
β βββ services/ # Core business logic
β βββ utils/ # Utility functions
β βββ index.ts # CLI entry point
βββ tests/ # Test files
βββ dist/ # Compiled JavaScript
βββ docs/ # Documentation
βββ .github/ # GitHub Actions workflows
| Script | Description |
|---|---|
npm run build |
Compile TypeScript to JavaScript |
npm run dev |
Build in watch mode |
npm test |
Run test suite |
npm run test:watch |
Run tests in watch mode |
npm run lint |
Run ESLint |
npm run lint:fix |
Fix ESLint issues |
npm run semantic-release |
Create automated release |
npm run semantic-release:dry-run |
Preview release changes |
npm run test:release |
Test semantic-release configuration |
npm run test:direct-push |
Learn about direct push workflow |
This project uses automated semantic releases powered by semantic-release:
- Development: Make changes using conventional commits
- Push to Main: Either create PR and merge, or push directly to
main - Automated Release: On any push to
main(PR merge or direct push), semantic-release will:- Analyze commits to determine version bump
- Generate changelog from conventional commits
- Create Git tags automatically (format:
v1.2.3) - Create GitHub release with release notes
- Publish to npm automatically
- Update version in package.json
- Commit changes back to repository
| Commit Type | Example | Version Bump |
|---|---|---|
feat: |
feat: add custom work hours |
Minor (1.1.0) |
fix: |
fix: resolve API rate limiting |
Patch (1.0.1) |
feat!: |
feat!: remove Node 18 support |
Major (2.0.0) |
docs:, refactor: |
docs: update README |
Patch (1.0.1) |
chore:, style:, test: |
chore: update deps |
No release |
# Preview what would be released (no changes made)
npm run semantic-release:dry-run
# View commit history for release planning
git log --oneline --decorate --graph
# View existing tags
git tag --list --sort=-version:refname
# View latest release tag
git describe --tags --abbrev=0- Production releases:
v1.2.3(frommainbranch) - Beta releases:
v1.2.3-beta.1(fromdevelopbranch) - All tags are automatically created and pushed during the release process
The automated release process supports multiple trigger methods:
-
PR Merge: Merge pull request into
mainbranchgit checkout feature-branch git commit -m "feat: add awesome feature" # Create PR, review, and merge
-
Direct Push: Push conventional commits directly to
maingit checkout main git commit -m "fix: resolve critical bug" git push origin main # β Triggers automatic release
-
Manual Trigger: Use GitHub Actions workflow dispatch
- Go to Actions β Release β Run workflow
- Option to force release even without new commits
All methods will automatically create Git tags and releases! π·οΈ
# Verify your API key
clockify-auto config validate
# Or reset and reconfigure
clockify-auto config reset
clockify-auto setup- Check if your API key has sufficient permissions
- For Jira: Ensure you have access to assigned issues
- For Clockify Reports: The tool automatically handles permission restrictions
The tool has built-in rate limiting, but if you encounter this:
- Wait a few minutes for the rate limit to reset
- The tool will automatically retry with delays
# Force a comprehensive check
clockify-auto run
# Validate configuration
clockify-auto config validateEnable verbose logging:
DEBUG=clockify-auto:* clockify-auto run- π Check this documentation
- π Open an issue
- π¬ Start a discussion
We welcome contributions! See CONTRIBUTING.md for details.
- π΄ Fork the repository
- π Create a feature branch:
git checkout -b feature/amazing-feature - π» Make your changes
- β Add tests for new functionality
- π§ͺ Run the test suite:
npm test - π Commit your changes:
git commit -m 'Add amazing feature' - π Push to the branch:
git push origin feature/amazing-feature - π Open a Pull Request
- Use TypeScript for type safety
- Add tests for new features
- Follow existing code style
- Update documentation
- Ensure CI passes
This project is licensed under the MIT License - see the LICENSE file for details.
- Clockify for the excellent time tracking platform
- Atlassian for Jira integration capabilities
- The open source community for inspiration and tools
- Analytics & Financial Tracking: Time tracking insights and earnings calculations
- Advanced Scheduling: PM2-powered scheduler with catch-up functionality
- Log Management: Comprehensive logging and monitoring tools
- Smart Jira Integration: Latest task prioritization with configurable fallbacks
- Configuration Management: Complete config system with help and validation
- Multiple Project Support: Handle multiple Clockify projects
- Team Integration: Bulk operations for team management
- Web Dashboard: Optional web interface for management
- Slack Integration: Notifications and commands via Slack
- Timezone Support: Better handling of different timezones
β Star this project if you find it useful!
Made with β€οΈ for developers who forget to track time