Skip to content

Clockify CLI is a command-line time tracking tool that connects to your Clockify account and lets you start, stop, and manage timers directly from your terminal.

Notifications You must be signed in to change notification settings

mentarch/clockify-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Clockify CLI ⏰

npm version License: MIT Node.js CI Security Rating

A powerful, secure, and user-friendly command-line interface for time tracking with Clockify. Track your time, manage projects, and generate reportsβ€”all from your terminal.

πŸš€ Features

  • ⚑ Fast & Lightweight: Start tracking in milliseconds
  • πŸ”’ Secure: API keys stored in OS keychain/credential manager
  • πŸ“Š Rich Reports: Daily, weekly, monthly summaries with export options
  • 🎯 Project Management: Create and manage projects, tasks, and clients
  • 🌐 Cross-Platform: Works on macOS, Linux, and Windows
  • πŸ“± Offline Support: Cache data for offline viewing
  • 🎨 Beautiful Output: Colorized, formatted tables and status indicators

πŸ“¦ Installation

npm (Recommended)

npm install -g clockify-cli

Homebrew (macOS)

brew install clockify-cli

Download Binary

Download pre-built binaries from GitHub Releases.

πŸ”§ Quick Start

  1. Get your API key from Clockify Settings

  2. Login and configure:

    clockify auth login
  3. Start tracking time:

    clockify start -p "My Project" -d "Working on awesome features"
  4. Check your status:

    clockify status
  5. Stop tracking:

    clockify stop

πŸ“– Usage

Authentication

# Configure API key
clockify auth login --key YOUR_API_KEY

# Check authentication status
clockify auth status

# Remove credentials
clockify auth logout

Time Tracking

# Start timer
clockify start --project "Web Development" --task "Frontend" --description "Building UI components"

# Quick start (with aliases)
clockify start -p "Web Dev" -t "Frontend" -d "Building UI"

# Stop current timer
clockify stop

# Pause/resume timer
clockify pause
clockify resume

# Check current status
clockify status

Manual Time Entries

# Add time entry with duration
clockify add 2h30m -p "Project" -d "Past work"

# Add with specific start/end times
clockify add 1h --start-time "09:00" --end-time "10:00"

# Edit existing entry
clockify edit ENTRY_ID --description "Updated description"

# Delete entry
clockify delete ENTRY_ID

Projects & Tasks

# List projects
clockify projects list

# Create new project
clockify projects create "New Project" --client "Client Name"

# List tasks for project
clockify tasks list "Project Name"

# Create task
clockify tasks create "New Task" --project "Project Name"

Reports & Analytics

# Today's summary
clockify report today

# This week's summary
clockify report week

# Custom date range
clockify report custom --start 2023-10-01 --end 2023-10-31

# Export data
clockify export csv --start 2023-10-01 --output timesheet.csv

Configuration

# Show current config
clockify config show

# Set default project
clockify config set defaultProject "My Main Project"

# Switch workspace
clockify workspace switch "Other Workspace"

πŸ”’ Security

This project takes security seriously:

  • πŸ” Secure Credential Storage: API keys stored in OS keychain/credential manager
  • πŸ›‘οΈ Input Validation: All inputs sanitized and validated
  • πŸ“‘ HTTPS Only: All API communications over encrypted connections
  • πŸ” Dependency Scanning: Regular security audits with Snyk and npm audit
  • 🚫 No Secrets in Code: Zero hardcoded credentials or sensitive data

Security Best Practices

  1. Never share your API key in code or commit it to version control
  2. Use environment variables for CI/CD: CLOCKIFY_API_KEY=your_key
  3. Regularly rotate your API keys in Clockify settings
  4. Report security issues via our security policy

πŸ“Š Examples

Daily Workflow

# Morning: Start work
clockify start -p "Client Project" -d "Daily standup and planning"

# Switch tasks
clockify stop
clockify start -p "Client Project" -t "Development" -d "Implementing user authentication"

# Lunch break (automatic pause)
clockify pause

# Resume after lunch
clockify resume

# End of day
clockify stop
clockify report today

Weekly Review

# Generate weekly report
clockify report week --format table

# Export for timesheet
clockify export csv --start $(date -d 'last monday' +%Y-%m-%d) --output weekly-timesheet.csv

# Project breakdown
clockify report custom --start $(date -d 'last monday' +%Y-%m-%d) --project "Main Project"

πŸ› οΈ Development

Prerequisites

  • Node.js 16+
  • npm 7+

Setup

# Clone repository
git clone https://github.com/yourusername/clockify-cli.git
cd clockify-cli

# Install dependencies
npm install

# Build project
npm run build

# Run in development
npm run dev -- auth status

Testing

# Run tests
npm test

# Watch mode
npm run test:watch

# Coverage report
npm run test:coverage

# Security audit
npm run security

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and add tests
  4. Run security checks: npm run security
  5. Commit changes: git commit -m 'Add amazing feature'
  6. Push to branch: git push origin feature/amazing-feature
  7. Open a Pull Request

Please read our Contributing Guidelines and Code of Conduct.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

🀝 Support

πŸ™ Acknowledgments

  • Clockify for providing an excellent time tracking API
  • Commander.js for CLI framework
  • All contributors and users who make this project better

⭐ Star History

Star History Chart


Made with ❀️ for developers who value their time

About

Clockify CLI is a command-line time tracking tool that connects to your Clockify account and lets you start, stop, and manage timers directly from your terminal.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •