π About
Clockify CLI is a powerful command-line tool that bridges the gap between Clockify, Jira, and Tempo, enabling seamless time tracking workflow automation. Whether youβre logging time, syncing data between platforms, or managing tasks, this tool simplifies your daily time tracking routine.
π― Key Features
- π Sync time entries from Clockify to Tempo automatically
- π Manage tasks directly from Jira issues in Clockify
- β±οΈ Start/Stop timers with an intuitive command-line interface and customizable start times
- ποΈ Discard/Delete timers with safety confirmations and time restrictions
- βοΈ Edit existing timers with precise start/end time adjustments
- π View time reports for current week and specific periods with optional detailed breakdown and configurable week start day
- π Monitor timers with desktop notifications
- ποΈ Archive Tasks For Completed Jiras automatically
- βοΈ Easy configuration management for API keys
- π Cross-platform support (Windows, macOS, Linux)
π Installation
Prerequisites
- .NET 8.0 Runtime or later
Install as Global Tool
dotnet tool install --global ClockifyCli
Update to Latest Version
dotnet tool update --global ClockifyCli
Uninstall
dotnet tool uninstall --global ClockifyCli
PowerShell Auto-Completion (Windows)
To enable tab completion for commands and options in PowerShell, add the following to your PowerShell profile:
Temporary Installation (Current Session Only)
# Enable tab completion for the current PowerShell session
Register-ArgumentCompleter -Native -CommandName clockify-cli -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
$command = "$wordToComplete"
if ($command.Length -eq 0) {
$command = ""
}
# Get available commands and options
$commands = @('add', 'add-task-from-jira', 'archive-tasks-for-completed-jiras', 'config', 'delete', 'discard', 'edit', 'full-view', 'start', 'status', 'stop', 'timer-monitor', 'upload-to-tempo', 'week-view')
$options = @('--help', '--version')
# Filter suggestions based on what user has typed
$suggestions = ($commands + $options) | Where-Object { $_ -like "$wordToComplete*" }
foreach ($suggestion in $suggestions) {
[System.Management.Automation.CompletionResult]::new($suggestion, $suggestion, 'ParameterValue', $suggestion)
}
}
Permanent Installation (Add to PowerShell Profile)
# Add to your PowerShell profile for persistent auto-completion
# First, check if you have a PowerShell profile
Test-Path $PROFILE
# If it returns False, create the profile
if (!(Test-Path $PROFILE)) {
New-Item -Type File -Path $PROFILE -Force
}
# Open your profile in notepad (or your preferred editor)
notepad $PROFILE
# Add the Register-ArgumentCompleter block from above to your profile
# Save the file and restart PowerShell or run: . $PROFILE
Note: Auto-completion helps you quickly discover available commands and options by pressing
Tab
while typing commands.
βοΈ Initial Setup
Before using the CLI, you need to configure your API credentials for the services you want to integrate.
1. Set up Configuration
clockify-cli config set
This interactive command will prompt you for:
- Clockify API Key - Get from Clockify β Profile Settings β API
- Jira Username - Your Jira account email
- Jira API Token - Generate from Atlassian Account Settings β Security β API tokens
- Tempo API Key - Get from Tempo β Settings β API Integration
2. Verify Configuration
clockify-cli config view
This shows your current configuration status and masks sensitive values for security.
π Usage Examples
Basic Time Tracking
Add Manual Time Entry
clockify-cli add
- Add a completed time entry with both start and end times
This command is useful for logging time youβve already spent working on a task. It allows you to:
- Select the task from your available Clockify tasks
- Enter a description for the work performed
- Specify both start and end times for the time entry
- Confirm the details before adding to Clockify
Check Current Status
clockify-cli status
- See what timer is currently running
Delete Completed Timer
clockify-cli delete
- Delete completed timers from this week (newest first)
Discard Current Timer
clockify-cli discard
- Permanently delete the currently running timer (cannot be undone)
Edit Existing Timer
clockify-cli edit
- Edit start/end times of existing time entries
clockify-cli edit --days 3
- Look for entries from the last 3 days
Start a Timer
clockify-cli start
- Interactive selection of available tasks with option to start now or at an earlier time
Stop Current Timer
clockify-cli stop
- Stop the currently running timer
View This Weekβs Time Entries
clockify-cli week-view
- Display current weekβs logged time
clockify-cli week-view --include-current
- Include currently running timer in the view
clockify-cli week-view --detailed
- Show detailed view with start time, end time, and duration
clockify-cli week-view --week-start Sunday
- Start the week on Sunday instead of Monday
clockify-cli week-view --include-current --detailed --week-start Wednesday
- Detailed view with custom week start day
Task Management
Add Task From Jira
clockify-cli add-task-from-jira
- Interactive selection to add Jira issues as Clockify tasks
Archive Tasks For Completed Jiras
clockify-cli archive-tasks-for-completed-jiras
- Archive Clockify tasks that are marked as Done in Jira
Data Synchronization
Upload Time to Tempo
clockify-cli upload-to-tempo
- Upload recent time entries to Tempo
clockify-cli upload-to-tempo --days 7
- Upload last 7 days
clockify-cli upload-to-tempo --days 30 --cleanup-orphaned
- Upload last 30 days and cleanup orphaned entries
Monitoring & Automation
Timer Monitoring
clockify-cli timer-monitor
- Check timer status and show notifications
clockify-cli timer-monitor --silent
- Silent mode (no console output)
clockify-cli timer-monitor --always-notify
- Always show notifications regardless of timer state
Schedule Monitoring (Windows)
clockify-cli config schedule-monitor
- Set up scheduled task to monitor every 30 minutes
clockify-cli config schedule-monitor --interval 60
- Custom interval (60 minutes)
clockify-cli config schedule-monitor --remove
- Remove scheduled task
Utility Commands
Open Clockify Web App
clockify-cli full-view
- Open Clockify in your default browser
Help and Information
clockify-cli --help
- Show available commands
clockify-cli start --help
- Show help for specific command
π§ Configuration Management
Configuration Commands
Command | Description |
---|---|
config set |
Interactive setup of API keys and credentials |
config view |
Display current configuration status |
config schedule-monitor |
Set up automated timer monitoring |
Configuration File Location
The configuration is stored securely in your user profile:
- Windows:
%USERPROFILE%\.clockify-cli\config.json
- macOS/Linux:
~/.clockify-cli/config.json
π Command Reference
Time Tracking Commands
Command | Description | Examples |
---|---|---|
add |
Add a completed time entry with both start and end times | clockify-cli add |
delete |
Delete completed timers from this week | clockify-cli delete |
discard |
Permanently delete the currently running timer | clockify-cli discard |
edit |
Edit start/end times of existing time entries | clockify-cli edit --days 7 |
start |
Start a new timer by selecting from available tasks with customizable start time | clockify-cli start |
status |
Display current in-progress time entry | clockify-cli status |
stop |
Stop the currently running timer | clockify-cli stop |
week-view |
Display current weekβs time entries | clockify-cli week-view --include-current --detailed --week-start Sunday |
Task Management Commands
Command | Description | Examples |
---|---|---|
add-task-from-jira |
Add Task From Jira | clockify-cli add-task-from-jira |
archive-tasks-for-completed-jiras |
Archive Tasks For Completed Jiras | clockify-cli archive-tasks-for-completed-jiras |
Integration Commands
Command | Description | Examples |
---|---|---|
timer-monitor |
Monitor timer status with notifications | clockify-cli timer-monitor --silent |
upload-to-tempo |
Upload time entries from Clockify to Tempo | clockify-cli upload-to-tempo --days 7 |
CLI Utility Commands
Command | Description | Examples |
---|---|---|
config set |
Configure API keys and credentials | clockify-cli config set |
config view |
View current configuration | clockify-cli config view |
full-view |
Open Clockify web app in browser | clockify-cli full-view |
π€ Contributing
We welcome contributions! Hereβs how you can help improve Clockify CLI:
Getting Started
- Fork the repository on GitHub
- Clone your fork locally
git clone https://github.com/yourusername/ClockifyCli.git
&cd ClockifyCli
- Set up development environment: Restore dependencies with
dotnet restore
Build the project
dotnet build
Run tests (Coming soon)
dotnet test
Development Guidelines
- Code Style: Follow C# conventions and use consistent formatting
- Dependencies: The project uses minimal dependencies (Spectre.Console, Newtonsoft.Json)
- Target Framework: .NET 8.0
- Testing: Add tests for new features and bug fixes
Making Changes
- Create a feature branch
git checkout -b feature/your-feature-name
- Make your changes and ensure they follow the projectβs coding standards
- Test your changes
dotnet build
anddotnet run -- --help
- Commit your changes
git commit -m "Add: Description of your changes"
- Push and create a Pull Request
git push origin feature/your-feature-name
Types of Contributions Welcome
- π Bug fixes
- β¨ New features
- π Documentation improvements
- π¨ UI/UX enhancements
- β‘ Performance optimizations
- π§ͺ Test coverage improvements
π Support
Getting Help
- π Documentation: Check this README and command help (
--help
) - π Bug Reports: Create an issue on GitHub
- π‘ Feature Requests: Open a feature request on GitHub
- π¬ Discussions: Use GitHub Discussions for questions
Troubleshooting
Common Issues
Configuration Problems
Check your configuration
clockify-cli config view
Reconfigure if needed
clockify-cli config set
API Connection Issues
- Verify your API keys are correct and have proper permissions
- Check your internet connection
- Ensure the services (Clockify/Jira/Tempo) are accessible
Timer Issues
Check current timer status
clockify-cli status
Stop any stuck timers
clockify-cli stop
Reporting Issues
When reporting issues, please include:
- Command used and any relevant flags
- Error message (full output)
- Operating system and .NET version
- Steps to reproduce the issue
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Built with Spectre.Console for beautiful CLI interfaces
- Integrates with Clockify API
- Supports Jira REST API
- Works with Tempo API
Made with β€οΈ by Chris Blyth using Copilot, .NET 8 and Spectre.Console
Streamline your time tracking workflow today! π